Home › Forums › Torn Stars › Loadout Design
- This topic has 0 replies, 1 voice, and was last updated 18 years ago by GrandpaTrout.
-
AuthorPosts
-
11. November 2006 at 19:17 #15270GrandpaTroutParticipant
Handling ship subsystems is a bit tricky because Flux does not let POG see critical object properties (like x,y,z position) and the class type of the subsystem.
Flamineo wrote a subsystem handling layer when he created his Damage Mod that is both good code and the best documentation to date on subsim handling. He was trying to write a mod compatable with the old game. We have the luxury of being able to rename subsystems to fit our design (since we can read names, we can make name and INI file match for instance). We can also move INI files to known locations.
The largest problem for a loadout GUI is knowing where to place weapons. There are two approaches: The standard PS solution is to put mountpoints in the ship, and then loadout replaces these mountpoints with working subsystems. (and vice versa). The problem is that there is no POG function to do this replacement. The only subsim placing code must know x,y,z position and orientation. But there is no way to read this information (that I have discovered).
So that brings us to solution two, which is putting the mounting data into the ships INI file. I call this mounting data a “hardpoint” to make it clearly different from the Flux mountpoint.
Here is a small example. I have a document describing hardpoints in detail.
; Weapons template and null entries (just like normal).
template[7]=ini:/subsims/systems/nonplayer/nps_pbc
null[7]=fwd_pbc_hardpoint;New Matching Hardpoints
hardpoint_type[7]=med_gun
hardpoint_loc[7]=(3,5,7)
hardpoint_orient[7]=(0,1,0)Once the hardpoint design is selected, we need a way to get hardpoint data into the ship INI files. Rather than do this by hand, I had asked a forum member to write a Perl script to pull the data from the lightwave setup files. I can provide that script.
As far as how to structure a POG GUI for loadout, EricMan64 coded the most complete loadout as part of his Gold Rush mod. It is worth looking over. A more complex version (not recommeded until a simple button version is working) would put the buttons in x, y position over the image of a ship. Thus allowing the player to “place” objects on his just like the old game FreeSpace.
Saving and restoring subsims is easy, once the hardpoint data is attached to the subsim.
[center][url=”http://www.torn-stars.com”%5D
-
AuthorPosts
- You must be logged in to reply to this topic.