If player is on a walkable area

Started by magintz, Thu 04/03/2004 11:12:04

Previous topic - Next topic

magintz

Hi there, long time no post in here, but i'm having some problems, I need to run an IF statement asking if the player character is on walkable area 1 or 2 and depending on what walkable area the character is on depends on which object shows up, 1 or 0.

Object One should appear if the character is on area 1
Object Zero should appear if the character is on area 2

any help here?
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

TeeKay

If I remember right, there is a function like GetWalkableAreaAt... but I'm not sure. Anyhow, to get the player's position, use
character[GetPlayerCharacter()].x
character[GetPlayerCharacter()].y
global vars.

magintz

yes but doesnt that just find out the x and y co-ordinates? I need the whole of the walkable area
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

Timosity

#3
could you use regions instead, you can copy the walkable areas straight into regions in the editor (there's a button you click on [note: if you already have regions on this screen it will wipe them]).

then choose player walks onto region, and set the objects in the script there.

magintz

nm i sorted it, it was simple when i thought about it i just had to get the character location and match it with a walkable area, but I don't need it any more i just have to wait for some character art/animation before I can continue
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

Kweepa

#5
in repeatedlyexecute:

int walkArea = GetWalkableAreaAt(character[EGO].x, character[EGO].y);

ObjectOff(0);
ObjectOn(1);
if (walkArea == 1) ObjectOn(1);
else
if (walkArea == 2) ObjectOn(0);

[EDIT] Didn't see that last post...
Still waiting for Purity of the Surf II

SMF spam blocked by CleanTalk