Adding new scenarioLoadouts?

Post » Tue May 07, 2013 9:00 am

I'm trying to add some new loadouts for the existing scenarios but the loadouts don't seem to get built into the mod.

I've added a new loadout to the dlc_1_scenarioloadout.tdef (just a copy of an existing one with the name changed and an ammo count increased to test) I've also added it as a new item on the relevant scenarioloadoutlist so it appears in the menu correctly with its own strings.

In the rage tool kit using the "list scenarioLoadout" command I can see my new loadout is loaded and using the "launchScenarioOption" command along with the well scenario and my new loadout, I can load up that scenario and the correct loadout is applied.

But when I build the mod, then load Rage with it, although the loadout still shows up correctly in the loadout selection menu, the player spawns without items, the qconsole.log shows it is correctly assigning the loadout to the 'scenarioLoadout2:' slot.

Using the "list scenarioLoadout" command shows that the loadout is missing entirely from the resources list.

Is there a step I'm missing somewhere to have that new scenarioLoadout declaration built into the mod? Are we able to add new scenarioLoadout declarations with the modkit? Just incase it's an issue with the DLC (I have the scorchers DLC installed)

When I modify an existing declaration the changes seem to carry over just fine, the problem only appears with new declarations and I get the same problem if I add the declaration into a new .tdef file.
User avatar
Poetic Vice
 
Posts: 3440
Joined: Wed Oct 31, 2007 8:19 pm

Post » Tue May 07, 2013 4:42 am

I still haven't been able to track down what's causing the problem with the new scenario loadouts so I added:
sys.executeCommandText ( "touchDecl scenarioLoadout scenarioloadout/dlc1_ghosthideout_settler2" );sys.executeCommandText ( "touchDecl scenarioLoadout scenarioloadout/testingInline/dlc1_ghosthideout_settler2" );sys.executeCommandText ( "touchDecl scenarioLoadout justatestloadout" );sys.print( "Finished Touching Loadouts\n" );
Into my main.script to try force it to build them into the mod.

The buildlog for the mod shows the corresponding touched * messages, so the script was executed successfully

After loading the mod in Rage again it's back to the player still being spawned without any items and the three new scenarioLoadout resources are still missing from the output of 'list scenarioLoadout'

The only difference is, if I check the console output from Rage when it enters the main.script I get:
idDeclManagerLocal::TouchDecl_f scenarioLoadout 'scenarioloadout/dlc1_ghosthideout_settler2' not found
and the same message for the other two. I'm not sure if it's the Tool Kit not building them into the mod or Rage just not acknowledging they're in the mod and loading them but something isn't right and I've just about ran out of ideas
User avatar
dell
 
Posts: 3452
Joined: Sat Mar 24, 2007 2:58 am

Post » Mon May 06, 2013 7:35 pm

OK after going through the "rage tool kit\SAVES\mods\[modname]\base\generated\" folders it looks like the tool kit is definitely including them in the mod when it's built, for some reason Rage just doesn't load them in when the mod is loaded. I must be missing a resource preload or load list somewhere that they need including in

Also if anyone else is burning through mod builds to test their mods in Rage, it might be worth checking out the rage tool kit\SAVES\mods folder to get rid of some of those old builds clogging up disk space. Mine was over 10GB
User avatar
emily grieve
 
Posts: 3408
Joined: Thu Jun 22, 2006 11:55 pm

Post » Tue May 07, 2013 7:03 am

I've finally managed to 'fix' this!

Basically instead of using 'touchDecl' in my script_main.script I used 'Load' like this:
sys.print( "Loading new loadouts\n");sys.executeCommandText ( "Load scenarioLoadout scenarioloadout/dlc1_ghosthideout_settler2");sys.executeCommandText ( "Load scenarioLoadout scenarioloadout/testingInline/dlc1_ghosthideout_settler2");sys.executeCommandText ( "Load scenarioLoadout justatestloadout");sys.print( "Finished loading new loadouts\n");

It looks like the problem comes from Rage loading the scenarioLoadouts by name when it starts, and not just all scenarioLoadout resource decls (which is how the rage tool kit does it). So when a mod with new scenarioLoadout decls is built the decls are packaged into the mod just fine, but Rage doesn't load them as resources. You can see this in Rage itself after loading the mod, but still in the main menu, if I drop to the command line and enter 'List scenarioLoadout' the new loadouts aren't loaded in the resource list (script_main.script hasn't been called yet) but after loading into a map 'List scenarioLoadout' shows them just fine. With the way loadouts are assigned to a slot in the menu but not actually given to the player until they spawn, this works out perfectly and I can select my new loadouts in the scenario menu and they're correctly assigned when the player spawns so the player is given the list of items they contain. Awesome.

Although this works, I'm pretty sure there's a better way than throwing stuff madly into script_main.script as I'm pretty sure script_main.script is one of those files that gets built into every mod, and so won't be compatible if you have other mods installed (if they happen to be newer) and I don't even know for certain if Rages own script_main.script is as empty as the one in the tool kit, for all I know editing it and building the mod with it could break the campaign in some key area.

But in the mean time that might be something to try if you find your resource mods aren't being loaded in Rage but they're working just fine in the tool kit, as I'm sure there'll be other types of resources that are loaded in the same way.
User avatar
Lyd
 
Posts: 3335
Joined: Sat Aug 26, 2006 2:56 pm


Return to Othor Games