Author Topic: States/Sequence Issues | Need Scripter as well  (Read 740 times)

I've made a weapon that is supposed to do the following:
Activate animation<idle state<charging animation<firing animation<return to idle state. Though since I don't know how to work states sequences, the animations don't play correctly.
Instead it skips the Activate Animation: and does the charge one. When the weapon is charged and fired: it plays the fire animation normally but stops at the end of the fire animation, ignoring the charge animation from then on until the weapon is re-equipped.

I'd appreciate the help of someone who understand torque script, and someone I could contact in the future if I have anymore trouble.


Wasn't really sure if this goes here, Help, General discussion or whatnot; since it's both torque script help and asking for someone to work with.
Current State sequence:
Code: [Select]
stateName[0] = "Activate";
stateTimeoutValue[0] = 1.5;
stateSequence[0] = "Activate";
stateTransitionOnTimeout[0] = "Ready";

stateSound[0] = weaponSwitchSound;

stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Charge";
stateAllowImageChange[1] = true;

stateName[2]                    = "Charge";
stateTransitionOnTimeout[2] = "Armed";
stateTimeoutValue[2]            = 1.2;
stateSequence[0] = "Charge";
stateWaitForTimeout[2] = false;
stateTransitionOnTriggerUp[2] = "AbortCharge";
stateScript[2]                  = "onCharge";
stateAllowImageChange[2]        = true;

stateName[3] = "AbortCharge";
stateTransitionOnTimeout[3] = "Ready";
stateTimeoutValue[3] = 0.001;
stateWaitForTimeout[3] = true;
stateScript[3] = "onAbortCharge";
stateAllowImageChange[3] = true;

stateName[4] = "Armed";
stateTransitionOnTriggerUp[4] = "Fire";
stateAllowImageChange[4] = false;

stateName[5] = "Fire";
stateTransitionOnTimeout[5] = "Ready";
stateTimeoutValue[5] = 0.5;
stateFire[5] = true;
stateSequence[5] = "Fire";
stateScript[5] = "onFire";
stateWaitForTimeout[5] = true;
stateAllowImageChange[5] = true;
stateSound[5] = PowerArcaneFireSound;
« Last Edit: February 18, 2013, 07:20:09 PM by Deadzone »

I hope this will help:

Code: [Select]
// Plays activate animation for 1.5 seconds when you first pull it out
stateName[0] = "Activate";
stateTransitionOnTimeout[0] = "Ready";
stateTimeoutValue[0] = 1.5;
stateSequence[0] = "activate";
stateSound[0] = weaponSwitchSound;

// We're idle and ready to start charging
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Charge";
stateAllowImageChange[1] = true;

// Play charge animation for 1.2 seconds. Go to Armed if waited full 1.2 seconds, go back to Ready state if released too early
stateName[2] = "Charge";
stateTransitionOnTimeout[2] = "Armed";
stateTimeoutValue[2] = 1.2;
stateWaitForTimeout[2] = false;
stateTransitionOnTriggerUp[2] = "Ready";
stateAllowImageChange[2] = true;
stateScript[2] = "onCharge";
stateSequence[2] = "charge";

// We're charged up, go to Fire state when we release mouse
stateName[3] = "Armed";
stateTransitionOnTriggerUp[3] = "Fire";
stateAllowImageChange[3] = false;

// Play fire animation for 0.5 seconds, then go back to Ready state
stateName[4] = "Fire";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.5;
stateWaitForTimeout[4] = true;
stateAllowImageChange[4] = true;
stateScript[4] = "onFire";
stateSequence[4] = "fire";
stateSound[4] = PowerArcaneFireSound;

(I didn't test it)

I hope this will help:
-snipe-
(I didn't test it)
It works! Thank you.
Had to add some stuff to it, here's what is working for me:
Code: [Select]
// Plays activate animation for 1.5 seconds when you first pull it out
stateName[0]                     = "Activate";
stateTimeoutValue[0]             = 1.5;
stateSequence[0] = "Activate";
stateTransitionOnTimeout[0]       = "Ready";
//stateSound[0] = weaponSwitchSound;

// We're idle and ready to start charging
stateName[1] = "Ready";
stateSequence[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Charge";
stateAllowImageChange[1] = true;

// Play charge animation for 1.2 seconds. Abort if released too early.
stateName[2]                    = "Charge";
stateTransitionOnTimeout[2] = "Armed";
stateTimeoutValue[2]            = 1.2;
                  stateSequence[2] = "Charge";
stateWaitForTimeout[2] = false;
stateTransitionOnTriggerUp[2] = "AbortCharge";
stateScript[2]                  = "onCharge";
stateAllowImageChange[2]        = true;

                  // We wanted to abort the charge state
stateName[3] = "AbortCharge";
stateTransitionOnTimeout[3] = "Ready";
stateTimeoutValue[3] = 0.05;
stateWaitForTimeout[3] = true;
stateScript[3] = "onAbortCharge";
stateAllowImageChange[3] = true;

// We're charged up, go to Fire state when we release mouse
stateName[4] = "Armed";
stateTransitionOnTriggerUp[4] = "Fire";
stateAllowImageChange[4] = true;

// Play fire animation for 0.5 seconds, then go back to Ready state
stateName[5] = "Fire";
stateTransitionOnTimeout[5] = "Ready";
stateTimeoutValue[5] = 0.5;
stateWaitForTimeout[5] = true;
stateAllowImageChange[5] = true;
stateScript[5] = "onFire";
stateSequence[5] = "Fire";
stateSound[5] = PowerArcaneFireSound;

Still looking for someone to work with if anyone is interested.
« Last Edit: February 20, 2013, 12:53:25 AM by Deadzone »