Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Waiting in JS

Status
Not open for further replies.

Yurii

Villager
Xy$
0.00
Hello, please help in resolving the issue.

There are two events E1 and E2.
Hero activates E1, and E1 moves left with a balloon popped-out (zzz).
In a half of a second, E2 pops out its own balloon (!).
Unfortunately, this.wait(30) does not work here, neither for E2, nor for E1 (if I want E1 to pop another balloon while moving). Such command simply locks a hero from moving, and the balloons appear immediately.

Nevertheless, please see below the working script that I managed to create.
E1= $gameMap.event(1);
E2 = $gameMap.event(2);
E1.moveStraight(4);
E1.requestBalloon(10);
setTimeout('E2.requestBalloon(1);', 500);

However, it does not involve any 'wait' from objects.js, because I cannot get it how to use a check whether waiting is complete or not.

Please advise how to check in-game 'waiting' with JS?

And a general question: is there any list of checks for conditions similar to 'waiting' above, like animation is moving, or fade-out/fade-in are playing, etc.?
So far, I have found only a check whether a text window is open, gameMessage.isBusy()
 

LTN Games

Master Mind
Resource Team
Xy$
0.01
Are you setting the events set to parallel? If they're set to Action, or Player Touch then the wait will stop all movement, the only option that does not stop movement is parallel.
 

Yurii

Villager
Xy$
0.00
I've just rechecked again.
Unfortunately, all E2 Triggers (Action button, Parallel, etc.) do not influence this.wait(30) or any other 'wait' number.
In script:
E1= $gameMap.event(1);
E2 = $gameMap.event(2);
E1.moveStraight(4);
E1.requestBalloon(10);
this.wait(30);
E2.requestBalloon(1);


the character freezes, but the balloons pop up with no delay between E1 and E2.
[doublepost=1461431773,1461091651][/doublepost]I have found a string to check waiting: this.updateWait()
In a custom function, 'this' should be aliased beforehand (var anyAliasName = this), and then "anyAliasName.updateWait()"
 

LTN Games

Master Mind
Resource Team
Xy$
0.01
I have found a string to check waiting: this.updateWait()
In a custom function, 'this' should be aliased beforehand (var anyAliasName = this), and then "anyAliasName.updateWait()"
and this works for you? I don't think I've ever noticed this method before, I'll have to take a look at it in the core scripts.
 
Status
Not open for further replies.
Top