Jump to content
Sign in to follow this  
atomictim

A choice of waypoints?

Recommended Posts

I want to make a mission where the player lands in a base and can choose whether they play the mission as a sniper or a squad leader. I was going to triggger the choice by having 2 boxes, each witht he corresponding gear, and a script checks whether either of the weapons are gone, which triggers the corresponding waypoint. How can i code it so the users choice of weapon activates one waypoint path, but not the other?????

Share this post


Link to post
Share on other sites

Ok here is a simple solution, name the trigger where the sniper gear is "sniper" (without the quotes).

Then put this on the onAct field:

null = [this] execVM "SetWaypoint.sqf";

Save this is as SetWaypoint.sqf

// SetWaypoint.sqf
// Made by: 42nd|Bigshot

if (!isServer) exitWith {};

private ["_soldier", "_grp", "_wp", "_wp1"];

_soldier = (_this select 0);

_grp = group _soldier;

if (triggeractivated sniper) then {
_wp = _grp addwaypoint [(getMarkerPos "marker1") ,10];
} else {
_wp1 = _grp addwaypoint [(getMarkerPos "marker2") ,10];
};

Place a marker named "marker1" (without the quotes) where you want the soldier to move to if he is the Sniper, and put a marker down named "marker2" (without the quotes) where you want the soldier to move to if he is the SL.

Share this post


Link to post
Share on other sites

I would do it by checking the weapon the player has with hasWeapon or primaryweapon eg:

if ((primaryWeapon player) == "m16a4") then {hint "wep is m16";};

You can then add waypoints at pre-placed markers in the above braces.

or you can have the script running with a waitUntil eg:

waitUntil {(primaryWeapon player) == "m16a4"};
hint "wep is m16";

you can check the class name of your current primary with this in a radio trigger:

pw = (primaryWeapon player); hint format ["%1",pw];

Edited by PELHAM

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  

×