Tommy Gun
by Teromous · in Torque Game Engine · 08/29/2005 (4:28 am) · 0 replies
Hi,
I'm not sure if this was mentioned before (if so please just direct me to the post and forgive my blindness), but I am having some trouble understanding the weapon system in Torque. In chapter 16 on page 497 under the title "The Tommy Gun Script" it mentions:
..."We have yet to create the weapon script that defines how the weapon works. That is something we will cover later, in Chapter 22, when we look at the code that brings all of these models together in our sample game."
I looked for this script in chapter 22 and I did not see it (again if it is forgive me but I don't see it). In chapter 20 there is a script for the tommy gun, located under the title "Weapon Sounds" (found it after some careful looking). Now while I was happy to find this script, I noticed that it is strongly lacking in detail about how the script works...such as the state data. Are those states dictated somewhere in the game engine? Do I *need* every state if I make my gun a different way? How is the projectile handled? It would help a lot if somebody could do a walkthrough of this script or something because it's not making a whole lot of sense to me. I can easily cut and paste somebody elses code, but I would like to write my own with what I learn.
On a side note, I went through some great lengths figuring out how weapons work in the game. I looked at the rocket launcher tutorial, and I looked at the assault rifle script for Jill. It seems that all of them are written in the exact same format...even the commentary is exactly the same. Is everyone just doing a copy/paste routine of the same script?
Thanks in advance for anyone who clues me in.
I'm not sure if this was mentioned before (if so please just direct me to the post and forgive my blindness), but I am having some trouble understanding the weapon system in Torque. In chapter 16 on page 497 under the title "The Tommy Gun Script" it mentions:
..."We have yet to create the weapon script that defines how the weapon works. That is something we will cover later, in Chapter 22, when we look at the code that brings all of these models together in our sample game."
I looked for this script in chapter 22 and I did not see it (again if it is forgive me but I don't see it). In chapter 20 there is a script for the tommy gun, located under the title "Weapon Sounds" (found it after some careful looking). Now while I was happy to find this script, I noticed that it is strongly lacking in detail about how the script works...such as the state data. Are those states dictated somewhere in the game engine? Do I *need* every state if I make my gun a different way? How is the projectile handled? It would help a lot if somebody could do a walkthrough of this script or something because it's not making a whole lot of sense to me. I can easily cut and paste somebody elses code, but I would like to write my own with what I learn.
On a side note, I went through some great lengths figuring out how weapons work in the game. I looked at the rocket launcher tutorial, and I looked at the assault rifle script for Jill. It seems that all of them are written in the exact same format...even the commentary is exactly the same. Is everyone just doing a copy/paste routine of the same script?
Thanks in advance for anyone who clues me in.
About the author