Home   Help Search Login Register  

Author Topic: Watchtower "BuildingPos" - Unit related probs...  (Read 1240 times)

0 Members and 1 Guest are viewing this topic.

DarkTalent

  • Guest
Watchtower "BuildingPos" - Unit related probs...
« 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".

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Watchtower "BuildingPos" - Unit related probs...
« Reply #1 on: 16 May 2003, 18:00:20 »
Place a waypoint over the building.   Select position #4 in the waypoint screen.

Or is that what's going wrong?
Plenty of reviewed ArmA missions for you to play

DarkTalent

  • Guest
Re:Watchtower "BuildingPos" - Unit related probs...
« Reply #2 on: 17 May 2003, 13:35:19 »
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?

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Watchtower "BuildingPos" - Unit related probs...
« Reply #3 on: 19 May 2003, 02:44:15 »
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 ;)

DarkTalent

  • Guest
Re:Watchtower "BuildingPos" - Unit related probs...
« Reply #4 on: 19 May 2003, 03:52:14 »
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).
« Last Edit: 19 May 2003, 04:05:32 by DarkTalent »

DarkTalent

  • Guest
Re:Watchtower "BuildingPos" - Unit related probs...
« Reply #5 on: 19 May 2003, 05:16:52 »
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"
Quote
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