Home   Help Search Login Register  

Author Topic: Commandeer This! (or that!)  (Read 538 times)

0 Members and 1 Guest are viewing this topic.

MANVIN

  • Guest
Commandeer This! (or that!)
« on: 07 May 2003, 01:46:49 »
I was fiddling around again with the editor, and had an idea.
What if I wanted to order the AI to commandeer the nearest vehicle?

I went ahead and tried scripting it, and it turned out rather odd, actually.
Here's the script:
Code: [Select]
tempobj=nearestobject [getpos a,"LAND"]
[a] ordergetin true
a assignasdriver tempobj

a, at this point, is a single AI soldier that is NOT in the player's group. The nearest object is a jeep placed in the editor
This trigger is called by a radio command (Radio Alpha).

According the OFP ComRef file, CfgVehicles, "LAND" is any ground vehicle. When this is tried, it does NOT work..

Now, if you modify the script as follows, it works.

Code: [Select]
tempobj=nearestobject [getpos a,"jeep"]
[a] ordergetin true
a assignasdriver tempobj

Is it possible to use the Nearestobject command to order units to board the nearest vehicle of ANY type?

(If you want an example mission, I can post it)

MANVIN

  • Guest
Re:Commandeer This! (or that!)
« Reply #1 on: 07 May 2003, 02:00:35 »
Okay, I feel stupid replying to my own post BUT....

I found another complication with this idea..
If I use the following script:

Code: [Select]
tempobj=nearestobject [getpos leader a,"UH60MG"]
units a ordergetin true
"_x assignascargo tempobj" foreach units a

I can get group of soldiers (a), to mount in the cargo of any UH60-MG nearby, piloted or unpiloted.

EXCEPT

If the UH60-MG is over a certain distance away, they won't get in...

I'm assuming 'nearestobject' has a distance limitation, but is there no way to extend it, or get around it somehow? From what I've seen, the distance limit is fairly close. Almost under 50 meters!
« Last Edit: 07 May 2003, 02:29:43 by MANVIN »

BraTTy

  • Guest
Re:Commandeer This! (or that!)
« Reply #2 on: 08 May 2003, 05:10:59 »
Nearestobject only recognizes distinct classnames (1.91 can use typeof)
And it only reaches so far (25 or 50 m)
You can have it seek all and such,but could get you anything that way