Restrict player's movement

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Matokage
Slime Knight
Posts: 275
Joined: Sat May 26, 2012 11:48 pm
Contact:

Restrict player's movement

Post by Matokage »

Is it possible to restrict the player to walk to certain zones or A B tiles with out the help of vehicles?
"I can't buy food with glory"
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6462
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

walls
User avatar
BMR
Metal King Slime
Posts: 3310
Joined: Mon Feb 27, 2012 2:46 pm
Location: The Philippines
Contact:

Post by BMR »

Yeah, walls seems the easiest way. Unless you want NPCs to be able to walk through those areas without restriction?
Being from the third world, I reserve the right to speak in the third person.

Using Editor version wip 20170527 gfx_sdl+fb music_sdl
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Zones? For the player? That's a good idea.

Here's another trick you could use: put the player in control of an NPC which looks like the hero, using this script:
https://rpg.hamsterrepublic.com/ohrrpgc ... arrow_keys
User avatar
Matokage
Slime Knight
Posts: 275
Joined: Sat May 26, 2012 11:48 pm
Contact:

Post by Matokage »

Spoonweaver wrote:walls
Really? I would never tought about it!
But, really I expected someone comming up with the obvious since I didn't restricted my question
BMR wrote:Yeah, walls seems the easiest way. Unless you want NPCs to be able to walk through those areas without restriction?
Not quite that. I want the player to be able to walk certain parts of the map under certain conditions. Something more dynamic than walls.
TMC wrote:Zones? For the player? That's a good idea.
Here's another trick you could use: put the player in control of an NPC which looks like the hero, using this script:
https://rpg.hamsterrepublic.com/ohrrpgc ... arrow_keys
tell you are going to implement this!
Yeah, I thougt something like that, but I'm not sure if the script will bypass zones limitations and acidentally everything. Gonna make a test anyways, Thanks.
"I can't buy food with glory"
User avatar
pjbebi
Slime Knight
Posts: 112
Joined: Mon Jul 31, 2017 7:22 am
Location: Florida
Contact:

Post by pjbebi »

I would make a zone that borders a zone yet to be unlocked. then for each step run a script like this

Code: Select all

variable (hx,hy)
hx := hero x (me)
hy := hero y (me)
	if (read zone (12,hx,hy), and, check tag(tag:zoneunlocked)) then (suspend hero walls)
	if (read zone (13,hx,hy)) then (resume hero walls)
then I would have zone 12 overlap a wall where you want to walk through.
Post Reply