Workshop: Variable chase breaks for loops

Description

If you use Chase Variable At Rate/Time on a variable, that variable can no longer be used in any For loops, even if the chase itself is never executed. Instead the workshop skips over the For loop entirely.

Disabling the rule with the Chase does not fix this. You must delete the offending rule entirely. This seems to apply to both player variables and global variables.

Expected Behaviour

  • For loops execute normally and are displayed in the inspector.
  • Disabled rules should not affect enabled rules.

Other Details

I was having an unrelated issue when I tried to use two chases in a row on the same variable to make a sphere grow then shrink; it would grow, but the shrink wouldn’t do anything. I haven’t tested it thoroughly yet so I can’t say if this is a separate bug or an issue with my own game mode.

It also seems that disabling the Chase action itself fixes it. So disabled actions are compiled properly but enabled actions in disabled rules aren’t.

Demo: 1XWAG

  1. Start the game mode.
  2. Spawn as any hero.
  3. Check the inspector log. The numbers 0 to 4 are supposed to be displayed, but aren’t.
  4. Delete the disabled rule, then repeat the steps. The numbers will be displayed now.

Details

The demo contains the following two rules:

The first rule executes a For loop after the player spawns as any hero. It will log the values of the iterator in the Inspector, then display the same text in small messages.

rule("When player spawns, show test")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	conditions
	{
		Has Spawned(Event Player) == True;
	}

	actions
	{
		"Show test in log"
		Log To Inspector(Custom String("Start Test"));
		For Player Variable(Event Player, Iterator, 0, 5, 1);
			Log To Inspector(Event Player.Iterator);
		End;
		Log To Inspector(Custom String("End Test"));

		Wait(1, Ignore Condition);

		"Show test to player"
		Small Message(Event Player, Custom String("Start Test"));
		For Player Variable(Event Player, Iterator, 0, 5, 1);
			Small Message(Event Player, Event Player.Iterator);
			Wait(0.200, Ignore Condition);
		End;
		Small Message(Event Player, Custom String("End Test"));

		Small Message(Event Player, Custom String("Test complete. Check Inspector."));
	}
}

The second rule is never executed. The rule itself is disabled, the event can’t trigger, and the conditions are impossible to meet. However, the existence of this rule will interfere with all for loops that use Event Player.Iterator. Deleting this rule fixes the game mode.

disabled rule("This rule will never be executed")
{
	event
	{
		Player Left Match;
		Team 2;
		Slot 10;
	}

	conditions
	{
		False == True;
	}

	actions
	{
		Chase Player Variable At Rate(Event Player, Iterator, 0, 1, None);
	}
}