What is causing this??
by John Mills · in Torque Game Engine · 10/03/2004 (7:18 pm) · 1 replies
Hi all,
these are the messages i am getting when trying to test the progress of the execrises:
object 'crossbow' is not a member of 'gamebasedata' data block class.
give me the same with crossbowammo.
as well as:
control/server/misc/shapebase.cs (136) unable to find object (0) attempting to call function 'get datablock
control/server/misc/shapebase.cs (146) unable to find object " " attempting to call function 'onpickup'
control/server/players/ai.cs (319): register object failed for object (null) of class item.
set::add:object "0" doesnt exist
control/server/players/ai.cs (316): register object failed for object (null) of class item.
this happened in ch 5 and 6. as i read the forum, and entered the info in for ch.6 and still got the same error. any help would be appreciated.
these are the messages i am getting when trying to test the progress of the execrises:
object 'crossbow' is not a member of 'gamebasedata' data block class.
give me the same with crossbowammo.
as well as:
control/server/misc/shapebase.cs (136) unable to find object (0) attempting to call function 'get datablock
control/server/misc/shapebase.cs (146) unable to find object " " attempting to call function 'onpickup'
control/server/players/ai.cs (319): register object failed for object (null) of class item.
set::add:object "0" doesnt exist
control/server/players/ai.cs (316): register object failed for object (null) of class item.
this happened in ch 5 and 6. as i read the forum, and entered the info in for ch.6 and still got the same error. any help would be appreciated.
Torque Owner Dan -
What you are missing is something like:
datablock ItemData(Crossbow) { // Mission editor category category = "Weapon"; // Hook into Item Weapon class hierarchy. The weapon namespace // provides common weapon handling functions in addition to hooks // into the inventory system. className = "Weapon"; // Basic Item properties shapeFile = "~/data/shapes/crossbow/weapon.dts"; mass = 1; elasticity = 0.2; friction = 0.6; emap = true; // Dynamic properties defined by the scripts pickUpName = "a crossbow"; image = CrossbowImage; };or
datablock ItemData(CrossbowAmmo) { // Mission editor category category = "Ammo"; // Add the Ammo namespace as a parent. The ammo namespace provides // common ammo related functions and hooks into the inventory system. className = "Ammo"; // Basic Item properties shapeFile = "~/data/shapes/crossbow/ammo.dts"; mass = 1; elasticity = 0.2; friction = 0.6; // Dynamic properties defined by the scripts pickUpName = "crossbow bolts"; maxInventory = 20; };Note: the code above wasn't from the book. You version may need to be altered to point to the correct shapefile or other data.
If you have those then look for the code failing to compile or never getting called (exec function)
Hope that helps.