OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: LimeCordial on 25 Aug 2002, 20:51:12
-
i have a mission where the player can call for renforcements to his squad if he thinks he needs it.......but they are going to be paradropped. there isnt a problem in that itself, but because the player could be anywhere when he calls for them, i want the helo to move to where he is THEN drop them. i have the waypoints for the helo and there is a move waypoint near the operation area, in which on the on activ i have written 'ch doMove getpos p'.
ch is the name of the helo and p the player.
i want the helo to move to the player like i have written, but i dont want him to drop the troops until he is there. can i doo that? ??? :-\
-
in your script put this
ch doMove getpos p
@unitready ch
then all the eject stuff goes here
you might want to try distance instead of unitready
@ch distance p <150
-
so in the move waypoint i put
[ch, rein1] exec "eject.sqs"
then in eject.sqs i have that in front of the eject lines?
-
so in the move waypoint i put
[ch, rein1] exec "eject.sqs"
No;
If you want to use the domove, then forget about
the waypoint.
Ch moves to the position of unit p
This could be far away from the waypoint (at least far
enough, so that Ch never passes the waypoint).
So the activation field of this waypoint will never become
active.
Black_Feather already gave you the point, where you can
exec your script:
#ejectloop
@ch distance p <150: goto "ejectsequenze"
~1
goto "ejectloop"
#ejectsequenze
[ch, rein1] exec "eject.sqs"
:edit
P.S: another way, would be:
Once the player calls for the reinforcement, forget about
the domove command, and use setpos/getpos to place
the waypoint, where Ch should move to (and drops them off)
on the position of p
:note - don't forget to setpos/getpos the waypoint, before
the chopper starts moving, otherwise the ai could get
confused because of a changing waypoint, during heading
onto it.
By using this method, you wouldn't need a script (except
the paradrop script)
~S~ CD
-
in your script put this
ch doMove getpos p
@unitready ch
then all the eject stuff goes here
you might want to try distance instead of unitready
@ch distance p <150
no, you see, he told me to put the do move part in the script.
and you can't name waypoints.
-
in your script put this
ch doMove getpos p
@unitready ch
then all the eject stuff goes here
you might want to try distance instead of unitready
@ch distance p <150
no, you see, he told me to put the do move part in the script.
1) - can't you see, what he wrote in there?
@unitready ch
then all the eject stuff goes here
This means, you should put your exec paradropscript
there.
no, you see, he told me to put the do move part in the script.
He didn't tell/recomend you to use it in a script, he only
answered your question.
and you can't name waypoints.
And what do you think, is this for?
taken from the official comref (BIS)
getWPPos waypoint
Operand types:
waypoint: Array
Type of returned value:
Array
Compatibility:
Version 1.21 required.
Description:
Get waypoint position. Waypoint format is Waypoint .
Example:
getWPPos [groupOne, 1]
I gave you 2 different solutions above;
1 with using all that stuff in a script,
2 with using no script (except the paradrop script)
~S~ CD
-
Heh, well, you can actually use your original idea with the activation line in the waypoint: just move the waypoint itself!
[groupName, #]setWPPos getpos aP
groupName = name of the group the waypoint belongs to, just make it group HelpHeli for easy use. # = number of waypoint being moved, 0 is the "invisible" waypoint created on your units location, 1 is the first waypoint you place etc. So just figure that one out.
getpos aP= just a simple getpossing of aP, and suddenly, nr # waypoint for group groupName is right on top of aP ;-D
Good luck! :thumbsup:
Wolfrug out.
-
ive got
grouphelpheli, [2]setWPPos getpos p
in the on activ of the trigger, but just get an error when i activate the trigger.
name of player is p, and i called the heli grouphelpheli.
-
Well LimeCordial, this one is working for sure (just been
testing it):
[groupheli1, 2] setWPPos [(getpos p select 0), (getpos p select 1), (getpos p select 2)]
:note - waypoint nr. 2 must really be the second waypoint
of groupheli1. Counting of waypoints doesn't start at zero
in this case.
~S~ CD