Quote from: Khris on Tue 29/07/2014 18:56:43
I must have been really tired when I posted this. NPCs don't trigger Region events, and that's the reason the cat won't walk. If they did though, you would have to use "walks onto" as opposed to "while standing on".
What you have to do instead is use timers; you check for the region at the cat's feet, then send him to the next region and set the timer again. This will prevent the command from getting called repeatedly:Code: ags function room_RepExec() { Region *r = Region.GetAtRoomXY(Kater.x, Kater.y); if (Kater.Room == player.Room) { if (IsTimerExpired(1)) { if (r.ID == 1) { Kater.Walk(...); // send to next region SetTimer(1, 200); // prevent the above command from running again immediately } ... } } }
You can start this by placing Kater on a region and calling SetTimer(1, 1) in after fadein.
Regarding scripting: neither AGS nor the manual is supposed to teach you how to program. I understand that it can be quite a challenge to use AGS as someone who has never programmed before, but you are creating adventure games, not paper airplanes.
Thank you!
(and cassie and the one with the Book! too)
Edit:
"Juhuuuuu" xD It Worked!
function fclose_Interact()
{
Region *Feedi = Region.GetAtRoomXY(Kater.x, Kater.y);
if (Feedi.ID == 1)
{
cEgo.Walk(400, 386, eBlock);
fclose.Visible=false;
fopen.Visible=true;
Kater.Walk(485, 248, eBlock);
Kater.ChangeView(7);
Kater.Move(331, 164, eBlock, eAnywhere);
Kater.ChangeView(9);
Kater.Move(316, 216, eBlock, eAnywhere);
Kater.ChangeView(8);
}
else
{
cEgo.Walk(400, 386, eBlock);
fclose.Visible=false;
fopen.Visible=true;
}
}