how do I change the walkable area view?

Started by YotamElal, Wed 02/03/2005 13:31:25

Previous topic - Next topic

YotamElal

how do I change the walkable area view?

When my character walks in the mud he wears shoes.
(ok till now)
later on the game he buys boots and he wears them when walking on the mud.
How do I change the walkablearea 1 view 11 to view 12??

Candle

Code: ags
SetCharacterView(EGO,12);
AnimateCharacter(EGO,0,0,0);
while(character[EGO].animating) Wait(1);
ReleaseCharacterView(EGO);


Ashen

I don't think that's what was wanted...

Do you mean that you have Walkable 1 set to change the character's view (e.g with
Change player view while on this area:), but you want it to change to a different view based on what the existing view is (i.e. if they're wearing boots or shoes)?

I don't think you can change the value in the 'Change player view while on this area:' box during the game (assuming that's what you're using). I think instead, you'd have to script it in rep_ex. You'll also need a variable to track what the character view should be (or use one of the Global Ints), and set it when you buy the new boots, so the engine knows what view to change back to.
I know what you're thinking ... Don't think that.

YotamElal

what rep_ex & how do I script this?

Ashen

The rep_ex (Repeatedly Execute) of the room the walkable area is in, NOT the global rep_ex, that would cause weirdness.

I think the code would be something like:
Code: ags

if (GetWalkableAreaAt (player.x - GetViewportX (), player.y - GetViewportY ()) == 1) {
  if (GetGlobalInt (5)-1 == player.view) { //
    if (GetGlobalInt (5) == SHOEVIEW) ChangeCharacterView (EGO, 11); // if they're in shoes, set to view 11
    else if (GetGlobalInt (5) == BOOTVIEW) ChangeCharacterView (EGO, 12); // or view 12 if in boots
    //(change SHOEVIEW and BOOTVIEW to the right numbers)
  }
}
else if ((GetWalkableAreaAt (player.x - GetViewportX (), player.y - GetViewportY ()) != 1) && (GetGlobalInt (5)-1 != player.view)) ChangeCharacterView (EGO, GetGlobalInt (5));
//else set the to default view


I know what you're thinking ... Don't think that.

YotamElal

THNX
But I didn't check the code..
Becuase I'm not going to do the thing I wanted to do in my game cuase it rases other complications...

SMF spam blocked by CleanTalk