Game Server Online
by Vince Gee · in Torque Game Engine · 05/07/2005 (11:54 pm) · 5 replies
Hey all,
After much work I finally got the Vision Game Server back online with a great deal of my RPGCore functionality wired in. The system implements a persistent player/skills/inventory/attribute system. The game itself isn't much different than the koob game, but when you give it more than a first glance and hit "I" to view your inventory you will see that the BUILT in functions of the resource I'm building provides a great deal of the base functionality needed in any RPG or FPS where you want to have some organized control over players/objects/etc.
BTW, Other thank about 8 lines of code being changed in the 1.3 head, their are little to no modifications needed to implement this in the 1.3 head. I have also documented all the changes neccessary in the scripts to implement the resource. I've still gotta finish the documentation, as soon as it's done I will publish the resource.
I personally invite anyone who has the time, to download my client at www.geeconsulting.net/ and create a character on the website then log in.
Remember you can't log in unless you create a character.
Also, any bug reports would be appreciated. I plan to release all the code for free to the GG community, so help me make a good resource :)
Vince
After much work I finally got the Vision Game Server back online with a great deal of my RPGCore functionality wired in. The system implements a persistent player/skills/inventory/attribute system. The game itself isn't much different than the koob game, but when you give it more than a first glance and hit "I" to view your inventory you will see that the BUILT in functions of the resource I'm building provides a great deal of the base functionality needed in any RPG or FPS where you want to have some organized control over players/objects/etc.
BTW, Other thank about 8 lines of code being changed in the 1.3 head, their are little to no modifications needed to implement this in the 1.3 head. I have also documented all the changes neccessary in the scripts to implement the resource. I've still gotta finish the documentation, as soon as it's done I will publish the resource.
I personally invite anyone who has the time, to download my client at www.geeconsulting.net/ and create a character on the website then log in.
Remember you can't log in unless you create a character.
Also, any bug reports would be appreciated. I plan to release all the code for free to the GG community, so help me make a good resource :)
Vince
About the author
www.winterleafentertainment.com
#2
http://www.geeconsulting.net/
05/08/2005 (1:00 pm)
Fixed it, my mistake, had wrong address in. it's
#3
Vince
Current listing of console methods implement are below if anyone is curious
Vince
/**
This is the base class for all of the Role Playing Game engine, or RPGCore for short. The purpose of this class is
to provide all of the functions neccessary to run an rpg through torque with minimal changes to the head.
It was implemented as a SceneObject so that it could reside on the map and not be bound to a player.
Also it makes it less likely to be affected during head updates. Current head this is being built on
is Torque 3D 1.3.
Console Functions:
ConsoleMethod( RPGCore, LoadRPG,void, 2, 2, "") -This console method loads all the master lists into memory
ConsoleMethod( RPGCore, SetODBC,void, 4, 4, "(dbDriver,dbProviderString)")
This console method sets the database driver and provider string with which all connections use
ConsoleMethod( RPGCore, Player_Login,const char *, 4, 4, "(username,password)")
This function processes a username and password check. Return 1 is valid and 0 if invalid.
ConsoleMethod( RPGCore, Player_Logout,void, 4, 4, "(player_torque_id,Player Last Location)")
This function logs a player out saving their Last know location and their skills, inventory and attributes
ConsoleMethod( RPGCore, Player_LogoutByName,void, 4, 4, "(player_name,Player Last Location)")
Same function as above except by name instead of torque id. If the player goes linkdead, then it's difficult to get the connection object.
But you can still get at their name, thus the reason for this function.
ConsoleMethod( RPGCore, Player_Load,const char *, 4, 4, "(torque_obj_id,username)")
This function takes the torque_player_ID and their username and loads the information from the database
pertaining to the player
ConsoleMethod( RPGCore, Player_Inventory_Increment,const char*, 5, 5, "(player_torque_id,object_name,amount)")
This function which is usually wired into the weapon template takes a player, object name and amount to
decrement the item by. It will increment the item count, if it can't increment the item amount it will return how much
it wasn't able to increment.
ConsoleMethod( RPGCore, Player_Inventory_Add,const char *, 5, 5, "(player_torque_id,object_name,amount)")
This function adds the item and amount to the characters inventory. The item is the torque item ie crossbow etc. Not the
friendly name.
ConsoleMethod( RPGCore, Player_Inventory_Decrement,const char*, 5, 5, "(player_torque_id,object_name,amount)")
This function decrements the item passed in the players inventory.
The function returns 1 if the decrement didn't deplete the stack
The function returns 0 if the decrement depleted the stack but their is another stack
The function returns -1 if the decrement depleted the stack and their are no more of that item in inventory.
ConsoleMethod( RPGCore, Player_Inventory_Amount,const char*, 4, 4, "(player_torque_id,object_name)")
This function is getting close to being decremented, it returns the amount in the first stack it finds in the players
inventory
05/08/2005 (4:39 pm)
Current listing of console methods implement are below if anyone is curiousVince
Current listing of console methods implement are below if anyone is curious
Vince
/**
This is the base class for all of the Role Playing Game engine, or RPGCore for short. The purpose of this class is
to provide all of the functions neccessary to run an rpg through torque with minimal changes to the head.
It was implemented as a SceneObject so that it could reside on the map and not be bound to a player.
Also it makes it less likely to be affected during head updates. Current head this is being built on
is Torque 3D 1.3.
Console Functions:
ConsoleMethod( RPGCore, LoadRPG,void, 2, 2, "") -This console method loads all the master lists into memory
ConsoleMethod( RPGCore, SetODBC,void, 4, 4, "(dbDriver,dbProviderString)")
This console method sets the database driver and provider string with which all connections use
ConsoleMethod( RPGCore, Player_Login,const char *, 4, 4, "(username,password)")
This function processes a username and password check. Return 1 is valid and 0 if invalid.
ConsoleMethod( RPGCore, Player_Logout,void, 4, 4, "(player_torque_id,Player Last Location)")
This function logs a player out saving their Last know location and their skills, inventory and attributes
ConsoleMethod( RPGCore, Player_LogoutByName,void, 4, 4, "(player_name,Player Last Location)")
Same function as above except by name instead of torque id. If the player goes linkdead, then it's difficult to get the connection object.
But you can still get at their name, thus the reason for this function.
ConsoleMethod( RPGCore, Player_Load,const char *, 4, 4, "(torque_obj_id,username)")
This function takes the torque_player_ID and their username and loads the information from the database
pertaining to the player
ConsoleMethod( RPGCore, Player_Inventory_Increment,const char*, 5, 5, "(player_torque_id,object_name,amount)")
This function which is usually wired into the weapon template takes a player, object name and amount to
decrement the item by. It will increment the item count, if it can't increment the item amount it will return how much
it wasn't able to increment.
ConsoleMethod( RPGCore, Player_Inventory_Add,const char *, 5, 5, "(player_torque_id,object_name,amount)")
This function adds the item and amount to the characters inventory. The item is the torque item ie crossbow etc. Not the
friendly name.
ConsoleMethod( RPGCore, Player_Inventory_Decrement,const char*, 5, 5, "(player_torque_id,object_name,amount)")
This function decrements the item passed in the players inventory.
The function returns 1 if the decrement didn't deplete the stack
The function returns 0 if the decrement depleted the stack but their is another stack
The function returns -1 if the decrement depleted the stack and their are no more of that item in inventory.
ConsoleMethod( RPGCore, Player_Inventory_Amount,const char*, 4, 4, "(player_torque_id,object_name)")
This function is getting close to being decremented, it returns the amount in the first stack it finds in the players
inventory
#4
This function retrives the value from the attribute list for the player. For example, the default attributes are:
Attribute_ID Attribute_Name
------------ --------------------------------------------------
0 Health
So calling this function w/ a player ID(Player object id in torque) and "Health" will return that players max health.
If a player has an object that modifies the max health attribute, it will return the base health (SPACE) total health w/ modifiers.
This is so that you can use the getword function to split the values.
ConsoleMethod( RPGCore, Player_Item_GetProperty,const char*, 5, 5, "Player Torque ID,Player Item Key,PropertyString")
This function will retrieve a property of a player's inventory item. It will first check the players copy of properties for the
requested property value, if the property isn't found their it will then look in the master list.
So, if a player renames his crossbow to "Vince's Crossbow" and you ask for the friendly name it will return "Vince's Crossbow" but another
player with a stock crossbow will see the default friendly name of "Crossbow". The property override is done by flagging the property definition
as _isPhysical in the database.
Default properties I defined, which can be change, removed or added to are:
Static Properties
Item_ID - The database id of the item
Item_Name - The torque name of the item
Item_IsContainer - Is the item a container
Item_Skill_Name -What skill is needed to use this item
Item_Skill_MinToUse - what is the min skill level to use the item
Item_MaxStack - How many of the item can be stacked
Item_Amount - The current amount in inventory
Item_Position - The position of the item in the players inventory
Item_Key - The Unique player's key to the item
Parent_Item_Key - The unique players key to the container holding the item
Dynamic Properties
Property_ID Property_Name Property_ReplicateToClientList
----------- -------------------------------------------------- ------------------------------
1 MaxStack 0
2 DefaultPickupAmount 0
3 MaxDurability 0
4 DefaultVendorValue 0
5 IsPersistent 0
6 isLore 0
7 isNoDrop 0
8 isAttunable 0
9 FriendlyName 1
10 DTSPath 0
11 Png 0
12 Description 0
13 Uses 1
05/08/2005 (4:40 pm)
ConsoleMethod( RPGCore, Player_GetAttribute,const char*, 4, 4, "(player_torque_id,attribute_name)")This function retrives the value from the attribute list for the player. For example, the default attributes are:
Attribute_ID Attribute_Name
------------ --------------------------------------------------
0 Health
So calling this function w/ a player ID(Player object id in torque) and "Health" will return that players max health.
If a player has an object that modifies the max health attribute, it will return the base health (SPACE) total health w/ modifiers.
This is so that you can use the getword function to split the values.
ConsoleMethod( RPGCore, Player_Item_GetProperty,const char*, 5, 5, "Player Torque ID,Player Item Key,PropertyString")
This function will retrieve a property of a player's inventory item. It will first check the players copy of properties for the
requested property value, if the property isn't found their it will then look in the master list.
So, if a player renames his crossbow to "Vince's Crossbow" and you ask for the friendly name it will return "Vince's Crossbow" but another
player with a stock crossbow will see the default friendly name of "Crossbow". The property override is done by flagging the property definition
as _isPhysical in the database.
Default properties I defined, which can be change, removed or added to are:
Static Properties
Item_ID - The database id of the item
Item_Name - The torque name of the item
Item_IsContainer - Is the item a container
Item_Skill_Name -What skill is needed to use this item
Item_Skill_MinToUse - what is the min skill level to use the item
Item_MaxStack - How many of the item can be stacked
Item_Amount - The current amount in inventory
Item_Position - The position of the item in the players inventory
Item_Key - The Unique player's key to the item
Parent_Item_Key - The unique players key to the container holding the item
Dynamic Properties
Property_ID Property_Name Property_ReplicateToClientList
----------- -------------------------------------------------- ------------------------------
1 MaxStack 0
2 DefaultPickupAmount 0
3 MaxDurability 0
4 DefaultVendorValue 0
5 IsPersistent 0
6 isLore 0
7 isNoDrop 0
8 isAttunable 0
9 FriendlyName 1
10 DTSPath 0
11 Png 0
12 Description 0
13 Uses 1
#5
Returns the max amount of the item that can be stacked.
ConsoleMethod( RPGCore, Item_GetProperty,const char*, 4, 4, "Torque_Item_Name,property")
This function will only query the master item list and return values which are global properties.
ConsoleMethod( RPGCore, Player_Inventory_ChangedItemKeys,const char*, 3, 3, "(player_torque_id)")
This function returns all of the players item keys in their inventory that have been flagged by the system
as changed. This prevents redundant data from being sent to the client. (PREFERRED METHOD FOR RELAYING TO CLIENTS)
ConsoleMethod( RPGCore, Player_Inventory_ItemKeys,const char*, 3, 3, "(player_torque_id)")
This function returns all of the players item keys in their inventory.
ConsoleMethod( RPGCore, Player_Inventory_GetFirstItemID,const char*, 4, 4, "(player_torque_id,object_name)")
This function returns the first player item key of the first entry in the players inventory
ConsoleMethod( RPGCore, Player_Skills_ChangedSkillKeys,const char*, 3, 3, "(player_torque_id)")
This function will request (Space delimited) all of the skill id's that have changed for that player.
ConsoleMethod( RPGCore, Player_Skills_GetProperty,const char*, 5, 5, "Player Torque ID,Player Skill ID,PropertyString")
This function retrieves a player skill from the player's object.
ConsoleMethod( RPGCore,Player_GetBaseObject,const char*, 4, 4, "Player Torque ID,PropertyString")
This function allows you to grab player base object properties
They are:
Player_ID - Database player ID
Player_Name -Player Name
Torque_PlayerObjID - The reference to the torque player object
isAdmin - 1 or 0 if they are admin
Player_SpawnPoint - the last point they were add when they exited the sim last.
*/
05/08/2005 (4:40 pm)
ConsoleMethod( RPGCore, Item_GetMaxStack,const char*, 3, 3, "(object_name)")Returns the max amount of the item that can be stacked.
ConsoleMethod( RPGCore, Item_GetProperty,const char*, 4, 4, "Torque_Item_Name,property")
This function will only query the master item list and return values which are global properties.
ConsoleMethod( RPGCore, Player_Inventory_ChangedItemKeys,const char*, 3, 3, "(player_torque_id)")
This function returns all of the players item keys in their inventory that have been flagged by the system
as changed. This prevents redundant data from being sent to the client. (PREFERRED METHOD FOR RELAYING TO CLIENTS)
ConsoleMethod( RPGCore, Player_Inventory_ItemKeys,const char*, 3, 3, "(player_torque_id)")
This function returns all of the players item keys in their inventory.
ConsoleMethod( RPGCore, Player_Inventory_GetFirstItemID,const char*, 4, 4, "(player_torque_id,object_name)")
This function returns the first player item key of the first entry in the players inventory
ConsoleMethod( RPGCore, Player_Skills_ChangedSkillKeys,const char*, 3, 3, "(player_torque_id)")
This function will request (Space delimited) all of the skill id's that have changed for that player.
ConsoleMethod( RPGCore, Player_Skills_GetProperty,const char*, 5, 5, "Player Torque ID,Player Skill ID,PropertyString")
This function retrieves a player skill from the player's object.
ConsoleMethod( RPGCore,Player_GetBaseObject,const char*, 4, 4, "Player Torque ID,PropertyString")
This function allows you to grab player base object properties
They are:
Player_ID - Database player ID
Player_Name -Player Name
Torque_PlayerObjID - The reference to the torque player object
isAdmin - 1 or 0 if they are admin
Player_SpawnPoint - the last point they were add when they exited the sim last.
*/
Torque Owner Glynn James