Home   Help Search Login Register  

Author Topic: Waypoing on activation/condition via script AND Heli commands  (Read 2897 times)

0 Members and 1 Guest are viewing this topic.

Offline Mad Pup

  • One Who Asks A Lot.
  • Members
  • *
  • OFPEC Is Awesome
Hi there, glad to see the site is back up. You guys had me worried.

I was wondering if theres a script command to set the On Activation of a waypoint as well as the Condition of a waypoint, via scripts.

Also, I've download official command references from the eidtors depot, but for some stupid reason I can't open the html files. So I was wondering if somebody out there could post a sample script to get the following:

An AI helicopter to take off, move to a certain place on the map (a trigger) land, and wait with the engines on, then take off again. All via script. No waypoints in the editor because there are multiple areas where the heli could go, and the location is chosen at random.  :D

Thanks in advance!

~Mad Pup  :good:
"The object of war is not to die for your country, but to make the other poor bastard die for his" - General Patton
[SH]MadPup
[SH]Squad

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Quote
I've download official command references from the eidtors depot
Unfortuntely that is not going to be much of help as it only contains the original OFP-OFP:Resistance commands, there's hundreds more in Arma2 so your best bet is to use the COMREF here.

Quote
I was wondering if theres a script command to set the On Activation of a waypoint as well as the Condition of a waypoint, via scripts.
I thought there was but couldn't find just now so maybe there aren't (which is weird because for everything else there is).
Anyway, using waypoints to control events in a missions is very bad design because waypoints may never get activated for some reason or another (this info is directly from the game devs btw so not something I cooked up :P ).

Other problem is that in A2 the AI choppers are extremely picky where they want to land so they may never land even near where you want them to, and they prefer to land on the 'helipads'.


Anyway, this can be done without any waypoint scripting involved, how it's done exactly depends on whether the destination trigger is created dynamically or pre-set triggers are selected randomly. And does the trigger do something specific or is it just a position.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mad Pup

  • One Who Asks A Lot.
  • Members
  • *
  • OFPEC Is Awesome
Quote
does the trigger do something specific or is it just a position.
It's simply a position. It doesn't do anything.

Quote
depends on whether the destination trigger is created dynamically or pre-set triggers are selected randomly.
and I have no clue what this means haha. I'm just getting back into editing, and it's been years since I have with OFP. I've forgotten all my terms I used to know.

Quote
they prefer to land on the 'helipads'.
Could I throw down an invisible helipad to help? Or would that do nothing...

Thank h- for the quick response.

~Mad Pup
"The object of war is not to die for your country, but to make the other poor bastard die for his" - General Patton
[SH]MadPup
[SH]Squad

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
With dynamically created triggers I meant if you create them with a script while the mission is running, with pre-setting if you put them on the map while making the mission.
Probably not the clearest way of putting it, ah well..  :whistle:

Anyway, since they're for position only I already have a script that might help you in creating yours, I'm just in the middle of getting my PC up and running again after changing the main hard drive on it so may take some time to provide it to you though..

Invisible H might help, especially if the ground is not very flat but if they don't like the terrain they don't land so it's just a matter of trial and error until the sweet spot is found.
Not that they're atrocious at it, just that it's something you need to be aware of when making missions.
« Last Edit: 11 Sep 2014, 15:37:06 by h- »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mad Pup

  • One Who Asks A Lot.
  • Members
  • *
  • OFPEC Is Awesome
Quote
so may take some time to provide it to you though..
Ah well, no rush. I'm a full time college student, so I don't expect this mission to just happen overnight haha.

Quote
if you create them with a script while the mission is running,
:blink: You can create a trigger with a script? I'm very amateur, I'm sorry haha. Just glad to finally have a PC capable of running A2.

Thanks h-

~Mad Pup
"The object of war is not to die for your country, but to make the other poor bastard die for his" - General Patton
[SH]MadPup
[SH]Squad

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
OK, attached a small sample mission where a chopper flies back and forth between start position and randomly selected triggers. Unpack it in your Mydocs->ArmA 2-> missions and open it in the editor.

Mind you that his is done for Arma2:CO (both Arma2 and Arma2:OA installed) so if you're using just original Arma2 this mission won't work because it uses a terrain available in OA only.. It's for the Desert map.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mad Pup

  • One Who Asks A Lot.
  • Members
  • *
  • OFPEC Is Awesome
Thanks for the help! That problem has been solved, and I'm progressing in the mission.  :)

However, I've run into another problem.
I'm using the createVehicle command. I'm creating a "HMMWV_M1035_DES_EP1" in a script. I would like this Hmmwv to be teleported, via script, using the "setpos getpos trig1" command? Since it has no name, I'm not quite sure how to do this.

Thanks in advance

~Mad Pup
"The object of war is not to die for your country, but to make the other poor bastard die for his" - General Patton
[SH]MadPup
[SH]Squad

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
It depends on how you create it in the script.

You can 'assign' a name to the car when creating it:
mycar = "HMMWV_M1035_DES_EP1" createVehicle pos;
Then when you want it teleported just do:
mycar setPos (getPos trig1);
That way the car can be referenced using global variable mycar, which is the same thing as giving it a name in the editor.

If you're creating multiple vehicles of the same type the naming stuff get's a bit more complicated.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.