Forum

Reloadable cannon help

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Reloadable cannon help

Postby Biodude » Thu Jun 24, 2010 4:41 pm

Hey, for my game I wanted a reload-able, aim-able cannon, but we are not sure how he can tackle this:

When you press use on a cannon, it shows you instructions how to use the cannon for a few seconds, and opens its config file. the instructions says:

-Fire is right trigger
-zoom is left trigger
-dpad controls left and right movement and the up and down tilt
-circle is open/close
-The use key will dismount you from the cannon

To load the cannon, press use to the gun(which shows the cannon's controls)Then press circle (impulse) to open the back of the gun. Pickup the shell by pressing use to it, and touch the open cannon with it. The cannon will then play a frame group that has the shell in the gun. then, press use to the cannon again, press circle to close the back of the cannon, aim, and fire.
------------------
This may be difficult todo, but my coder is stuck here. Any way you guys could help us out with this? Thanks in advance
User avatar
Biodude
 
Posts: 186
Joined: Wed Aug 27, 2008 7:17 pm

Postby Biodude » Fri Jun 25, 2010 1:00 pm

If I have to, I will just make it use some kinda func cannon code, but I really do no want to do that
User avatar
Biodude
 
Posts: 186
Joined: Wed Aug 27, 2008 7:17 pm

Postby Karatorian » Tue Aug 17, 2010 7:38 pm

From the sound of the instructions you gave, this must be for PSP, which I have no experience with, but the core concepts should be the same, so I'll try to help out where I can.

I'm assuming you've got some sort of +use system already set up. In the cannon's use system, you'll have to centerprint (or whatever) the instructions, then stuffcmd("exec cannon.cfg"). That config should rebind all the relevant keys to new cannon control impulses you'll have to add.

For the first draft, start with basically nothing. Add the impulses and make them do nothing other than display a simple text message. This will give you a framework to work with. (Of course, you should make the impulse bound to the use key restore the standard controls.

Once you've got that much working, add bits and pieces slowly. Make the fire impulse do something. If you want, an easy way would be to crib code from an existing weapon, adjusted as needed. This should be the easiest bit.

Make the reloading impulses function and adapt the fire function to monitor the variables they control.

Make the aiming impulses adjust an aim vector on the cannon entity. Also make them adjust the player's view, so the crosshair points where the cannon is aiming. Change the firing function to shoot where you're aiming at.

Once you've got the gameplay functional, worry about the eyecandy: mount and dismount animations, moving the cannon model, etc.

That's what I'd suggest anyway. (Seems in line with the way you're already headed with the idea.) There are several other ways this could be implemented. One would be to make using the cannon almost like any other weapon, but have the +use command change the player's movetype on them so they can't move. This might be easier.
Karatorian
 
Posts: 31
Joined: Tue Aug 17, 2010 4:26 am
Location: Rindge, NH, USA


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest