Nexus Modding > Scripting
Scripting Issues
The Old Dragon:
Welcome to campaign level scripting, if nexus doesn't find a file it needs, then it throws temper tantrums like a spoilt brat!
As for renaming ships, there is a 'rename' command...
--- Code: ---RenameShip(ship, name);
It renames the ship.
--- End code ---
or why not give the ship the name you wish in the .Sobj file? seems to work fine for me...
Arparso:
Yeah, Nexus error handling mechanic can be summed up by "OMG!!! CRASH!!!"... except when you're in the editor, which gives you pretty useful error messages most of the time. But even the most minor script error will crash the game, no matter how trivial it really is.
Regarding ship names: the most elegant solution would be to create a proper text file containing the proper name for your ship in all the languages you want to cater to. Nexus does it that way in universetextstextsfleets.ini. For example, the Stiletto of the vanilla campaign is named "ship_stiletto" in the .sobj-files - so it's corresponding entry in the fleets.ini file looks like this:
--- Code: ---TEXT "ship_Stiletto"
0 "Stiletto" $$data "07/23/2004 15:06:45" "" 1
1 "Stiletto" $$data "08/18/2004 09:31:54" "" 1
2 "Stiletto" $$data "06/23/2004 16:44:35" "" 1
3 "Stiletto" $$data "07/23/2004 15:06:45" "" 1
5 "Stiletto" $$data "09/02/2004 16:00:38" "" 1
END
--- End code ---
Each line in the text block corresponds to a different language, identified by the starting number (0 = English, 1 = German, 2 = Hungarian, 3 = French, 5 = Italian ... at least I think so). "Stiletto" would be the ship's name for each of these five languages, but you could totally translate each name to each language as you can do with every text entry (like dialogues, for example). You can forget about the $$data stuff and everything after it - probably just remainders of a proprietary tool Mithis used to manage all their text entries.
Mularac:
oh... thanks, to the both of you. And no Old Dragon, I can't really do that, as I for example have the Angelwing sindrom on one of the ships, it'lll change during one of the missions... so assigning the same name to both ships doesn't seem to be the right thing to do...
And I get the error when I press start campaign, so where do you think the bugger is? episode_1.rules? tacticstypes.ini? some missing entry in one of the text files? (it's not the 1° mission, I've already tested that)
Nevermind, solved it...
Mularac:
here's a quick one: how do you detect that a wrecked ship has been destroyed? (modification level scripting, not campaign)
The Old Dragon:
It might be a quick question, but I doubt the answer will be.
I've recently been playing around with wrecks myself (one of the N:TAA scenes is set in a ship graveyard). So far, I've been having problems with manipulating them in the normal ways (selectships,etc) because nexus only 'works' with live ships, though wrecks still count towards the scenes total objects! However, if you assign it a name in the normal way then you can use them in your scripts, it's just damn long-winded manually adding them to lists! But getting back to your question...
Assuming that this is an objective event that your working on (and therefore quite specific in what you're watching), what you could try...
1) Is to assign the wreck a name.
2) Using a 'tick' rule, maybe you could keep an eye on the wrecks damage level, something like...
--- Code: ---If(M.Wreck1:damage=0, localevent(Call something rule));
--- End code ---
However, the tick could miss it and crash the scene :(
3) There may be a preset 'exploding' rule in the manual, perhaps you could use that with the wrecks name as a condition?
As I've not really needed to know when a wrecks gone nova, all I've got are some theories, but maybe it'll put you on the right path though.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version