Scripting trouble

Started by Bartimaeus, Sun 04/09/2005 15:29:37

Previous topic - Next topic

Bartimaeus

Okay here's the end of a  script for an interaction with a door.
It all works but there's just one problem.

AnimateObjectEx(3,0,50,0,0,eForwards);
  player.x=38;
  player.y=157;
  SetCharacterView(PETER,3);player.loop=0;
  DisplaySpeech(PETER, "How... Unpleasant.");
  AnimateObjectEx(3,1,50,0,0,eForwards);


Right... the player has just done what he needs to do behind the door (Its a cutscene) and the AnimateObjectEx is the door opening for him to come out. Now underneath that I have the player's position and the the view I want it to set for him (his normal, visible, view). The problem is that this isn't happening.
The door closes and the speech is displayed where the player should be but you can't see him.

I used the SetCharacterView earlier for when he enters - it gives him a transparent view - and that works fine, so I don't really know what's wrong.

Help please,

~Billy
~The more adventures I go on, the more sand I get in my shoes

Khris

I'm not sure why it doesn't work, but you could set SetCharacterTransparency (or player.Transparency) to 100 to make him invisible, that way you wouldn't have to change the player's view.

Bartimaeus

Okay I changed it to the Transparency (which is so much more convenient) but it sill didn't work, but then I took a closer look.
When the dialog was displayed it was fractionally lower down than before he went in.
I took the y variable up one (which ultimately lowers the character) and it worked!
The walkable area is only a few lines wide so thats why its so tight but it's still weird coz i just used the same variables as before.
For some reason my character got bumped up inbetween.

Oh well, problem solved.
Thanks,

~Billy  ;D
~The more adventures I go on, the more sand I get in my shoes

Ashen

Is it possible there was a problem with the baselines, so the character was being drawn BEHIND the closed door?

I realise it doesn't matter since you've fixed it, I'm just curious.
I know what you're thinking ... Don't think that.

Bartimaeus

Well you see the game is 2D, so the player walks on almost a platform.
The walkable area is only about 2 lines thick - which it shouldn't really be.
I thought about it being a baseline problem, but I couldn't seem to move the character either so I ruled that out.

If it was a baseline problem then he would have just walked out from behind the object.

Im pretty sure it was some kind of funky walkable area problem.

;D
~The more adventures I go on, the more sand I get in my shoes

Gilbert

A walkable area of 2 lines width is probably too narrow for it to function properly, try widen it and see if that helps.

SMF spam blocked by CleanTalk