Races: Distinguishing
by Tyler Slabinski · in Technical Issues · 12/12/2007 (6:08 pm) · 3 replies
Ok, so I have a game with 6 races. Each one is slightly different except for one, which is VERY different. How can I split the code for each one to have different functions such as a different GUI or something.
#2
One way to do it would be to build race specific datablocks (based on the default player datablock).
Tie all of the functions you can to the datablock. Methods for selecting GUIs (not opening them but selecting which one to open) and for dealing with various game situations.
If something needs to do something race specific it should inspect or call your datablock.
If you want to know which gui to open you ask the datablock: %client.player.datablock.playGui (this field should contain the name of the gui object, make sure you set it on the datablock).
Okay, I was gonna be a smart-ass and tell you "by scripting datablocks" but I thought the above would be more useful.
12/12/2007 (8:48 pm)
Are you ready for an equally broad answer?One way to do it would be to build race specific datablocks (based on the default player datablock).
Tie all of the functions you can to the datablock. Methods for selecting GUIs (not opening them but selecting which one to open) and for dealing with various game situations.
If something needs to do something race specific it should inspect or call your datablock.
If you want to know which gui to open you ask the datablock: %client.player.datablock.playGui (this field should contain the name of the gui object, make sure you set it on the datablock).
Okay, I was gonna be a smart-ass and tell you "by scripting datablocks" but I thought the above would be more useful.
#3
12/13/2007 (4:17 pm)
... Man, I wish I thought of that, it was too easy (Sorry I couldn't think of any way to make it more specific without needing to say my whole game plan) Thanks Brian!
Torque Owner Steve D