Ok so i had a very simple rule in my workshop mode that worked just fine, but since like 1-2 patches ago it suddenly doesnt anymore.
the rule is as follows:
each hero in my FFA mode has some changes, so i want to display a small message every time you spawn, but you can also make it appear manualy by holding down Melee for 2 seconds.
it worked perfectly. i made 1 rule for every hero.
ongoing each player, all teams, players “hero”
condition:
Or- (compare- is alive- event player -= true) - (is button held - Melee -= true)
rule:
wait 2s, abort when false
create message “custom string”
it used to work just fine, but now it ONLY appears when you spawn.
i tried removing the wait action, tried moving it to the interact button, but it still doesnt work.
whats wrong here?
I’m curious if the “Alive = true/false” Rule doesn’t quite work as well as it should, I actually ran into a similar issue where my hero rules were set on “is in spawn room = true” and “is alive = true” / but then I found myself changing all the code one day because it all stopped working and now I use “Is dead=false”
See if that fixes it.
but the rule still executes on respawn (as intended), only the manual activation through pressing Melee doesnt work anymore…
Can you show us the actual code? (Not some pseudo code in a weird formate wich may be missing some important parts)
sry i couldnt reply sooner.
Heres the whole mode if you wanna take a look for yourself:
43K0X
Ill try to write down the rule for the example hero ashe in the most accurate way i can here in case you dont wanna open the game for it:
Event: Ongoing each player
Team: All
Player: Ashe
Left side:
(Has Spawned(Event Player) == True || Is Button Held(Event Player, Melee)) == True
the action side isnt very relevant but:
wait(2, Abort when False)
Small Message(Event Player, Custom String(“BOB to teleport victim to cellar”))
It used to be able to display the message both when you spawned, AND when you held melee for 2 seconds. now it only appears on spawn.
when i changed the left rule to just:
Is Button Held(Event Player, Melee) == True
then the melee button thing worked again, but of course it doesn appear on spawn anymore.
1 Like
Okay I do see now why it doesn’t work. Onces it got executed, a rule can only retrigger if the condition list gets false and then turns true again.
Since “Has spawned” will never get false after a player has spawned already, the “OR” operator will never get false, so the rule wont retrigger.
You can fix this by splitting the rule into 2 rules:
rule1 - each player
condition:
has spawned(event player) == true
action:
small message(*whatever*)
rule2 - each player
condition:
is button held(event player) == true
action:
wait(2, abort when false)
small message(whatever)
Alternatively you can use a player variable wich kind of works as a “has spawned” negation:
rule1 - each player
condition:
has spawned(event player) == true
(event player.onSpawn == 0 || is button held(event player, melee)) == true
action:
wait(2, abort when false)
event player.onSpawn = 1
small message(*whatever*)
The “onSpawn” variable assures that the “OR” operator may go false.
2 Likes
ok your explanation makes sense, but now i dont understand why it USED to work in the first place.
i cant split it into 2 rules because its already 1 rule per hero, i dont wanna cram 64 rules in there that all basically do the same thing with miniscule differences haha but im already trying to work out a way to make this a bit more compact with arrays and such.