Jump to content
Sign in to follow this  
person915

Creating a Vehicle Via Trigger with a Preset Waypoint

Recommended Posts

I want to set a radio trigger up to create a flying chopper which I've done, but I also want the said chopper to follow a waypoint immediately after it is created. I need it to be created with the radio trigger because it could get shot down or fly away or SOMETHING, and I can't take away it's movement properties and make it invincible, because it NEEDS to get shot down at a certain point also, which I may or may not need help with "setdamage" scripts.

But the problem here is with the chopper. How do I create a chopper via trigger that follows preset waypoints? How would I even set the waypoints?

---------- Post added at 01:50 ---------- Previous post was at 01:04 ----------

Ok, instead of setting a waypoint, I feel it's more purposeful and intuative to have the created helicopter move to an acquired position of a named group. I have group1 = groupthis in the leader's init field, so if I wanted the created chopper to move to it, I would write "this move group1" in its init field, right? the thing is that the chopper isn't created yet, so I need to find a different sort of way to do this. Anything?

Edited by person915

Share this post


Link to post
Share on other sites

When you spawn the helo are you naming it?

/////////////////////////////////////////////////////////////////////////// 
//null=["start",west,"UH1Y",300,150,300,"plane_name"] execvm "Spawn_Helo.sqf"; 
/////////////////////////////////////////////////////////////////////////// 
/////////////////////////        parameters   /////////////////////////// 
_pos   = _this select 0;  // spawn position and direction of spawn 
_side  = _this select 1;  // side of unit east west guer civilian 
_type  = _this select 2;  // type of vehicle  
_height =_this select 3;  // starting height 
_speed = _this select 4;  // starting speed 
_altitude = _this select 5; // fly to given altitude 
_name  = _this select 6;    // [u]Name[/u] "HELO_name" you choose 

_dir = markerdir _pos;  
_grpempty = createCenter _side;// create center incase it doesn't exist 

_vehicle = [getmarkerPos _pos, _dir, _type, _side] call bis_fnc_spawnvehicle; 

_veh = _vehicle select 0;// vehicle 
_veh setVehicleVarName _name; 
call compile format["%1 = _veh", _name]; 

_vehgrp = _vehicle select 2 ;// group of vehicle 

_veh setpos (_veh modelToWorld [0,0,_height]);  
_vel = velocity _veh; 
_veh setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+ (cos _dir*_speed),(_vel select 2)]; 

_veh flyinHeight _altitude;

Once it is named you could always try placing a trigger with:

Helo1 domove getposATL leader group1

If its supposed to fly to the player just replace groupname with "player"

Edited by eegore

Share this post


Link to post
Share on other sites

that's a script file, is it not? Or is that just what I put inside the trigger? Seems heckalot more complex than I was looking for, but if that's what needs to be done....

Share this post


Link to post
Share on other sites

it should't be that difficult.

place a static gunner on the map and in the init put

wph=group this;deletevehicle this

You can now give him the waypoints you want to use for your chopper.

When the chopper spawns you need to add this to the on act if that's where your spawning it group heliname copyWaypoints wph

or like this if your using spawnvehicle

unit = [getPos thistrigger, 0, "UH1Y", west] call bis_fnc_spawnvehicle;group (unit select 0)  copyWaypoints wph

you may need a Functions Module on the map for this function to work.

Share this post


Link to post
Share on other sites

I don't know how to spawn a vehicle without using a script.

However you might look into:

allowdamage

You don't want the helo pre-placed in the editor because it could fly away or get shot down. I would just place helo allowdamage false and make sure its on the ground until it is called in.

Whatever you are using to activate the damage on the helo could also have: helo allowdamage false so its vulnerable again.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×