Game Development Community

Scripting Weapons

by Debra Scaminaci · in General Discussion · 03/15/2004 (5:39 pm) · 9 replies

Hey guys,

I'm relatively new to Torque and am still taking in a lot and learning a bunch from this great engine. But I've run into a pretty big problem. I'm trying to script in a new weapon, but can't really find any good tutorials on how to do it. I've looked here, and by searching the forum, but with not a lot of luck. Anyone know of any good weapon scripting tutorials? Help is greatly appreciated!

CJ

About the author

Recent Threads


#1
03/15/2004 (6:33 pm)
Not sure of any tutorials offhand, but the basic process is copying the crossbow.cs into "mygun.cs" and editing it to your pleasure. From the game.cs, add exec("mygun.cs"); where you see the exec("crossbow.cs");
#2
03/15/2004 (6:39 pm)
Codesampler has a weapons tutorial that might help.

Codesampler
#3
03/18/2004 (6:30 am)
Willbkool; That looks like a very good "all-around" tutorial.

Thanks for sharing.
#4
04/01/2004 (2:44 am)
I've tried those tutorials... And they work great...
But i can't get a gun to fire in my code... I've tried EVERYTHING, except the right thing... I can throw the gun, pick it up, it renders, blah, blah,... But it doesn't want to shoot...
it's as if my mousebutton isn't working... but when i switch to my crossbow... booom... it fires... So if anyone here gets it working... please help me out...
Thanx
James
#5
04/01/2004 (2:56 am)
James,
If you want to post your weapon script or send me the .cs file I'll take a look at it for you. I've made a lot of weapon scripts.

-Sabrecyd
#6
04/01/2004 (3:33 am)
Thanx man... I'll bring it 2morrow
#7
04/01/2004 (4:25 am)
Just another question. Do you have ammo?

That could be a problem :)
#8
04/01/2004 (4:37 am)
Hehe... I think so... but that might be the start of my problem... Nah... i'm sure i have... I think i set it to have
ammo as soon as you pick it up... Hmmm... Now you got Me wondering... ;)
#9
04/01/2004 (7:48 pm)
Also watch out for :() definitions. I have run into wierd problems with Armor vs Player functions in the same script. Mainly I get some code from somewhere that is one or the other and it does not seem to work. Then when I change the class it automagically works. Could be due to class inheritance in the object.

Hope that helps,
Frank