My NPC´s turn around

Started by Postmodern Adventures, Fri 17/07/2020 18:29:04

Previous topic - Next topic
I have several NPC walking some left to right and others right to left with this code in repeteadly_execute:

Code: ags

if (!ctrans01.Moving)
{
    if (ctrans01.x < 200) ctrans01.Walk(400, 162,  eNoBlock, eAnywhere);
    else ctrans01.Walk(-100, 162, eNoBlock, eAnywhere);

}


And i have the problem when i change room and turn back to the room with the people walking, some of them just turn around. Here´s a video:



Is there any way to prevent this?




eri0o

#1
I imagine once you change room they all stop moving, so once you come back, they start moving again because of your if condition. It's probably best to use the instant fadeout/fadein and instead tween the transparency of a fullscreen empty GUI with black background, so people start walking again before the black transition happens.

Edit: alternatively instead of anywhere, use a specific location and make people keep walking the direction they were going?

Based in your idea i tried to do a simple thing. I preload a fullscreen black object and a View with progressive transparency animation (eNoblock)  to zero. While this happens, NPC turns around and the player doesn't notice it.

I know it''s not an elegant solution,  but something like that it's what i looking for. So, thanks Eri0o for the suggestion. You saved my day.

eri0o

I try to craft good systems for tools but I fully believe a game is collection of hacks that ships.

arj0n


KyriakosCH

Quote from: eri0o on Sat 18/07/2020 01:13:47
I try to craft good systems for tools but I fully believe a game is collection of hacks that ships.

Of course. Or at any rate it's what I do - abusing regions/items/other as triggers  (laugh)
This is the Way - A dark allegory. My Twitter!  My Youtube!

SMF spam blocked by CleanTalk