Registered: 1379868906 Posts: 15
Reply with quote #1
I'm trying to implement a command in a script to reset the player's ship to the Y=0 plane. I can move them by setting the "PositionY" property, but I also want to be able to specify that they are not moving up or down. I've tried playing around with the "pitch" and "DeltaY" properties, but I can't get them to work. Could someone please share the code snippet I need? It's a 2.4 version script, if that makes any difference.
Registered: 1375817447 Posts: 1,038
Reply with quote #2
You could track whether y is greater than or less than the value you reset it to (so in this case it would be 'if y>0, set position y to 0'). You'd have to script it in two separate events, one for y>0 and one for y<0. Personally, I'd set it to > or < 10 to give a bit of leeway and avoid funny things happening in game.
By doing this, the script would force players to remain on the desired plane (+/-10), however wouldn't reset the climb or dive. The players must do that themselves I believe. A popup message to helm could act as a prompt. __________________ Fleet Captain Xavier Wise - TSN Sabre Link to TSN RP Community website
Registered: 1375273622 Posts: 2,115
Reply with quote #3
I'm pretty sire Xavier is right. Even if you force the pitch to zero, if the players have a control (like a joystick) set to climb or dive that control will immediately override your mission script. You would need to physically move their control.
__________________ "The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight." - Winston Churchill