The video speaks for itself. My items are re equipping when they should not be. However, an interesting thing I found, was then when I removed the code that allowed me to skip performance, suddenly, this issue would dissappear, just like that, and my code works just fien after that.
As you can see, my performance skip code is completely untied to my code for checking the debuffs on Dysangelos, which is quite interesting to wonder how its connected.
#Re equipping items
48 messages · Page 1 of 1 (latest)
I also skipped out anything in my code that had
/*
*/
If you noticed any jumps
Also, right to left for going top to bottom for my code
Why are you using a poison wand and a poison hammer when dysangelos is vigor
use rune swords dual wield smh
Ohp, thats a bad video, but I can get another of the first phase if you would like
anyways this isn't much of a bug more than a stonescript issue so
But whats the problem with my code?
there's most likely some bug in your code
dunno can't check it right now
ask in #stonescript
I rewrote the code slightly different for the same checks, and ended up with the same result
Heres proof that it is directly linked to perf skip code
i didnt look closely but i notice you have a lot of code paths that end in an else-if, which means if the condition is false, it does nothing after that. this could be leading to situations where your code doesnt try to equip anything that frame
generally you always want it to be defined in the code what should be equipped at any moment
It is always defined
But that wouldn't explain why this happens only whenever I have perf skip code written, which is somewhat unrelated to what should be equipped that frame
equip and activate commands are skipped if its the same ones as the previous frame, the animation canceling code means it changes each attack so it has to re-run, this causes interruptions if you equip multiple weapons to a hand within a frame and may make it retry an activation that was impossible when the code ran.
also you are manually starting by changing the loadout, that should be a hint that something is wrong with your code.
For instance, ai.enabled returns a boolean, not the string "True", though it may do some type conversion.
do ?ai.enabled ! true
or ?!ai.enabled
For starting the level? I just dont have any code written for the start of a level, which is why I manually set the start to shielf and trisk
referring to you swapping the equipment manually several times during the vid, like the start of the fight
But Ive never run into any problem with the animation cancelling code till now. And nothing else is getting equipped on that frame.
The only two things that are running and chnaging equip are perf skip, which Ice never had a problem with, and a poison wand equippinh when the boss does not have the desired debuff
just looking at the code you posted, you also have the bardiche section running most of the time, but replacing the equip before it can stay in hand for a frame to activate, so it keeps interrupting the other equips every time aac makes equips re-run
Hmmm, you may be right
if you had used ?item.CanActivate() instead, it would at least have gone on cooldown and not interrupted the rest, though as written it will just get interrupted by the other stuff
Yep it was that
I do have item.CanActivate()
The problem is, if I do it on the same frame, it just doesnt activate half the time
you need to prevent the other equips from running when trying to use an ability that can get interrupted, this is where the :? is useful
I recommend putting all equip commands as part of the same :? chain or nested within it
so that you can put the activate earlier in the :? chain, which blocks the rest from running
?item.CanActivate() is not the same as ?item.CanActivate("bardiche")
they do different things
item.CanActivate() checks if abilities are enabled globally, i.e not in a cinematic and similar
item.CanActivate(id here) checks if that specific ability can be used right at that moment, which among other things check that its equipped, and this equip check is 1 frame behind because equip and activate doesn't run until the entire code is finished
you dont need item.CanActivate(id here) in most situations
you already checked cooldown and set the equip
you just need to check that its not in a cinematic or similar that disables abilities
Luckily I have that
You do need something that keeps bardiche equipped for the duration of the cast though, which blocks the other equips if using :?
The tutorial uses 2 cooldown checks, but using item.right and item.right.state is more flexible
?foe.distance < 9 & item.CanActivate()
^& item.GetCooldown("bardiche")<=0
^| item.right="bardiche"
^& item.right.state=2
equip bardiche
activate R
Ah, using the item state to wait until its finished, but not hold it om forever, clever