OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: DarkTalent on 16 May 2003, 17:36:23
-
I've got no prob with getting the AI unit up to the lookout platform on the watchtower, but how do I get him to move to (for example) Pos #4 once up there.
If done in the waypoint, he move there before climbing the ladder and still halts at the top of the ladder.
I want to simulate the changing of the guard at a base, and the tower sentries are the only ones who I'm yet to "pretty up".
-
Place a waypoint over the building. Select position #4 in the waypoint screen.
Or is that what's going wrong?
-
Ya, I tried placing a Waypoint over the "House" object for the watchtower and selected the required position (in this case #4) and the following in the On Activation field:
this action["ladderup",nearestbuilding this]
But the AI Unit moves to the house position at groundlevel - teleports to the ladder, climbs up and halts on the platform at top.
This tower is at Fi17 on Malden, built into the island, not an user placed object.
I tried placing the waypoint close to the physical location of the ladder's base with the abovementioned line in the On Activation field. I then made a second waypoint on the house object and selected the house position, but I believe that there is not enough distance for the second waypoint to activate.
Is there a way to combine "SetPos" and "BuildingPos" commands to move the unit to the right spot when he gets to the top?
-
Yeah... sort of ;)
This is how you would move unit to a position relative to object:
unit setpos [(getpos object select 0) + X, (getpos object select 1) + Y, 8]
By changing the values of X and Y you can change where the unit is placed. Also, change the height the unit is moved to by changing the number at the end (in this case 8).
That method will take a lot of trial and error until you get your guy in the right spot, but that's one way of doing it ;)
-
Cheers ;)
I'll give it a try and report back. Quickly, just to confirm, numbers enteres in the X & Y bits are 1m increments?
By changing the values of X and Y you can change where the unit is placed. Also, change the height the unit is moved to by changing the number at the end (in this case 8).
-
Woo Hoo!
Ta muchly Sui. Works lovely.
Now for the cosmetics of timings and waypoint placement so the soldier actually starts the "ClimbLadderUp" at the ladder base instead of nearby.
The soldier is named "Lookout" and in the OnActivation field of the waypoint near the watchtower base is:
[LookOut,nearestBuilding this] exec "lookout.sqs"
lookout.sqs
_lookout = _this select 0
_build = _this select 1
_lookout action["ladderup",_build]
~13
_lookout setpos [(getpos _build select 0) - 1, (getpos _build select 1) - 1, 7]
~2
this setcombatmode "yellow"
this setbehaviour "alert"
Thank you