Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: LUniqueDan on Mon 31/01/2011 03:55:33

Title: Emulating regions on runtime [Solved]
Post by: LUniqueDan on Mon 31/01/2011 03:55:33
What's the easiest way to randomly set positions of regions during runtime?

I'm sure I can emulate regions by

1- Randomly generating  {x1-x1+30,y1-y1-30} squares at room load 
2- Be sure it's mostly into walkable areas
3 - Then checking if the Player x,y position  in Repeatly_execute (or Rep_ex_always) is walking in those position.

But I'm lazy by nature, any insight on an easiest way to do the same effect?
Tx
Dan
Title: Re: Emulating regions on runtime
Post by: Khris on Mon 31/01/2011 05:57:28
What's the endgame here? More info.
Title: Re: Emulating regions on runtime
Post by: LUniqueDan on Wed 02/02/2011 05:16:52
I wanna create RPG-Style random encounters. All I want is that the position of regions resets and get randomized everytime the player get in the room.

Because I don't want the monsters to always wait near the same spots.

When the player Walks unto region it launches a function (Namely : START_COMBAT();)
Title: Re: Emulating regions on runtime
Post by: Khris on Wed 02/02/2011 05:18:54
You could use invisible characters that walk around the room randomly and start battles if the player collides with them.
Title: Re: Emulating regions on runtime
Post by: LUniqueDan on Wed 02/02/2011 08:26:54
YEAH! Makes sense.
Thanx a lot Khris!
Title: Re: Emulating regions on runtime [Solved]
Post by: Dualnames on Wed 02/02/2011 08:37:25
The character control module will prove quite useful for this and various npc's issues :D
Title: Re: Emulating regions on runtime [Solved]
Post by: zabnat on Wed 02/02/2011 10:59:34
I did this by simply using a timer on regions that random encounters are possible. When player enters a region timer is started with a random timeout and when timer has finished combat starts.