Blocking Functions and Regions in AGS

This is a public forum, where you can find out everything you wanted to know about making games. Please don't use this forum as a place to recruit new members.

Moderators: adeyke, VampD3, eriqchang, Angelus3K

Post Reply
Message
Author
Klytos
Infamous Sheik of Australia
Posts: 1722
Joined: Tue Apr 22, 2003 3:43 pm
Location: Rockhampton Australia
Contact:

Blocking Functions and Regions in AGS

#1 Post by Klytos » Wed Mar 09, 2005 3:56 am

Is there a way to activate a region (by walking on it) while the character is in a blocking function?

Example : EGO does something which causes a MoveCharacterBlocking(); function to start. He walks across a region which should cause a NPC to appear. If he walks across it normally, (ie the player clicks the walk icon to move the character) it works fine. If the blocking function is used, it doesn't activate.

Radiant
Knight Status
Posts: 386
Joined: Fri Jan 30, 2004 9:44 pm
Location: Realm of Amber
Contact:

#2 Post by Radiant » Wed Mar 09, 2005 8:03 am

Technically yes. In repeatedly_execute_always, check which region the character is over. HOWEVER you cannot abort the blocking function like that, so instead of a blocking walk, you'd be better off doing something like

Code: Select all

MoveCharacter (someone, someposition);
while (character[someone].walking) {
  Wait (1);
   if (GetRegionAt (character[someone].x, character[someone].y) == 4) {
      // explosion occurs
      break;
   }
}

Post Reply