Jump to content
Sign in to follow this  
Devil Dogs SF

Add Action and script help

Recommended Posts

I'm wanting to add addaction to an object, most likely a UAV Terminal, which says "Call for ChDKZ Chopper Support" the player saying over the radio (sidechat, dialogue...What ever is most efficient) "The enemy has overrun our positions, engage anything that moves, out!"

A Hind piloted by ChDKZ will spawn and engage anyone, including their own ChDKZ forces and yourself.

Is this possible at all, because I've not the slightest idea how to implement. :(

Share this post


Link to post
Share on other sites

The addAction would just run a script, the script would do everything else.

this addAction["Text for menu","scriptToRun.sqf"];

Share this post


Link to post
Share on other sites

This will spawn a HIND with CDF pilots.

CAS.sqf

_WestHQ = createCenter West;
_GrpCAS = CreateGroup West;
_PAPABEAR = [West,"HQ"];

_veh1 = createVehicle ["Mi24_D", [(getpos player) select 0,(getpos player) select 1, 0], [], 800, "FLY"];
_Pilot1 = _GrpCAS createUnit ["CDF_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
_pilot1 moveInDriver _veh1;
_Pilot1g = _GrpCAS createUnit ["CDF_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"];
_pilot1g moveInGunner _veh1;
_veh1 FlyInHeight 50;

{_x setSkill 1; _x setrank "CAPTAIN"} foreach units _GrpCAS;

sleep 1;

[_pilot1, _pilot2] joinSilent switch;

_GrpCAS = group switch;

_GrpCAS selectLeader _Pilot1;

deletevehicle switch;

sleep 1;

_wp1 = _GrpCAS addwaypoint [position player, 0];
_wp1 setwaypointtype "SAD";
_wp1 setWaypointCompletionRadius 100;
_wp1 setWaypointSpeed "FULL";
_wp1 setWaypointBehaviour "COMBAT";

_PAPABEAR SideChat "The enemy has overrun our positions, engage anything that moves, out!";

Place the addaction below into your UAV Terminal, "CAS" stands for close air support.

this addAction["Call for ChDKZ Chopper Support","CAS.sqf"];

Hope this helps!:D

Edited by cobra4v320

Share this post


Link to post
Share on other sites

player sideChat "The enemy has overrun our positions, engage anything that moves, out!";

Spawn the helo with:

_spawn = [getMarkerPos "helospawn", random(359), "Mi24_D", WEST] call BIS_fnc_spawnVehicle;

Make sure you have the Functions Module on the map.

As for getting them to attack friendlies... not something I can help with. :)

[/code]

Share this post


Link to post
Share on other sites

As for getting them to attack friendlies... not something I can help with. :)

What about "joinsilent" on the enemy side, then possibly deleting the unit they joined? Added to my script above.

Also is ChDKZ CDF???

Edited by cobra4v320

Share this post


Link to post
Share on other sites

Thank you so much for this, I appreciate it.

Also the ChDKZ are the Chedaki Insurgents.

Share this post


Link to post
Share on other sites
Also the ChDKZ are the Chedaki Insurgents.

Oops! The unit I used above was CDF. heh

Share this post


Link to post
Share on other sites

Don't think so, since the method I used uses SpawnVehicle which puts the proper side people in the vehicle regardless of what SIDE you put. In another example I was accidentally using GUE forces instead of EAST and they kept getting killed and I was sooo confused!

Cobra's example would work since you're specifying the type of crew for the vehicle.

Share this post


Link to post
Share on other sites

Cobra's example use CDF as well. Check stickies for class names.

Share this post


Link to post
Share on other sites

I replaced

CDF_Soldier_Pilot

With:

GUE_Soldier_Pilot

In the CAS.sqf, since GUE are hostile to all, is that pretty much all to change?

Share this post


Link to post
Share on other sites

The important thing is the 'createGroup'. But change all references to 'west'.

Share this post


Link to post
Share on other sites

One more question, how do I make it so you can only call it one time? Right now you can call it as many times as you want.

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  

×