Rpg Stats
by Wayne Eversole · in Torque Game Engine · 02/01/2005 (1:57 pm) · 27 replies
Anyone happen to have a RPG Stat's they could share?
Like just one stat of str or int that works with torque?
Im just needing an example to get started and to build upon.
Like just one stat of str or int that works with torque?
Im just needing an example to get started and to build upon.
About the author
#22
Dave.
11/12/2005 (5:26 am)
Yer, I thought the stuff in datablocks were effectively static final constants. That is, you can't change them while the game is running. Which would make them sort of useless for stats unless you never wanted to update them. Also they are shared between all members of a class, so you'd need a different datablock for every "character" in the game unless their stats are all the same. Wouldn't scripted vars be more useful? I'm not sure how you'd store them, maybe using the file output classes to write them to disk? Still reading my way through docs myself, so might be way off the ball.Dave.
#23
sounds like you are on the right track Dave, good luck.
11/12/2005 (11:38 am)
Quote:Yer, I thought the stuff in datablocks were effectively static final constants. That is, you can't change them while the game is running. Which would make them sort of useless for stats unless you never wanted to update them.I think that is the idea behind how they should be used, but you don't have to use them that way. I had been using them on the datablocks for a while now with no problem, just updating them in script. You could also just add dynamic script variables to the datablock and reference those.
Quote:Wouldn't scripted vars be more useful? I'm not sure how you'd store them, maybe using the file output classes to write them to disk? Still reading my way through docs myself, so might be way off the ball.Yes, that's how I'm doing it now, the abilities are only in the scripts. When my game is saved they are saved out in various ways. For AI, they are dynamic fields on special ai spawn markers I created. For the main character they are saved out to a different file using the FileObject, although I would advise someone starting out to make them members of a scriptobject that is a member of a savegame simgroup, then you can just use the simgroups save function like the MissionGroup does. Then put all your save game data into that SimGroup.
sounds like you are on the right track Dave, good luck.
#24
11/12/2005 (2:44 pm)
My suggestion would be to hold the stats in a ScriptObject associated with a certain client/player. You could then mirror all stats to a client side ScriptObject for GUI displays and what-not.
#25
Rather than just getting the stats, it also gave me the progress bars (meters) for displaying them.
As for storing and loading, I use MySQL.
I play multi-player online connected to a dedicated server and haven't noticed any network problems yet.
Hope this helps a little, I'm fairly new to C.
Ari
11/12/2005 (4:38 pm)
I copied and renamed the energy bar code throughout the engine, scripts and GUIs.Rather than just getting the stats, it also gave me the progress bars (meters) for displaying them.
As for storing and loading, I use MySQL.
I play multi-player online connected to a dedicated server and haven't noticed any network problems yet.
Hope this helps a little, I'm fairly new to C.
Ari
#26
03/04/2007 (9:28 pm)
Just to check, say if i have 15 orcs in a map with extra stats, say for example strength, is it still possible to have some at 13, 14, 15 etc or would the 1 datablock affect all of the orcs? Say one of the orcs is fighting a player and he grows in strength and I update the datablock, is this going to change all my orcs?
#27
I get these errors in Dedicated server log.
scriptsAndAssets/server/scripts/players/aiplayer.cs (183): Unable to find object: '' attempting to call function 'getDataBlock'
We killed the mob, /joy
07/13/2010 (10:34 am)
I ended up working on a project that did not require stats but now I just started fresh and installed this resource. I have the engine compiled with no errors and installed Dreamers suggestions. When I kill an ai bot and it calls CommandToClient("UpdateStats","charexp",%player.getDataBlock().charexp);I get these errors in Dedicated server log.
scriptsAndAssets/server/scripts/players/aiplayer.cs (183): Unable to find object: '' attempting to call function 'getDataBlock'
We killed the mob, /joy
Torque Owner Clint S. Brewer
So for my game I'm moving the stats over to the object itself, and not just in the datablock. just something to think about, it may not matter at all depending on what type of game you are making.
another thought you can also do this entirely in script, no reason for it to be in the game engine. Just find the place that your player or ai is spawned, and after it is spawned set some dynamic stat variables on the object. Much easier and keeps the player code clean from your game specific stuff. You'll probably be checking most of these things in script anyways.
fun stuff, hope you made some progress over the last few months Wayne