Page MenuHomeFeedback Tracker

Sleep in while bugged ?
Closed, ResolvedPublic

Description

While i was trying to calculate how much meters player has moved i found this bug.
It doesn't let you execute the code as it should be, and if you put a systemChat or hint (anything else i think too, but variables not working) the script will start again.

I don't know if its a bug or if its intended but its kinda weird and problematic if you don't want to show off a systemChat.
Any possibilities to debug / go around this without putting something between my var and my sleep ?

Details

Severity
Major
Resolution
No Bug
Reproducibility
Always
Operating System
Windows 7 x64
Category
Scripting
Steps To Reproduce
[] spawn {
	distDone = 0;
	while {true} do {
		thisisplayerpos = getPos player;
		sleep 3;
		systemChat str format ["dist done: %1",distDone];
		distDone = distDone + round(player distance thisisplayerpos);
	};
};
Additional Information

To debug the script you can do it like this:

[] spawn {
	distDone = 0;
	while {true} do {
		thisisplayerpos = getPos player;
		systemChat "test";
		sleep 3;
		systemChat str format ["dist done: %1",distDone];
		distDone = distDone + round(player distance thisisplayerpos);
	};
};

Event Timeline

Wawixs created this task.Oct 25 2016, 11:56 AM
Wawixs edited Steps To Reproduce. (Show Details)
Wawixs edited Steps To Reproduce. (Show Details)
Wawixs edited Additional Information. (Show Details)

NVM Fixed i put the second systemChat badly !

Wawixs removed a subscriber: Wawixs.Oct 25 2016, 12:32 PM
Wawixs added a subscriber: Wawixs.
razazel closed this task as Resolved.Oct 25 2016, 3:50 PM
razazel changed Resolution from Open to No Bug.