Back to the Vavoom Forum Archives


Forum

Question on how to programm...

Fri, 23 Jan 2009 22:37:28

Karnizero

A weapon whose Fire and Hold states are independant. For example, this is how i code a sample weapon with both states:
Fire:
    PUNC A 1 A_Fire
    ?????  <<-----
Hold:
    PUNC BCD 2 A_Fire2
    Goto Ready
If i set a line in ???? like "Goto Ready", the weapon never goes to Hold, cause when "Fire" state reaches ?????, returns to "Ready" state. If i dont set "Goto Ready" at ????, then the weapon always goes through "Hold" state, and i only want to go "Hold" when the player really holds the weapon firing. How to solve this problem? Thanks in advance.
Sat, 24 Jan 2009 19:03:50

Janis Legzdinsh

Before "Goto Ready" add a state that has A_ReFire state action.
Sun, 25 Jan 2009 12:26:34

Karnizero

[quote="Janis Legzdinsh":368mtwvm]Before "Goto Ready" add a state that has A_ReFire state action. It works. Thanks.
Sun, 25 Jan 2009 14:56:06

Karnizero

Two more VC questions: 1.- Whats the State Action to change the offset of the sprite on that State? (Im trying to make the weapon to "vibrate" when overheat, but i dont want to create an specific sprite for each "vibration") 2.- Is there any way to know when the player unpresses the fire button? For example, make a weapon to charge, until the player releases the attack button, so he can have the weapon charged, and shot when he wants. Thanks again.
Sun, 25 Jan 2009 18:40:31

Janis Legzdinsh

[quote="Karnizero":3s0n9gn5]Two more VC questions: 1.- Whats the State Action to change the offset of the sprite on that State? (Im trying to make the weapon to "vibrate" when overheat, but i dont want to create an specific sprite for each "vibration") There's a separate syntax for this. See actors/hexen/fighterfist.txt for an example.
2.- Is there any way to know when the player unpresses the fire button? For example, make a weapon to charge, until the player releases the attack button, so he can have the weapon charged, and shot when he wants.
Not really.
Fri, 30 Jan 2009 15:05:41

Crimson Wizard

[quote="Janis Legzdinsh":25m9bh61]
2.- Is there any way to know when the player unpresses the fire button? For example, make a weapon to charge, until the player releases the attack button, so he can have the weapon charged, and shot when he wants.
Not really. Umm, why? I made same thing with Use button, that is, as long as player holds 'Use', the power meter grows and when he releases it he commits some action with that current power. Basically you should make the check in Player::Tick:
if (Buttons & BT_ATTACK)
{
   was_pressed = true;
}
else
{
   if (was_pressed)
...
}
Fri, 30 Jan 2009 17:47:00

Janis Legzdinsh

Oh, in VC you can do it, but not in DECORATE.
Fri, 30 Jan 2009 19:53:46

Karnizero

Thanks for tip, Crimson Wizard. Very usefull for what i want to achieve: a chargeable weapon, but with different charge status, depending on the time the player keeps charging. The more the load time, the powerfull the shot will be, but it can be shootable when the player wants. [quote="Janis Legzdinsh":2pq31yqi]Oh, in VC you can do it, but not in DECORATE. Thats a reason I'm always talking about VavoomC. If i really want to use Decorate, i would keep on (G)zDoom. <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) -->

Back to the Vavoom Forum Archives