Game Development Community

Changing the time between shots

by Algoma U · in Torque Game Engine Advanced · 05/01/2009 (8:51 pm) · 7 replies

Hi,
I've been modifying the stronghold demo and I'm pretty much finished my game. I've just doing a few refinements and I was wondering if anyone knew how to change the time between shots. For example, when the player shoots he has to wait about a second before he can fire again. If I wanted to change this to 0.2 seconds is this possible?
Cheers,
Tommy.

About the author

Recent Threads

  • Advanced Camera issues

  • #1
    05/01/2009 (8:56 pm)
    Look in crossbow.cs (I presume that's what you're using as a weapon) and go down to the state machine, lower the reload time to what you want, maybe shorten the fire timeout too. But remember, the crossbow does have an animation for reload, it might all end up looking a bit off.
    #2
    05/01/2009 (9:08 pm)
    At first i thought this was a question about drinking alcohol, and being Im a professional at alcohol consumption was excited at the opportunity to reply on a subject that i hold dear.

    Anyhow... (EDIT)Aw Steve beat me to it..
    #3
    05/02/2009 (11:28 am)
    Sweet! It worked great. I just changed the timeout values in the fire and reload animations in the state machine. One question though, I want to change the firing time based on what type of character is being used. Is there a way to change this outside the datablock and say inside player.cs?
    #4
    05/02/2009 (12:02 pm)
    Short answer: no.

    Medium answer: create a unique weapon with the settings you want for each player-type. You'll need to come up with a method of determining the desired weapon image per player upon pick-up of the weapon item. Tedious at best.

    Long answer: is really complicated.
    #5
    05/02/2009 (1:32 pm)
    Hmm... I was thinking about making unique weapons but I was hoping for a more elegant method. Okay, thanks for the help!
    #6
    05/02/2009 (3:37 pm)
    You may be able to clone and modify the original datablock as per need. EDIT: dynamically

    I often build generic datablocks, so to clone and modify specific needs from them(my TGEA1.8.1 Material setup have deep foundation in this ability). EDIT: have not tested this dynamically
    #7
    05/04/2009 (10:24 am)
    Like Caylo said, you can easily create multiple datablocks with slight changes between them by using the clone/copy syntax:

    datablock ShapeImageData(foo) {
       <foo parameters go here>
    };
    
    datablock ShapeImageData(bar : foo) {
       <bar will copy all of foo's parameters automatically>
       <you can change only the ones you need here>
    };