Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: actaria on Thu 13/04/2023 22:06:30

Title: [Solved] My dancer stop dancing when character talk to npc
Post by: actaria on Thu 13/04/2023 22:06:30
Hello,

I hope everyone is doing well.

I need your help because i am stuck on that one.

I have a bar with a pianist and a dancer:

(https://zupimages.net/up/23/15/46o9.jpg)

I use this code to make the dancer move everywhere on stage

 
Code (ags) Select
function room_AfterFadeIn()
{
SetTimer(15,250);
}


 
Code (ags) Select
function room_RepExec()
{
if (IsTimerExpired(15)) {
cdanseuse.Walk(Random(999), Random(999), eNoBlock, eWalkableAreas);
SetTimer(15,80 + Random(80));
}

It works well the problem i'd like to solve is that the character needs to talk to a NPC and when the dancer reach the end of timer she stops once the NPC is talking or opening a dialog.

How can i make the dancer to keep dancing even when the player is talking to someone ?

Thanks a lot for your precious help.
Title: Re: My dancer stop dancing when character talk to npc and when a dialog is opening
Post by: Matti on Thu 13/04/2023 22:24:38
You need to put the code inside repeatedly_execute_always.

https://adventuregamestudio.github.io/ags-manual/RepExec.html
Title: Re: My dancer stop dancing when character talk to npc and when a dialog is opening
Post by: actaria on Thu 13/04/2023 22:34:37
Thanks a lot for the answer i will have a look right now  ;-D

EDIT:
Perfectly working thank you didn"t know about the "always" thing
Title: Re: [Solved] My dancer stop dancing when character talk to npc
Post by: Crimson Wizard on Thu 13/04/2023 23:03:52
Quote from: actaria on Thu 13/04/2023 22:34:37Perfectly working thank you didn"t know about the "always" thing

There's some information about these, and explains the difference:
https://adventuregamestudio.github.io/ags-manual/RepExec.html
Title: Re: [Solved] My dancer stop dancing when character talk to npc
Post by: actaria on Sun 16/04/2023 05:21:17
Quote from: Crimson Wizard on Thu 13/04/2023 23:03:52
Quote from: actaria on Thu 13/04/2023 22:34:37Perfectly working thank you didn"t know about the "always" thing

There's some information about these, and explains the difference:
https://adventuregamestudio.github.io/ags-manual/RepExec.html

Thank you