Scripted player movement

Opulus
Hey,

I just want to script an "event" like falling down cause the floor breaks under the feet. So I have to move the player. My problem is, that when I look for an moving command I can only find commands to move objects to other objects or objects to the current room.

I think to do what I want I have to move the Object "player" to another room, or not?

jaynabonne
Yes. The player is an object like anything else. Use MoveObject to move it to the target room, or just set its "parent" attribute to the new room.

Opulus
Oh okay, thank you ^^

I tried it but I saw only the option move object to object or expression ^^
I din't see that the second object could be a room :D

Opulus
Well it didnt work...

msg ("Suddenly the Floor breakes under your feet and you fall down.")
MoveObject (Player, E2_Room 01)
DecreaseHealth (25)


But if I go in this room I will not move to another room. What did I wrong?

jaynabonne
I would need to see more to know what's going on. Any chance of attaching your game file or a small subset that shows the problem?

Pertex
where do you call this script? Does it show the msg? Try this move command:
MoveObject (game.pov, E2_Room 01)


and just an advice: don't use blanks in object or exit names

Opulus
Pertex wrote:where do you call this script? Does it show the msg? Try this move command:
MoveObject (game.pov, E2_Room 01)


and just an advice: don't use blanks in object or exit names


This worked! Yay, thanks!! ^^ But why? could you explain it to me, please? ^^

jaynabonne wrote:I would need to see more to know what's going on. Any chance of attaching your game file or a small subset that shows the problem?


It would be a problem If you don't understand german ^^ I only translate this small scripts in english but the original would looks like this in the game

msg ("<br/>Ihr betretet tiefere Höhlengänge die nach Norden führen.")
wait {
msg ("Ihr lauft zum Ausgang und hört plötzlich ein knacksen.<br/>")
wait {
msg ("Unter euren Füßen machen sich Risse auf und Ihr lauft vorsichtig weiter.<br/>")
wait {
msg ("Plötzlich bricht der Boden unter euch auf und Ihr fallt in noch tiefere Höhlengänge.")
DecreaseHealth (25)
wait {
MoveObject (game.pov, K2_Raum 01)
}
}
}
}


And it ist the whole file like this ^^ German object names and german messages ;)
Oh an this is the full script of the room

Pertex
Warum sollten wir deutsch nicht verstehen? Ich wenigstens habe keine Probleme damit :D Da sind übrigens einige Rechtschreibfehler in Deinen Messages :lol:

The problem is the capitalization. Player is not player
MoveObject (player, E2_Room 01) should work, too.

Opulus
Pertex wrote:Warum sollten wir deutsch nicht verstehen? Ich wenigstens habe keine Probleme damit :D Da sind übrigens einige Rechtschreibfehler in Deinen Messages :lol:


haha :D Ja ich weis ich arbeite ja in kapiteln, erst wird ein Kapitel fertiggestellt dann gehe ich nochmal über alle Texte drüber dann hole ich jemanden dazu der drüber geht ^^

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums