Newbie scripting question
by Robert Memmott · in Torque Game Engine · 02/18/2005 (8:24 am) · 4 replies
Hello,
I'm in the process of digging through the scripts and making minor additions and modifications to learn how it all works.
Currently I'm trying to get a quick hack of a machine gun up and I've run into a couple of questions.
It seems to me that the easiest (probably worst) way to do a machinegun is to just crank down the timeouts for the firing delay and to add a random offset to the firing vector to simulate the spray of bullets.
1: is this a bad way of thinking of it?
2: is there a way to do random numbers in the script?
3: can anyone point me to the place in the docs where it discusses modifying a vector in its normal space?
I really appreciate any pointers anyone could give me.
Thanks
Rob.
I'm in the process of digging through the scripts and making minor additions and modifications to learn how it all works.
Currently I'm trying to get a quick hack of a machine gun up and I've run into a couple of questions.
It seems to me that the easiest (probably worst) way to do a machinegun is to just crank down the timeouts for the firing delay and to add a random offset to the firing vector to simulate the spray of bullets.
1: is this a bad way of thinking of it?
2: is there a way to do random numbers in the script?
3: can anyone point me to the place in the docs where it discusses modifying a vector in its normal space?
I really appreciate any pointers anyone could give me.
Thanks
Rob.
#2
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5638
It's invaluable for Torque.
Eric, I didn't know about that helpfile. Thanks!
-Jeff
02/18/2005 (2:28 pm)
I highly suggest getting this book:www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5638
It's invaluable for Torque.
Eric, I didn't know about that helpfile. Thanks!
-Jeff
#3
That help file was just what I was looking for.
Rob.
02/18/2005 (3:52 pm)
Thanks for the replies guys!That help file was just what I was looking for.
Rob.
#4
That help file was just what I was looking for.
Rob.
02/18/2005 (3:55 pm)
Thanks for the replies guys!That help file was just what I was looking for.
Rob.
Torque Owner Eric Lavigne
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6853
Just look for "random" in the index.
Also look for vectors in the index, lots about them.
Your way of doing it doesn't sound so bad actually :) Nothing wrong with simple. Of course if you find that there are lag issues from so many bullets then you would have to start thinking of solutions where a certain region is covered by bullets instead of modeling individual bullets. Try the simple way first though and see how it works.