Character disappering

Started by Cpt Ezz, Tue 06/05/2008 11:20:31

Previous topic - Next topic

Cpt Ezz

 
sorry i'm having heaps of problems
when i change rooms it shows the next room but my character is gone
here is my script is it wrong or is it something else?

// room script file

function room_LeaveTop()
{
player.ChangeRoom(2);
}

thankz Cpt Ezz

Creator

The room you're leaving from could be bigger than the room your entering, so the player could be teleporting off the screen (to a bigger coordinate than the room you're going too has). Try setting x and y coordinates to the script. EG:

Code: ags

// room script file

function room_LeaveTop()
{
player.ChangeRoom(2, x co-ord, y co-ord);
}

Cpt Ezz

Thankz very much for the help

twilitwrath

I'm having this problem, too, and setting specific coordinates hasn't helped. I made sure both rooms are the same size with edges set on the same coordinates, but my character doesn't appear when I walk to Room2. More than that, he doesn't appear when I set him to start in that room.

I thought maybe the background had moved in front of him somehow, but it's really more like he's not there at all. I know he'd be on a walkable area if I could see him, but I can't change rooms. I can interact with hotspots, still; don't know if that's important.

Khris

In Edit room, under Settings, check ShowPlayerCharacter.

Creator

#5
Also make sure there isn't an object in front of your player. Probably a useless suggestion, but I did this once (took me 3 hours to figure it out too :-[).

Never mind. Re-read your post. You can still interact with hotspots. Missed that part. If there was an object over him, the character would move out from behind. Sorry.

twilitwrath

Quote from: KhrisMUC on Sun 11/05/2008 12:38:33
In Edit room, under Settings, check ShowPlayerCharacter.

No such option. There is a ticky box for Hide Player Character, which is unchecked. And then a box that says Player Character View, which seems to want a value.

If it helps, I forgot to mention in my last post, I'm using version 2.72.

Khris

Ah, I thought you were using 3.

You could put this in after fadein:
Code: ags
  Display("X: %d, Y: %d, V: %d, T: %d", player.x, player.y, player.NormalView, player.Transparency);


What does it come up with?

twilitwrath

Returns an error, but that's probably my fault. Aside from this bit above

Quote from: Creator on Tue 06/05/2008 11:24:27

Code: ags

// room script file

function room_LeaveTop()
{
player.ChangeRoom(2, x co-ord, y co-ord);
}


I haven't gotten the hang of scripting at all.

So there's a newer version now? I downloaded 2.72, oh, months ago and am just getting around to trying it out. I'll download 3 and see if I have better luck.

Gilbert

If you copied the codes directly, the problem is that you can't write something like "x co-ord" or "y co-ord" in your script.

Try substituting them with numbers or proper variable names, like:

player.ChangeRoom(2, 50, 100);

Creator

#10
Quote from: KhrisMUC on Sun 11/05/2008 19:53:15
You could put this in after fadein:
Code: ags
  Display("X: %d, Y: %d, V: %d, T: %d", player.x, player.y, player.NormalView, player.Transparency);


@KhrisMUC: I think you mean %s, not %d or am I wrong?

@Twilitwrath: If you want to try Khris's method (to see where you player is) try this code in after fadein:

Code: ags

Display("X: %s, Y: %s, V: %s, T: %s", player.x, player.y, player.NormalView, player.Transparency);

Khris

The four values are integers, not strings. Therefore it's %d, not %s.

Creator

Yes. You are right. My apologies.

SMF spam blocked by CleanTalk