Forum Jump :

Author Message


Posts: 3
Rank:


Level: Member

Country: de
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2018-05-20 20:32        
     
Hey guys,

I'm trying to script an AI Helicopter to move to waypoints activated by a trigger. The goal is to get my clanmates readied up and into the helicopter before i tell the AI to fly us to the set waypoint (via action menu).

What I've done so far:

initServer.sqf:
//Set random variable to 0
missionNamespace setVariable ["Trigger_Con_1", 0, true];

init of the helicopter:
//Set trigger variable to 1 on action
this addaction ["Go!", {missionNamespace setVariable ["Trigger_Con_1", 1, true];}];

Placed a trigger close to waypoint:
Trigger Condition:
//Trigger_Con_1 > 0
missionNamespace getVariable ["Trigger_Con_1", 0] > 0

Then I connected the trigger to the "LAND" waypoint via right-click -> Connect -> Set Waypoint Activation


However, upon starting the mission, the helicopter takes off and starts flying towards the waypoint without me doing anything at all.
What am I missing here? Please help im about to go Hulk.

Thanks in advance.


Author Message


Posts: 1515
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2018-05-20 21:35        
     
Try placing another WP directly in front of the chopper and close to it, in the WP cond missionNamespace getVariable ["Trigger_Con_1", 0] > 0

I don't think there's any need for the mission variables and could be done a little simpler.
Just use a normal variable and instead of 0/1 just use true false
initServer.sqf:
unlockwp=false;

in the WP next to the chopper cond unlockwp
in the addaction
this addaction ["Go!", {unlockmp=true}];


Advertisement


Author Message


Posts: 3
Rank:


Level: Member

Country: de
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2018-05-21 10:08        
     
Okay i got it to work with the additional waypoint really close to the helicopter. Now i got the problem that he doesnt land but only hover really high over the waypoint even tho it is a "LAND" waypoint. Got any ideas how to fix that too?

Thanks btw! <3


Author Message


Posts: 1515
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2018-05-21 12:45        
     
Ah I had the same problem with the land WP, it's odd as it's been working fine in the past it looks like a bug has been introduced.

It doesn't really matter though just use a normal move wp and in the act put
vehicle this land "land"

you will also need another wp right next to it and lock that with another variable or triger so it doesn't fly off until your ready.


Author Message


Posts: 3
Rank:


Level: Member

Country: de
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2018-05-21 15:56        
     
Thanks a bunch! :)


Author Message


Posts: 1515
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#6 Posted at 2018-05-21 16:50        
     
Just to clear up the land_wp bug, it works fine for the chopper when it's already flying but it doesn't seem to work when the chopper starts on the ground.


Author Message


Posts: 8
Rank:


Level: Member

Country: ca
Location:
Occupation: Student
Age: 39
In-game name: 3lockad3

 
#7 Posted at 2018-06-09 20:13        
     
Another thing to add is, if they are going to be landing under fire, make sure the pilot is not grouped to the heli crew, and have the pilot on careless and do not fire, but make the heli crew aware, and set to open fire, and they will fire at the enemy while the chopper lands if your WPs are lined up right.

A lot of people do not think this is possible, but it is very possible if you tinker with it enough, just make sure there is no AA in the area, because they will fly over it and land as if it is not there..

Have fun..