Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Dooie

#1
I've started working with AGS a while ago, and so far I've been able to figure everything out by looking around on this forum and searching the tutorials. But now I have a little problem with a floor switch that I can't seem to solve, and I don't know where to look.

My room has a floor switch that stays pressed down as long as you stand on it, and releases when you walk off it. So I made a region above the floor tile with these interactions:

// script for Region 1: Player walks onto region

object[7].SetPosition(239, 113);                     // I'm using retro 8-bit graphics so thats why I used SetPosition
                                                                        // instead of SetView; the switch is basically a floor tile raised one pixel.
PlaySound(2);                                                 // Click!
dialog[0].SetOptionState(3, eOptionOn);       // A dialog option to ask an NPC to stand on the tile is also enabled.

// script for Region 1: Player walks off region
 
  object[7].SetPosition(240, 112);
  PlaySound(1);

(by the way, how do I place script text in a window when posting on this forum?)
So far so good. The button doesn't actually do anything else yet, but that's not the point (I'm still figuring out the basics of scripting). Now, when I talk to the NPC while standing on the button, the player character walks to the NPC before starting the dialog, and the button remains pressed down because player.Walk is blocking (otherwise my pal would start talking right away, right?). I found some info that might be related under the tutorial topic 'Understanding Blocking Functions', but I still don't quite understand. I think I have to put something in repeatedly_execute or repeatedly_execute_always but I'm not sure what. Thanks in advance!

I'm still using 2.72, by the way. Want to learn all the basics first before I do away entirely with the interaction editor.
SMF spam blocked by CleanTalk