Lets get what this gadget does NOT* do out of the way first:
-does not allow player unit customisation (player cannot click a button to put a Bulldog turret on a stumpy)
-does not allow a unit's geometry to change over time (growing extra arms, different guns etc in response to XP gain)
Code: Select all
Contents
1) Introduction
1.1) What this gadget does do
1.2) What this gadget does NOT do
2) Setting up the reciving units
2.1) Gadget config file
3) Setting up the source units
3.1) The source unit is a unit
3.2) The source unit can have more than one piece
4) Help & Troubleshooting
4.1) Debug mode
--------------------------------------------------------------------------------
1) Introduction
--------------------------------------------------------------------------------
1.1) What this gadget does do
By default Spring parses the s3o models and sends them to the gpu as OpenGL
displaylists to be drawn on-screen. This gadget simply generates an alternate
displaylist from another s3o model and replaces the default displaylist with
the alternate. This alternate displaylist does not have to share textures with
the unit it is being put on.
1.2) What this gadget does NOT do
*Allow you to change unit appearance mid-game
*Change anything other than unit appearance
--------------------------------------------------------------------------------
2) Setting up the reciving units
--------------------------------------------------------------------------------
2.1) Gadget config file
The gadget loads a list of units, what pieces need to be changed and what
to change them with from the config file. The format for the config is:
targetUnitDefName = {
{sourceUnitDefName1,sourcePieceName1,targetPieceName1},
{sourceUnitDefName2,sourcePieceName2,targetPieceName2},
...
{sourceUnitDefNameX,sourcePieceNameX,targetPieceNameX},
},
The sourcePieceName can be the same for multiple targetPieceNames.
The sourcePieceName MUST be unique, only one displaylist can have
any given name, so be creative.
--------------------------------------------------------------------------------
3) Setting up the source units
--------------------------------------------------------------------------------
3.1) The source unit is a unit
This means it needs a valid unitDef and script. The unitdef values do not
have to make sense, they only need to be valid. The script can be any script
that will load.
3.2) The source unit can have more than one piece
The source unit can have multiple pieces, in any type of hierarchy. The pieces
must have their origin points set correctly to work properly on the target unit.
--------------------------------------------------------------------------------
4) Help & Troubleshooting
--------------------------------------------------------------------------------
4.1) Debug mode
The gadget has an internally triggered 'debug' mode. When enabled, the gadget
prints messages to the console and infolog. The enable/disable this mode find
the debug mode switch in the main gadget file.
TO DO:
-Finish optimising, (jK your model loading logic had an error)
Screenshots and further info in next post...