Game Development Community

Need Generic Help

by Jonathan Wood · in Torque Game Engine · 09/23/2006 (6:42 pm) · 12 replies

I just purchased the medieval weapon pack, now, all I want is a generic class that helps me to load in a single one of those weapons. I took the starter.fps and copied the project, then I went into the data folder, then shapes folder and copied the crossbow folder and renamed the copy to hammer folder.

I then copied the hammer01.dts from the dts folder that was in my package I purchased and placed it along with the ham_01.jpg into the hammer folder.

Next I got the hammer01.max from the max7 folder and placed it into the same hammer folder I had created.
Next I edited the stronghold.mis file and copied the crossbows simgroup and made the copy the hammers simgroup, removing all but 1 instance and giving it a slight difference in corrodinates, along with telling it Hammer instead of Crossbow.

Under my server/scripts I copied the crossbow.cs and named it hammer.cs, trimmed it down to remove the ammo and renamed everything Crossbow* to Hammer*

I made sure that the hammer.cs was included in the exec list and the game compiles (aka run with torquedemo.exe, with main.cs adjusted), but the hammer doesn't show up. What am I doing wrong?

Thanks

#1
09/23/2006 (6:55 pm)
From what you said you miss couple steps.

Open player.cs in server/scripts and search for "Allowable Inventory Items".

add this
maxInv[HammerAmmo] = 0;
   maxInv[Hammer] = 1;

Open game.cs in server/scripts and search for "Starting equipment"

add this
%player.setInventory(Hammer,1);
   %player.setInventory(HammerAmmo,0);
   %player.mountImage(HammerImage,0);

Make sure you exec your hammer.cs in game.cs and make sure the hammer.cs is compile to a hammer.cs.dso when running the game if not the script will not be use.

This should fix your problem.
#2
09/23/2006 (6:59 pm)
How do i make sure that hammer.cs gets compiled?
doesn't running the torquedemo.exe with the main.cs pointing to my project compile the scripts?

Thanks for this help

edit: nevermind, i do have a cs.dso file :)
It now shows, now to figure out how to do attacks with it!
Thanks!

Its in the hand of my orc, right hand that is :)
This is a start :)
#3
09/23/2006 (7:09 pm)
If its in the hand of the orc, just left click your mouse to use it.
#4
09/23/2006 (7:12 pm)
Cs file gets compile automatic to dso file when you run Torque if they dont it means you have misstake in that cs file.
#5
09/23/2006 (7:26 pm)
I left clicked the mouse but nothing happens, its ok though, I thought that the weapon pack came with animations for each weapon, I might be mistaken about that, but I need to read up more about what I purchased :), I have code lying around I wrote for damage calculation based on hand to hand combat, going to retro fit it for torque. This atleast made the weapon visible.

Now I need to work through the docs on how to place objects into the world using the world editor, so I can add weapons to different places around the map.
#6
09/23/2006 (7:38 pm)
Hm. well I hit the "1" key and it switches to my cross bow, but I can't switch back to the hammer.
Odd. Probably something easy I overlooked.
#7
09/23/2006 (7:49 pm)
You need to bind a key such as 2 to switch back to the hammer. I can't remember what file but I think it is default.bind.cs that you need to do this in. You should see how the 1 key is bound to use the crossbow.

I hope this helps
Adam
#8
09/23/2006 (7:58 pm)
Go to default.bind.cs in starter.fps/client/scripts. Search for
"moveMap.bindCmd(keyboard, "1", "commandToServer('use',\"Crossbow\");", "");"

After that line add the following

moveMap.bindCmd(keyboard, "2", "commandToServer('use',\"Hammer\");", "");

Delete the default.bind.cs.dso and config.cs and config.cs.dso in the client folder. Dont worry they will recompile after launch the Torque. Now you can switch between the crossbow and hammer.

For the weapons like the sword and things the base Torque Orc is not animate for them. Do a search on the form and you should find them if not email me I will send them to you.
#9
09/23/2006 (7:59 pm)
Thanks Adam, searching through the different files to figure this out. I truely appreciate everyones help.
Edit: Wow, thanks for the fast response!
I'll search the forums for that data.
Thanks again!

That worked like a champ to switch between the crossbow and the hammer!
Still looking for the other stuff on the forums
#10
09/23/2006 (8:41 pm)
Michael, I Sent you an email. Thanks again for all this help. Things are moving along nicely.
#11
09/23/2006 (8:46 pm)
I just email you zip files. You very welcome.
#12
09/24/2006 (3:24 am)
Hi Jonathan, I just received your mail about the medieval weapon pack.
Looks like you found the help here. :)

About animations. I hope it's not a problem, I thought it was clear on the product page. We didn't added animation because, from a quick poll, it looked like everyone wanted something different. It would have taken us far more time (and so would have affected the price of the pack) without satisfying everyone.

Now to animate a weapon you don't need a skeleton, just simple transforms (rotation/move) that maybe a friend can do if you can't. :)