Scripted player movement

Opulus
22 Jan 2014, 12:32
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
22 Jan 2014, 12:53
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
22 Jan 2014, 13:21
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
04 Feb 2014, 11:17
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
04 Feb 2014, 12:46
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
04 Feb 2014, 12:48
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
04 Feb 2014, 12:54
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
04 Feb 2014, 13:30
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
04 Feb 2014, 13:47
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 ^^