Game Development Community

Weapons problem

by Firas · in Torque Game Engine · 04/23/2005 (2:36 pm) · 4 replies

I'm using this resource:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6221

andI have implement it very will , I can now pick the weapons and ammo for teh 3 weapons but I can't change betwen them when I click on number 2 ,3 or 4

and there is another big problem, I can't know where is the code that make this problem :(

here is somthing for the console may explain somthing:

Loading compiled script starter.fps/server/scripts/shotgun.cs.
Loading compiled script starter.fps/server/scripts/machinegun.cs.
ShapeBaseImageData:: Could not resolve state "reload" for image "MachinegunImage"
Loading compiled script starter.fps/server/scripts/blaster.cs.
Object 'BlasterShell' is not a member of the 'DebrisData' data block class




and also this I can't understand it:

Could not locate texture: starter.fps/data/shapes/shotgun/Unnamed
Could not locate texture: starter.fps/data/shapes/shotgun/Unnamed
Could not locate texture: starter.fps/data/shapes/shotgun/Unnamed
Could not locate texture: starter.fps/data/shapes/shotgun/Unnamed
Could not locate texture: starter.fps/data/shapes/machinegun/Unnamed
Could not locate texture: starter.fps/data/shapes/machinegun/Unnamed
Could not locate texture: starter.fps/data/shapes/machinegun/Unnamed

any help?

#1
04/23/2005 (3:00 pm)
Look in
/starter.fps/client/scripts/defaultBind.cs
/starter.fps/client/scripts/client/config.cs
/starter.fps/client/config.cs


where it says
moveMap.bindCmd(keyboard, "1", "commandToServer(\'use\',\"Sword\");", "");

place after it:

moveMap.bindCmd(keyboard, "2", "commandToServer(\'use\',\"Crossbow\");", "");
moveMap.bindCmd(keyboard, "3", "commandToServer(\'use\',\"Rifle\");", "");
#2
04/23/2005 (3:02 pm)
Or implement weapon cycling
#3
04/23/2005 (11:52 pm)
Thanks Ed Johnson
my problem is that I forget to change the /starter.fps/client/config.cs

also thanks for the weapon cycling.
#4
04/24/2005 (12:46 am)
Regarding the console error ShapeBaseImageData:: Could not resolve state "reload" for image "MachinegunImage"

This is because of the way the state sequences are scripted for the machine gun. The author of the resource has skipped the reload function and used a refire function instead. This is for the purpose of getting the machine gun to fire at a high rate of fire. Not the best way of doing things but it works.

I used this resource as a starting point and tweaked it to my liking. For instance i have an onTriggerDown and onTriggerUp function for the purpose of using a looping sound for the machine gun fire. This way you get a nice even firing machine gun instead of the way it is in the above mentioned resource (very erratic fire).