Author Topic: Rapid fire? Semi Auto?  (Read 5879 times)

umm, are you sure your changing the

Code: [Select]
stateTransitionOnTimeout[##] = "TriggerCheck";
in blocks 10 and 11?

umm, are you sure your changing the

Code: [Select]
stateTransitionOnTimeout[##] = "TriggerCheck";
in blocks 10 and 11?

Yup.

Here's how it looks like now.

Code: [Select]
   // Initial start up state

stateName[0]                      = "Activate";
stateTimeoutValue[0]              = 0;
stateTransitionOnTimeout[0]        = "Equip";
StateSequence[0] = "Ready";
StateSound[0] = "P250E";
stateName[1]                      = "Ready";
stateTransitionOnNoAmmo[1]        = "Reload";
stateTransitionOnTriggerDown[1]  = "Fire";
stateAllowImageChange[1]          = true;

    stateName[2]                      = "Equip";
stateTimeoutValue[2]              = 0.80;
stateTransitionOnTimeout[2]        = "LoadCheckA";
StateSequence[2] = "Equip";
StateSound[2] = "P250Equip";
   
stateName[3]                    = "Fire";
stateTransitionOnTimeout[3]      = "Ready";
stateTimeoutValue[3]            = 0.15;
stateFire[3]                    = true;
stateAllowImageChange[3]        = false;
stateSequence[3]                = "Fire";
stateScript[3]                  = "onFire";
stateEjectShell[3]          = true;
stateEmitter[3] = gunFlashEmitter;
stateEmitterTime[3] = 0.05;
stateEmitterNode[3] = "muzzleNode";
stateWaitForTimeout[3] = true;
StateSequence[3] = "Fire";
stateSound[3] = P250Fire;

stateName[4] = "Delay";
stateTransitionOnTimeout[4]      = "FireLoadCheckA";
stateTimeoutValue[4]            = 0.1;
stateEmitter[4] = gunSmokeEmitter;
stateEmitterTime[4] = 0.5;
stateEmitterNode[4] = "muzzleNode";

//Torque switches states instantly if there is an ammo/noammo state, regardless of stateWaitForTimeout

stateName[5] = "LoadCheckA";
stateScript[5] = "onLoadCheck";
stateTimeoutValue[5] = 0.01;
stateTransitionOnTimeout[5] = "LoadCheckB";

stateName[6] = "LoadCheckB";
stateTransitionOnAmmo[6] = "Ready";
stateTransitionOnNoAmmo[6] = "ReloadWait";

stateName[7] = "ReloadWait";
stateTimeoutValue[7] = 0.3;
stateTransitionOnTimeout[7] = "Reload";
stateWaitForTimeout[7] = true;

stateName[8] = "Reload";
stateTimeoutValue[8] = 1.3;
stateScript[8] = "onReloadStart";
stateTransitionOnTimeout[8] = "ReloadB";
stateWaitForTimeout[8] = false;
StateSequence[8] = "Reload";
stateSound[8] = P250R;

stateName[9] = "ReloadB";
stateTimeoutValue[9] = 0;
stateTransitionOnTimeout[9] = "Reloaded";
stateWaitForTimeout[9] = false;
StateSequence[9] = "Reload2";
stateSound[9] = P250CI;

stateName[10] = "Reloaded";
stateTimeoutValue[10] = 0.05;
stateScript[10] = "onReloaded";
stateTransitionOnTimeout[10] = "TriggerCheck";
stateSound[10] = P250ClipOut;

stateName[11] = "Smoke";
stateEmitter[11] = gunSmokeEmitter;
stateEmitterTime[11] = 0.3;
stateEmitterNode[11] = "muzzleNode";
stateTimeoutValue[11] = 0.2;
stateTransitionOnTimeout[11] = "TriggerCheck";
stateTransitionOnTriggerDown[11] = "Fire";

stateName[12] = "ReloadSmoke";
stateEmitter[12] = gunSmokeEmitter;
stateEmitterTime[12] = 0.3;
stateEmitterNode[12] = "muzzleNode";
stateTimeoutValue[12] = 0.2;
stateTransitionOnTimeout[12] = "Reload";

stateName[13] = "FireLoadCheckA";
stateScript[13] = "onLoadCheck";
stateTimeoutValue[13] = 0.01;
stateTransitionOnTimeout[13] = "FireLoadCheckB";

stateName[14] = "FireLoadCheckB";
stateTransitionOnAmmo[14] = "Smoke";
stateTransitionOnNoAmmo[14] = "ReloadSmoke";

stateName[15] = "TriggerCheck";
stateTransitionOnTriggerUp[15] = "Ready";

oh jeesus christ... i figured it out...

Code: [Select]
stateTransitionOnTimeout[3]      = "Ready";
this solves everything, the weapon is COMPLETELY bypassing all of the ammo code and the code we added, change that line to:

Code: [Select]
stateTransitionOnTimeout[3]      = "Delay";
and then try it, the scripts are still set up for a machine gun mind you, but for reasons of simplicity we just bypassed the full auto functionality.  we could shorten that code quite a bit, but i feel it would be too difficult to explain, so for now we will stick to simple edits...

oh jeesus christ... i figured it out...

Code: [Select]
stateTransitionOnTimeout[3]      = "Ready";
this solves everything, the weapon is COMPLETELY bypassing all of the ammo code and the code we added, change that line to:

Code: [Select]
stateTransitionOnTimeout[3]      = "Delay";
and then try it, the scripts are still set up for a machine gun mind you, but for reasons of simplicity we just bypassed the full auto functionality.  we could shorten that code quite a bit, but i feel it would be too difficult to explain, so for now we will stick to simple edits...

I told you it was from a Thompson SMG, I took it cause of the ammo system is used.

The reload now works fine. It's just slow and still shoots automatically without letting go. This is a kind of a pistol made for spamming. And it's really slow like that.

Shhh, Okay I figured I could adjust it. Okay so now the problem is simply the automatic thing.

im loosing my edge here... omg, but i think i have it this time, change this line:

Code: [Select]
stateTransitionOnAmmo[6] = "Ready";
to

Code: [Select]
stateTransitionOnAmmo[6] = "triggerCheck";
basically i am trying to do this without reading through all of the code and i keep making stupid mistakes... its late, im sorry :P
« Last Edit: September 19, 2014, 10:51:01 PM by zombekillz »

Same thing happens, Nothing changes and still full auto sadly.

I found an adorable script in UnTiered Arms. Do you think it's free to use?

I found an adorable script in UnTiered Arms. Do you think it's free to use?

just ask the author, I'm sorry I couldn't help more, but you have my permission to use any scripts from my advanced weapon pack, they generally use the exact same ammo system, just with a few modifications

Oh yea, and in block 11 there is also an on trigger down secuence that should be an on trigger up, not to mention the trigger heck code is not needed, so we can change block 10 and 11 back to the way they were...

just ask the author, I'm sorry I couldn't help more, but you have my permission to use any scripts from my advanced weapon pack, they generally use the exact same ammo system, just with a few modifications

I'll give it a try if I can, Of course.

I'll give it a try if I can, Of course.

Also if you don't mind I could add you somewhere like steam so I could request some help..

If you two figure it out, please post it here. I have a feeling i will need the solution soon enough

If you two figure it out, please post it here. I have a feeling i will need the solution soon enough

Hm?