Author Topic: Weird States[SOLVED but no idea why]  (Read 991 times)

Well I'm trying to make this gun reload and have ammo.

Basically the problem is, when you're out of ammo, if you remount the gun, you can fire one shot then it needs to reload.
But I checked and every time I remount(by switching to another gun and back) it does the "activate" state then it goes to straight to "ready"
It's supposed to go to "ammocheck" since it says
Code: [Select]
stateTransitionOnTimeout[0]      = "AmmoCheck";The activate state says nothing about the ready one and it "onAmmoCheck" never fires

What's wrong?

Whole code: http://pastebin.com/JX0fTTGN
« Last Edit: December 09, 2013, 04:51:12 PM by Aide33 »

You need to have a callback for onAmmoCheck. I think it's 'stateScript[0] = "callback";'. Could be wrong, I'm not an image guy.

You need to have a callback for onAmmoCheck. I think it's 'stateScript[0] = "callback";'. Could be wrong, I'm not an image guy.
I do have that

anybody?

I really can't seem to find what the problem is

Try posting your whole state code.


it's been 3 days already come on guys, I'm on a schedule and I can't figure out whats wrong

That's odd. I do remember making my own script state that didn't work though, so idk.

I took a look at this when you first posted it, but couldn't see anything wrong. All i can suggest is rewriting it, and hope that it gets fixed.

I FIXED IT YES

no idea why this works but I changed

Code: [Select]
stateTransitionOnTimeout[0]      = "AmmoCheck";to
Code: [Select]
stateTransitionOnTriggerDown[0]      = "AmmoCheck";
the code doesn't make sense at all but it works