Loadout Design

More
17 years 3 months ago #16292 by cambragol
Replied by cambragol on topic Loadout Design
Hahhahah...that is pretty funny. Took me a second to get your misinterpretation

Please Log in or Create an account to join the conversation.

More
17 years 3 months ago #16295 by GrandpaTrout
Replied by GrandpaTrout on topic Loadout Design
Damn, you have discovered our evil plot to wipe out the player base! And you thought the fatalities were accidental. No! Muahahahah.

There is not much PS code left. Now that the base is gone, the cargo scripts will be next. That just leaves the faction creation code. And the ship models. Otherwise, everything is new. Systems, music, traffic.

Please Log in or Create an account to join the conversation.

More
17 years 3 months ago #16310 by GrandpaTrout
Replied by GrandpaTrout on topic Loadout Design
Ok, another change in direction on loadout. I just realized yesterday that the player would lose all upgrades when purchasing a new ship. That is really going to annoy them. Especially if they had to travel a long ways to find that upgrade.

So it is back to the phantom inventory. When the player purchases a new ship, the equipment can be stripped off to the inventory.

This ends up working ok for now, because the player can purchase new systems through the current Trade GUI. and the loadout can take equipment out of the inventory.

Please Log in or Create an account to join the conversation.

More
17 years 3 months ago #16326 by GrandpaTrout
Replied by GrandpaTrout on topic Loadout Design
After messing around a bit more I figured out a more elegant design for the loadout system. The prior design required lots of ship.ini file additions to track the locations of each of the subsystems and the type of the mountpoints etc.

The new design removes almost all the changes from the ship.ini files. Right now the ship.ini files have null entries that look like

null[5]=drive_location

The new design only requires two new fields for each null, like this:

null_position[5]=(50,20,0)
null_orientation[5]=(0,180,0)

The pog code can figure out the location of any valid subsim template from the those additional fields.

The mountpoint information is now moved into a seperate cargo_hardpoint.ini file because it is reused for every ship. There are a few links needed. Each subsystem needs to be linked to the cargo type that is used to purchase it. And each subsystem needs to be linked to a mountpoint type that can be used to mount it. The cargo_hardpoint.ini file has both links for each subsim.

To setup a ship, you only need to add the position entries to the nulls. To add a new subsim to the loadout, you just need to add a new entry to the cargo_hardpoint.ini file. Any subsim added to the loadout can be changed by the GUI. If a subsim is not in the cargo_hardpoint.ini file, it will be ignored.

This solution is a bit more complex to code, but is much easier to edit and create ships and systems. Since most ships share setup files that define the nulls, it is easy to cut and paste those location numbers.

And if you want to allow every system on a player ship to change, you just need to add entries to the cargo_hardpoints.ini file for each subsim you want to change. No editing of ships or even recompiling of the code is needed. Pretty slick, Slick!

Please Log in or Create an account to join the conversation.

More
17 years 3 months ago #16348 by cambragol
Replied by cambragol on topic Loadout Design
Hey GrandpaTrout, is this setup working in the current source build? I have been trying to make a new heavy corvette setup, and everything is working, except that the position and orientation is still controlled through the actual lws files. So, just to be sure, I will need to alter those orientations, in the lws file, to be correct, then match them out to the new null_position and null_orientation entries in an ini file?

Please Log in or Create an account to join the conversation.

More
17 years 3 months ago #16350 by GrandpaTrout
Replied by GrandpaTrout on topic Loadout Design
Oh, I didn't explain that well. The game places the systems when the ship originally enters the game. Those values do come from the *.lws file.

To test if you have the right null_position and null_orientation values, you need to use the Loadout Gui to remove the system and then put it back. If the values match, they should be in the exact same location.

Please Log in or Create an account to join the conversation.