Nexus Modding > Scripting
Scripting Issues
Mularac:
well, I sorted it out. Sort of. Just prevented that the wreck could be fired upon, thus, you were never capable of destroying it :P
as for your problem:
are you doing some campaign scripting? Because if you are, then you're problem is a real easy one. Instead of giving them a GetSceneObj, you could call them with the uGet("name_of_the_ship") command, and check whatever you need to check.
Arparso:
Oh, don't use a tick rule for that. Nexus indeed has a special event for exploding ships, called "Exploding" :P
--- Code: --- RULE event Exploding
:action
Debug("Oh my god!", E.ship, "is exploding");
:end
END
--- End code ---
If you only want to watch a particular ship, check if E.ship is the one you wanted to keep an eye on as a :condition like so:
--- Code: --- RULE event Exploding
:condition E.ship = WatchedShip
:action
Debug("Oh my god!", E.ship, "is exploding");
:end
END
--- End code ---
... or if you want to watch a selected group of ships (you previously added to a list) ...
--- Code: --- RULE event Exploding
:condition InSelection(E.ship, MyListOfWatchedShips)
:action
Debug("Oh my god!", E.ship, "is exploding");
:end
END
--- End code ---
And btw.: Nexus also "works" with wrecked ships, but you can't use SelectShips() for that, because SelectShips(condition) is nothing different than Select(s.ship & condition)... it even states that in the manual. Since s.ship is only ever true for not-wrecked ships, SelectShips will never ever return a wrecked one. Use plain old Select(s.wreck) for that... ;)
The Old Dragon:
Ahh, thanks Arparso... another tidbit learned :thumbup:
@Mularac...
Always doing campaign stuff these days, recently finished the 'general' scenes that the player can visit. Now moving onto background events, this should be fun...
Mularac:
I got a question, how do you select all the devices belonging to a given set? just like you did with the shields, but with sets. I've managed to do when working with a single device, but when it comes to set it still eludes me... (not a priority, though)
The Old Dragon:
With the 'InSet' condition is how I normally do it.
--- Code: ---SelectDevices(1,InSet(S.this,25));
--- End code ---
Where the second number dictates the set you're looking for.
If you want to collect them from multiple ships, then you'll need to create a list of those ships first and place the SelectD command within an 'execlist' command.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version