Emulating regions on runtime [Solved]

Started by LUniqueDan, Mon 31/01/2011 03:55:33

Previous topic - Next topic

LUniqueDan

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
"I've... seen things you people wouldn't believe. Destroyed pigeon nests on the roof of the toolshed. I watched dead mice glitter in the dark, near the rain gutter trap.
All those moments... will be lost... in time, like tears... in... rain."

Khris

What's the endgame here? More info.

LUniqueDan

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();)
"I've... seen things you people wouldn't believe. Destroyed pigeon nests on the roof of the toolshed. I watched dead mice glitter in the dark, near the rain gutter trap.
All those moments... will be lost... in time, like tears... in... rain."

Khris

You could use invisible characters that walk around the room randomly and start battles if the player collides with them.

LUniqueDan

YEAH! Makes sense.
Thanx a lot Khris!
"I've... seen things you people wouldn't believe. Destroyed pigeon nests on the roof of the toolshed. I watched dead mice glitter in the dark, near the rain gutter trap.
All those moments... will be lost... in time, like tears... in... rain."

Dualnames

The character control module will prove quite useful for this and various npc's issues :D
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

zabnat

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.

SMF spam blocked by CleanTalk