Game Development Community

Cant make my ship fire

by Daniel · in Torque Game Builder · 05/22/2005 (1:05 am) · 9 replies

Im trying to make the ship fire but I cant figure out why it isnt doing it. Im following the tutorials and I tried checking for typos, or something but I cannot find out why....here is the code that involves my problem. Note that everything else is working fine. I have a ship onstage that I can controll with the keyboard, and then I have an enemy ship flying towards me and he shoots one missile at me. (collision detection is not programmed yet)
So the problem is that I cannot make my ship fire when I press the "space" key.


**edited by admin, T2D script code can't be posted in public.

#1
06/02/2005 (11:57 pm)
All that just to make your ship fire?? I'm sorry I can't help you and this is a wasted post but I just had to say GOD DAMN!!! Please tell me there is ALOT more involved with this script than just making the player shoot. I was curious about scripting but if I have to write a whole novel just to have my ship shoot then scripting is definatley NOT for me. I'll just stick to music and art. Again, sorry man. I hope someone can help you out soon. .....damn.......
-Ajari-
#2
06/03/2005 (12:23 am)
Daniel: Minor script error in the code you had there. You had misplaced brackets that are throwing T2D out when it compiles your scripts. Also, bring down the console with ~ and see if there are red errors. The ## markers will let you know where the errors are.

Ajari: It's not all to make the player player. The first function sets up the graphics datablocks, then there this a section to deal with creating the player sprite. Following that is the keyboard input,a function to create an emeny sprite, and then a function to make the enemy fire. Only the last function is directly related to making the player fire when a key is pressed.

You should see the script files for my current game. They total up to 50kb so far, and there's loads more to do. When you consider they're bare text files, that's quote a lot of scripting....

**edited by admin to remove T2D script code from public view
#3
06/04/2005 (4:28 am)
I'd suggest taking this to the private forums, this code shouldn't really be public.

Thanks,

- Melv.
#4
06/04/2005 (10:42 am)
Daniel, your profile says that you are not a T2D SDK licensee. How do you have the T2D scripts? Please email me to explain.
#5
06/04/2005 (11:46 am)
Apologies, I didn't notice this was the public forum when I posted.
#6
06/05/2005 (4:08 am)
@Phil thanks for clearing that up for me. I am interested in scripting in T2D. I'm hesitant to purchase it because I'm not sure if I would be able to handle scripting. I wouldn't even know where to begin after purchasing T2D. I have some art and animation frames all set up for a T2D game as a possible side project. I guess I just need to take that leap of faith and go ahead and purchase it.

Looks like Dan is in trouble. How is he going to get himself out of this one. Josh don't make too bad of an example out of him. :p
-Ajari-
#7
06/05/2005 (5:56 am)
Well, you can gain a lot of info from the example files. The shooter demo and fish demo have lots of useful bits in them that can get you started on the right track.

There's also a huge heap of things posted in the private forums.

The other alternative would be to hook yourself up with a project that you provide the art for. Admittedly, they wouldn't be able to send you the source script files if you don't own T2D, but it would perhaps give you an insight. Once you'd purchased T2D you'd be able to manipulate the source files directly to put your graphics into the game.
#8
06/05/2005 (1:20 pm)
Quite a few artists with at least a touch of "technical leaning" have done exceptionally well with T2D--both the base tutorial and the excellent library of expanded tutorials Matt Langley has put out (at last count I think there are 11+ more?) step you through just about everything you'll need to know about working with T2D.

If it's simply concern about being to understand the tech side of making a 2D game, I personally would suggest jumping on the boat--even if you have difficulties, the community is simply amazing!
#9
06/05/2005 (2:33 pm)
Thanks guys, that was very encouraging. I'm gonna go ahead and go for it.
-Ajari-