eBlock VS eNoBlock in "Background" Scene?

Started by Rik_Vargard, Mon 08/08/2022 19:54:41

Previous topic - Next topic

Rik_Vargard

I'm trying to see if it's possible to have NPCs in a room that are doing there thing while you control the player as normal.
I know how to make an NPC walk places while you play, but that's all I managed to do.

For example, while you play, I'd like to have one or more NPCs walk to a point, then stop, then turn Up, then start an animation then turn down again and then walk to a certain point.
Without interrupting what you're doing with the player character.
Like NPCs in a village doing their business, see?

Is this possible?

AndreasBlack

It's possible using Timers. I would recommend for you to get Crimson's Timer Module. It's way better then the built in AGS timer (Sorry the offense AGS)! Way more possibilities with that module. I guess you could also create switch cases for the NPC. Check weither the X/Y of the character is at a certain point & then animate the character (Standing still and blick his eye, or do something) and have a case for when it's !animating, he won't move! But once animation stops he can move (set a longer delay time in the view window). I think in theory that should work as a "Wait" command, sorta, but won't block the playable character's movement in the game.

And make sure to do that animation once only! And when it's done he can move on. But yeah, start with trying a timer.  :)

heltenjon

If you want an example, you can check out the youtube video on the database page of Pedro's Adventures in Spanish: https://www.adventuregamestudio.co.uk/site/games/game/2556-pedro-s-adventures-in-spanish/.

This game was sadly ovelooked for nominations for the AGS animation award, but as you can see, in several of the scenes, there are villagers walking about, making food, crossing a bridge, or the bartender working.

Rik_Vargard

Phew OK! Thanks for the replies, guys, much appreciated! :)

So yes, for now, the only thing I managed to do to make it work are those timers.
It's a separate timer for every action but it's working.

Cheers!

newwaveburritos

You might find this useful.  It's switch case based like Andreas mentioned and I use it to do similar behaviors to what you're describing.  The hard part is wrapping your head around it.  After that it's been pretty useful for me.

https://www.adventuregamestudio.co.uk/forums/index.php?topic=60044.0

Rik_Vargard

Hey thanks for the link, newwaveburritos, I checked it and right now it's above my level of understanding so I used a timer/region/position combo for now :p
I guess it's a lot more coding but it works.
I'll have to come back later and try it for the next room where I'll need it

Cheers! :)

SMF spam blocked by CleanTalk