OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Hauk on 16 May 2004, 13:13:07
-
Hey all,
I have a similar post to this in the Editing/Scripting:General section but haven't got a reply in days so I thought I'd post it here.
I tested the following code on Desert Island and it worked fine but when I went to test it on Malden the chopper refused to come to my position and just hovered around one of the game logics.
The game logic "setmove" is a position for the chopper to begin his descent down to me without crashing into buildings or getting caught up in trees.
Please post any info that you think might be useful as it would be much appreciated.
_chopper = _this select 0
_paradrop = 1
_marker2 = 2
_player = 3
_marker3 = 4
_marker4 = 5
_setmove = 6
chopper move getPos marker2
@(unitready chopper)
#loop
chopper move getPos marker3
? (playerhasrequestedairlift) : goto "Evac"
@marker3 distance chopper < 90
chopper move getPos marker4
? (playerhasrequestedairlift) : goto "Evac"
@marker4 distance chopper < 90
chopper move getPos paradrop
? (playerhasrequestedairlift) : goto "Evac"
@paradrop distance chopper < 90
chopper move getPos marker2
? (playerhasrequestedairlift) : goto "Evac"
@marker2 distance chopper < 90
goto "loop"
#Evac
player sideChat "HOTEL ONE, DOURDAN IS CLEAR. REQUESTING AIRLIFT, OVER."
~3
chopper sideChat "ROGER THAT ALPHA. HOTEL INBOUND. ETA 10 SECONDS"
~3
chopper move getPos setmove
@setmove distance chopper < 90
chopper setSpeedMode "LIMITED"
chopper move getpos player
chopper flyInHeight 20
~15
chopper flyInHeight 15
~6
chopper flyInHeight 10
~4
chopper flyInHeight 5
~6
chopper flyInHeight 0.2
@ (player in chopper)
chopper flyInHeight 20
~3
chopper flyInHeight 40
~3
chopper flyInHeight 45
chopper setSpeedMode "FULL"
chopper move getPos marker
exit
Thnx,
Hauk
-
Is everything exactly the same on desert island and on malden (including script, game logics positions...) ?
-
yep, checked and double checked twice :o
-
Try changing @makerX distance chopper < 90 to something like 100 or higher... I don't think it'll work, but try it anyway.
-
Works for me just fine...
You need to make sure that you are on a relatively flat, treeless ground (bushes don't matter so much) when the chopper starts to get close on you (when it get's your coords)...
I also took a liberty of modifying your code to work a bit faster and so on...
_chopper = _this select 0
_chopper move getPos marker2
@unitready _chopper
#loop
_chopper move getPos marker3
? (playerhasrequestedairlift) : goto "Evac"
@marker3 distance _chopper < 90
_chopper move getPos marker4
? (playerhasrequestedairlift) : goto "Evac"
@marker4 distance _chopper < 90
_chopper move getPos paradrop
? (playerhasrequestedairlift) : goto "Evac"
@paradrop distance _chopper < 90
_chopper move getPos marker2
? (playerhasrequestedairlift) : goto "Evac"
@marker2 distance _chopper < 90
goto "loop"
#Evac
player sideChat "HOTEL ONE, DOURDAN IS CLEAR. REQUESTING AIRLIFT, OVER."
~3
_chopper sideChat "ROGER THAT ALPHA. HOTEL INBOUND. ETA 10 SECONDS"
~3
_chopper move getPos setmove
@setmove distance _chopper < 90
_chopper setSpeedMode "LIMITED"
_chopper move getpos player
@unitready _chopper
_chopper land "GET IN"
@player in _chopper
_chopper setSpeedMode "FULL"
_chopper move getPos marker
exit
There's no need to use the helicopters name chopper as you execute the script by passing the chopper (global variable) in it as _chopper (local variable).
The _chopper land "GET IN" makes the same as you did by flyInHeights, but works more smoothly and faster... (you don't wanna hang around too long in hostile areas ;) )
No guarantees on any syntaxes, I easily make mistakes ;D :P
-
That's weird. I'm standing just off the road from dourdan that goes into the mountains (goes off the main road) and the setmove is among trees if that makes any differance. But I'm in open ground and there are no obstacles.
???
I'll give the modification a shot. ;D
Thnx,
Hauk