Datablock Questions
by Richard Van Stone · in Torque Game Engine · 02/21/2006 (4:22 pm) · 4 replies
Cross posted from the RTS Forum forgot it was locked out...
I'm working on my project for the rts game and I don't think I have a full understanding of how to setup my units. I have several different troops that can do different things and what I'm wondering is if I have to create a seperate datablock for each so that their stats and powers are different.
Ie Troop1(Unit)
Member 1 - Brute
Member 2 - Hand 2 Hand
Member 3 - Hand 2 Hand
Member 4 - Psychic
Member 5 - Range
Member 6 - Range
So in clear english, I'm wondering do I need to have a datablock set for each type ie brute, h2h, psychic and range or do I need to create datablocks for each "character" in lamens terms ... Pikachu...Bulbaur etc.
This is what I'm thinking the datablock/parenting structure would look like..
Player
---Brute
---H2H
---Psychic
---Range
------Quill
------Spit
Is my thought process correct so far? Quill and Spit represent two types of units a player can put into effect which is a subclass of Range which is a subclass of Player. I hope that's right, please let me know when you have a few moments.
Thanks. Rich
I'm working on my project for the rts game and I don't think I have a full understanding of how to setup my units. I have several different troops that can do different things and what I'm wondering is if I have to create a seperate datablock for each so that their stats and powers are different.
Ie Troop1(Unit)
Member 1 - Brute
Member 2 - Hand 2 Hand
Member 3 - Hand 2 Hand
Member 4 - Psychic
Member 5 - Range
Member 6 - Range
So in clear english, I'm wondering do I need to have a datablock set for each type ie brute, h2h, psychic and range or do I need to create datablocks for each "character" in lamens terms ... Pikachu...Bulbaur etc.
This is what I'm thinking the datablock/parenting structure would look like..
Player
---Brute
---H2H
---Psychic
---Range
------Quill
------Spit
Is my thought process correct so far? Quill and Spit represent two types of units a player can put into effect which is a subclass of Range which is a subclass of Player. I hope that's right, please let me know when you have a few moments.
Thanks. Rich
About the author
#2
02/22/2006 (5:53 am)
I was thinking about this after I posted it and came to the realization that this might not work for what I'm doing. I'm going to be adding character types constantly as we update the game so pre-setting everything in a datablock may not work. I'm thinking I may have to define types and then dynamically create instances of that type and just change 'powers' and stats for each based off of information downloaded from the server. Any thoughts?
#3
02/22/2006 (6:53 am)
I don't believe datablocks can be loaded and instanced "on the 'fly'". I believe they're all downloaded from the Server before the mission gets downloaded. I could be wrong, just an artist... Not sure, but I believe inheritence only runs one 'layer' deep[pre v1.4/not sure if it really works in there, yet], so not certain if the lower 'unit's' would inherit methods of the parent Class.
#4
02/22/2006 (7:35 am)
Well I actually meant I'd create an instance of the object like new brute(tubby) or whatever.
Associate Anthony Rosenbaum
datablock playerData(basePlayer){} datablock playerData(brute : basePlayer){}