Nexus Modding > Scripting

Campaign Scripting

<< < (2/4) > >>

Mularac:
yeah, I've figured that out by now... the universal conflicts mod turned out to be quite useful for that, but I still couldn't sort the problem out. It's driving me nuts (although I managed a similar crash when removing the ships that were supposed to be on the loadout from the player_fleet.sobj, so I guess nexus doesn't like an empty screen for the loadout, however, it didn't help me... after I fixed that on my campaign (adding the corresponding ship to the player_fleet.sobj file) the crash continued to exist... it's pretty annoying...)

Arparso:
The uSetParent command seems just to assign certain objects to a certain parent object. Think of it as a file-folder structure, where each file and folder has a parent folder it resides in. This way you can move NPCs from one ship to another or assign ships to a fleet simply by setting their parent object accordingly. For example:


--- Code: ---Stiletto:uSetParent(uGetPlayersFleet());
--- End code ---

This takes the object referenced by the "Stiletto" variable and assigns it to the player's fleet. uGetPlayersFleet() actually returns a reference to the current fleet the player controls... it doesn't matter, what ships are listed in the "player_fleet.sobj" file - the file name is meaningless for the game and just follows the developer's personal naming convention. A ship only becomes part of the player's fleet when adding it to the player's fleet manually using :uSetParent(uGetPlayersFleet())

uSetParent() can be used for all sorts of parent-child relations like, for example:


--- Code: ---// moves the player character to the ship Stiletto
uGetNPC(#NPC_Player):uSetParent(C.Stiletto);

// moves the player's fleet to Michelangelo station
uGetPlayersFleet():uSetParent(uGet("stat_Michelangelo"));
--- End code ---

I don't know the cause of your crash, but at least you should confirm you've got actual ships in the player's fleet. Adding those ships to the right .sobj file doesn't cut it - you'll need to use uSetParent() as well.

Mularac:
yes, I've been using that from day 1, otherwise the ships in the missions would have never showed up.

Old Dragon, could you send me a copy of your episode_1.rules? I'd like to take a look at it, see if there's something in common with mine, to see if I can pinpoint that crash, I'm confident that the bug is there.

Mularac:
Ok... Found the bloody bugger. Actually, bugger"s" :P
the first bug I found was that there was no written reference to my ships' npc's on the gsflt_npcdesc.ini file in the textstexts folder. I found that one out by replacing my tacticstypes.ini with the one of the original campaign, however, when I put back my own tactics, the blasted thing won't work. I got a crash, again. So, I went back to the original tactics and started to brutally mutilate it, leaving only one shiptype and the corresponding shipclass, plus the asteroids, of course (thanks Old Dragon for the tip). I tried it and it worked. So, it was now time for the big test. I replaced the shipclass (cls_frigate) with one of my own (Ship_Hatak), however, once I gave it a shot, I got a crash. So, making this short, I found an other issue. There's, somewhere, a .ini files that links the names of the shipclass (not the shipclass.ini, I checked...) to something else, and it would only present an issue on the fleet loadout screen. The thing is, I can't seem to locate such file. Going back to my example, the shipclass cls_frigate, when I opened the fleet loadout screen, there's a label on the upper screen reading "type: frigate". My first assumption was that it had something to do with the shipclass.ini, but when i deleted the cls_frigate entry from it, the label would remain there unchanged. Same with the gsflt_scinfos.ini file. So, my question is this: do you know of any other file that would make reference to the, for instance, cls_frigate entry? (I also tested it with the universe_conflicts mod, setting one of the ships that mod had added as a configurable ship. I got the same crash, so it must be something closely related to the vanilla ships)

Mularac:
Found an other thing, the ship's icon on the loadout screen is the one of the vanilla ship, the one the name makes reference to (cls_frigate) despite the fact that in the tacticstypes.ini the incon is labeled as something else (and the icon that appears on the screen it's not on any of the game folders, I personally deleted)

EDIT: Gotcha!!! It turns out that the loadout tactic screen was using an icon not from the texturesicons folder but from the texturesGUIFLEETSHIPICONS, where each icon is supposed to carry the same name of the given class.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version