mob |
Problem description:
Basically my melee system checks if you execute the attack again to cancel the previous one but if you spam it they will stack and rapidly execute one after another...
Code:
Problem description: Basically my melee system checks if you execute the attack again to cancel the previous one but if you spam it they will stack and rapidly execute one after another... | ||
#1 Jul 26 2012, 7:14 am
|
|
using variable like punching then check if player can use Attack
| |
#2 Jul 26 2012, 10:18 am
|
|
huh..? why would it matter what the variable is called i already check it see if inaction variable is already being 1 to set faking to 1 and if faking is 1 by the time the previous attack is spawned to return the attack and not finish it..?
but if i spam it fast enough all of them will stack and inaction will be 1 i cant think of a way to prevent it. | |
#3 Jul 26 2012, 10:47 am
|
|
basically it should look like this..
Gokussj99 retracts their left arm... (wait if cast another attack with less then the spawn timer then cancel the previous action) Gokussj99 retracts their left arm... then if not called again the last attack lands and the first one doesn't Gokussj99 left punch does x damage.(2) but if used again.. Gokussj99 retracts their left arm... Gokussj99 retracts their left arm... Gokussj99 retracts their left arm... Gokussj99 left punch does x damage.(3) the last one lands and the two above dont this is what im trying to do.. But my code is wrong so if you spam the attack fast enough the attacks already sent will land because by the time they are landing InAction is set to 1 again and im not sure how to prevent that. | |
#4 Jul 26 2012, 10:51 am
|
|
I understood none of that.
| |
#5 Jul 26 2012, 10:53 am
|
|
basically.. once you cast an attack... if you cast it again it is called faking the previous attack should not land but the second one.
and etc if more are casted say you cast 6 only the 6th one should land the others should not. | |
#6 Jul 26 2012, 11:21 am
|
|
No that code just breaks the whole thing because it returns before the inaction can be reset.
the returns need to be called in the end not at the start. | |
#7 Jul 26 2012, 11:39 am (Edited on Jul 26 2012, 11:50 am)
|
||
The issue is no matter how many times you spam the attack will eventually land.
It should never land if you keep casting it is pretty much the objective. | ||
#8 Jul 26 2012, 11:50 am
|
|
update above.
| |
#9 Jul 26 2012, 11:55 am
|
|
I have been on this stupid issue for longer than I want to admit.
D: Basically Gokussj99 Attacks (CANCELLED) Gokussj99 Attacks (NOT CANCELLED) Basically just cut off the first attack period and make sure the delay is the full length. I'm sorry if I can't properly explain what the issue is it seems no one understands me :( I appreciate you taking your time to try to help me. | |
You've got the right idea with the actionCount variable, but you're way overcomplicating it:
Basically, you use the current count as an "ID" for each action. If the actionCount changes before an attack executes, that means another attack has been run and this one should cancel. If the actionCount hasn't changed, then the attack is uninterrupted and should execute. | ||
#11 Jul 26 2012, 3:36 pm
|
|
Omg.. i love you DarkCampainger you're a life saver..
| |