Jump to content
copper2010

Shoreline (Mission concept and editing questions [lots of them])

Recommended Posts

@[EVO] Dan That'll be great, for I'm still unable to get the MHQ script to work, I can spawn the vehicle, but everytime I respawn it doesn't respawn me at the vehicle, it respawns me at base.

Share this post


Link to post
Share on other sites

Try this:

private ["_marker", "_veh"]; 
while {true} do { 
   if (alive _veh) then { 
       _marker = createMarker ["respawn_west", position _veh]; 
       "respawn_west" setMarkerPos position _veh;
       hint format ["%1",  getPosATL _veh];
   }; 
   if (!alive _veh) exitWith { 
       "respawn_west" setMarkerPos getMarkerPos "respawn_base"; 
   }; 
   sleep 0.5; 
};

And tell me what it returns in the hint.

Also, do you have a respawn_west marker already on the map? If you do, don't try create another one in this script because you will confuse the poor thing. Use something like respawn_west1, as that should work. The game should then pick it up.

Edited by [EVO] Dan

Share this post


Link to post
Share on other sites

@[EVO] Dan the MHQ script still isn't working, and I'm not getting any hints in return. This is getting kind of frustrating, is it not working because the player needs to have an action to set their respawn at the mhq?

Share this post


Link to post
Share on other sites

So the hint isn't showing up for you? Is it giving you an error related to the code in your rpt file?

Share this post


Link to post
Share on other sites

@[EVO] Dan Sorry for the late response, but this is what is showing up in my rpt file:

File C:\Users\Jacob Schmidt\Documents\Arma 3 - Other Profiles\Reaper\mpmissions\test.Stratis\scripts\mhqRespawn.sqf, line 4

control[DebugConsole]: Unexpected control type [15]

control[DebugConsole]: Unexpected control type [15]

control[Feedback]: Unexpected control type [9]

control[Feedback]: Unexpected control type [9]

control[MessageBox]: Unexpected control type [15]

control[MessageBox]: Unexpected control type [15]

Error in expression < "_veh"];

while {true} do {

if (alive _veh) then {

_marker = createMarker ["r>

Error position: <_veh) then {

_marker = createMarker ["r>

Error Undefined variable in expression: _veh

File C:\Users\Jacob Schmidt\Documents\Arma 3 - Other Profiles\Reaper\mpmissions\test.Stratis\scripts\mhqRespawn.sqf, line 4

Error in expression < "_veh"];

while {true} do {

if (alive _veh) then {

_marker = createMarker ["r>

Error position: <_veh) then {

_marker = createMarker ["r>

Error Undefined variable in expression: _veh

File C:\Users\Jacob Schmidt\Documents\Arma 3 - Other Profiles\Reaper\mpmissions\test.Stratis\scripts\mhqRespawn.sqf, line 4

Error in expression < "_veh"];

while {true} do {

if (alive _veh) then {

_marker = createMarker ["r>

Error position: <_veh) then {

_marker = createMarker ["r>

Error Undefined variable in expression: _veh

File C:\Users\Jacob Schmidt\Documents\Arma 3 - Other Profiles\Reaper\mpmissions\test.Stratis\scripts\mhqRespawn.sqf, line 4

Share this post


Link to post
Share on other sites

Its not getting _veh passed to it as an argument is the problem. Try this:

private ["_marker", "_veh"];
_veh = _this select 0; 
while {true} do { 
   if (alive _veh) then { 
       _marker = createMarker ["respawn_west", position _veh]; 
       "respawn_west" setMarkerPos position _veh;
       hint format ["%1",  getPosATL _veh];
   }; 
   if (!alive _veh) exitWith { 
       "respawn_west" setMarkerPos getMarkerPos "respawn_base"; 
   }; 
   sleep 0.5; 
};

And see what happens, if it doesn't work, repost the rpt.

Share this post


Link to post
Share on other sites

@[EVO] Dan I'll test that tomorrow when I get back on my main computer, I hope this fixes it, and for the "addAction" do I still need to have it scripted the way you told me before and do I need to put in the "_vehType = _this select 3 select 0" like KevsnoTrev suggests? I know if I keep the "addAction" scripted like you said before, I had to put in the suggestion KevsnoTrev said in order for the vehicle to spawn again.

Share this post


Link to post
Share on other sites

Heres my example from something I wrote a few weeks back:

_tar = _this select 3 select 0;
_Veh = _this select 3 select 1;
removeAllActions _tar;
removeAllActions _Veh;
_tar attachTo [_Veh, [0,0,0]];
_VehAction = _Veh addAction ["Unload","[[_this,'Logistics\Detach.sqf'],'BIS_fnc_execVM',true,true] spawn BIS_fnc_MP",[_Veh,_tar]];

The bottom line is how you would set it up for executing it, the arguments pass on, so yes he is right.

Share this post


Link to post
Share on other sites

@KevsnoTrev Your script works great! Thanks a lot!

Well, all the basics are in place at this point, I think it is time for a small closed alpha.

Here are a few things I need before releasing an open beta.

The resource system I mentioned early, alternately, a timer can be put on the action when you select it so that you cannot select it for a certain time (e.x. If I spawn an ATV, I won't be able to spawn on for another 5 minutes). I'm sure that would be much simpler then the resource system. On the flipside, it really takes out a lot of the tactics of capturing certain areas to get their resource benefits.

Annnd, yea, that's all I can think of right now. The mission is actually coming along very smoothly, so cool to see everything come together!

Again, thank you everyone for helping me out, none of this would've happened had you just ignored this, and I've learnt a great deal about scripting that will defiantly benefit future missions!

Share this post


Link to post
Share on other sites

Nice! Good to see that it has come along as well as it being nice to see you improve your skills!

Share this post


Link to post
Share on other sites

I created scenario I did everything with respawn thing and description.ext I made 2 player mission with sniper but when someone join all my mission start popping out like I finish them how to fix that plz cuz I want to play with my friend but everytime he joins my TASKs are oone by one finished .....:butbut:

Share this post


Link to post
Share on other sites

3) How to put a timer on addAction menus. The last thing we want is a team spamming helicopters, so I need some why to limit the when people spawn. This can be local and/or serverside.

For this, you will want to remove the action temporarily once the helicopter has been spawned, you can do this in the script that you use to spawn the vehicle. Then, after a time delay, you can re add it to the place you want to.

Share this post


Link to post
Share on other sites

@Gamer222 This would be better discussed in a private conversation, feel free to PM me if you need any help with respawns :)

@Dan Thanks! I'll see what I can do!

Share this post


Link to post
Share on other sites

Ok, I'm back after a few days.

I can't seem to find any "deleteAction" command on the wiki could you possibly give an example on how I would disable the action for a time?

Share this post


Link to post
Share on other sites

Hi copper, use the condition part of the addaction

if you have a global variable set to true when the action is allowed then you can change it to false when the 'timer' runs.

Like this.

 this addaction ["Name of Action","Scripttorun.sqf",[],5,true,true,"","AllowAction"]

This action will only show if AllowAction variable is true.

This method is easier than adding and removing actions.

You can set allowaction to true in the init.sqf, this will allow it to be seen at the start of the mission, or whenever you want it to be able to be used.

Then just put allowaction = false at the top of your script. then at the end have a sleep of the time limit you want and then set allowaction = true

Share this post


Link to post
Share on other sites

Hm, ok, so the allowaction = false is defiantly working, cause I can't see the options anymore, but either it is counting down the timer at the start of the mission, or I did something wrong in the init.sqf, either way something is wrong XD. Here are all the scripts involved

spawnvehicleact.sqf

I'm testing the timer on the quadbike first, ignore the other lines for now.

set allowaction = false
sleep 50
set allowaction = true

private ["_box"];
_box = _this select 0;

_box addAction ["Spawn Quadbike", "vehicleSpawn.sqf", "quadbikeb",true,true,"","AllowAction"];
_box addAction ["Spawn AMV-7 Marshall", "vehicleSpawn.sqf", "ltankb"];
_box addAction ["Spawn IFV-6c Panther", "vehicleSpawn.sqf", "apcb"];
_box addAction ["Spawn M2A1 Slammer", "vehicleSpawn.sqf", "htankb"];

init.sqf

Everything below the set allowaction = true is for the respawn inventory, I don't think that is an issue.

set allowaction = true
[west, "WEST1"] call BIS_fnc_addRespawnInventory;
[west, "WEST2"] call BIS_fnc_addRespawnInventory;
[west, "WEST3"] call BIS_fnc_addRespawnInventory;
[west, "WEST4"] call BIS_fnc_addRespawnInventory;
[west, "WEST5"] call BIS_fnc_addRespawnInventory;
[east, "EAST1"] call BIS_fnc_addRespawnInventory;
[east, "EAST2"] call BIS_fnc_addRespawnInventory;
[east, "EAST3"] call BIS_fnc_addRespawnInventory;
[east, "EAST4"] call BIS_fnc_addRespawnInventory;
[east, "EAST5"] call BIS_fnc_addRespawnInventory;

Share this post


Link to post
Share on other sites

Try these changes:

I also realised you need to publicvariable the allowaction as it needs to update across all clients. Or one person will be locked out for 50 seconds and the rest of the players will be able to call in vehicles.

selectVehicleAct.sqf

// Add this to init box of object: null = [this] execVM "scripts\selectVehicleAct.sqf";   private ["_obj"]; 
_obj = _this select 0; 
_box addAction ["Spawn Quadbike", "vehicleSpawn.sqf", "quadbikeb",true,true,"","AllowAction"];
_box addAction ["Spawn AMV-7 Marshall", "vehicleSpawn.sqf", "ltankb"];
_box addAction ["Spawn IFV-6c Panther", "vehicleSpawn.sqf", "apcb"]; 
_box addAction ["Spawn M2A1 Slammer", "vehicleSpawn.sqf", "htankb"]; 

selectVehicle.sqf

private ["_unit", "_vehType", "_veh"];
AllowAction= false;publicvariable "AllowAction";
_unit = _this select 1;
_vehType = _this select 3;

sleep 0.001;
waitUntil {!isNull _unit};
waitUntil {alive _unit};

switch (_vehType) do {
    case "Quadbike": {
        _veh = "B_Quadbike_01_F" createVehicle (getMarkerPos "vspawn");
        cutText ["", "BLACK", 0.3];
          sleep 1;
         _unit moveInDriver _veh;
        _unit assignAsDriver _veh;
        cutText ["", "BLACK IN", 5];
    };
    case "AMV-7 Marshall": {
         _veh = "B_APC_Wheeled_01_cannon_F" createVehicle (getMarkerPos "vspawn");
        [[[_veh],"scripts\mhqRespawn.sqf"], "BIS_fnc_execVM", false, true] spawn BIS_fnc_MP;
        cutText ["", "BLACK", 0.3];
          sleep 1; 
        _unit moveInDriver _veh;
        _unit assignAsDriver _veh; 
       cutText ["", "BLACK IN", 5];
    };
    case "IFV-6c Panther": {
        _veh = "B_APC_Tracked_01_rcws_F" createVehicle (getMarkerPos "vspawn");
        cutText ["", "BLACK", 0.3];
        sleep 1;
        _unit moveInDriver _veh; 
        _unit assignAsDriver _veh;
        cutText ["", "BLACK IN", 5];     
   };
    case "M2A1 Slammer": {
        _veh = "B_MBT_01_cannon_F" createVehicle (getMarkerPos "vspawn");
        cutText ["", "BLACK", 0.3];
        sleep 1; 
       _unit moveInDriver _veh; 
       _unit assignAsDriver _veh;
        cutText ["", "BLACK IN", 5];
    };
};
sleep 50;
AllowAction= true;publicvariable "AllowAction";

Share this post


Link to post
Share on other sites

Hmm, that did something, I can see three of the options, but not the quadbike, here is the vehicleSpawn and spawnvehicleact scripts

vehicleSpawn.sqf

private ["_unit", "_vehType", "_veh"];
AllowAction= false;publicvariable "AllowAction";
_unit = _this select 1;
_vehType = _this select 3;

sleep 0.001;
waitUntil {!isNull _unit};
waitUntil {alive _unit};

switch (_vehType) do {
   case "quadbikeb": {
       _veh = "B_Quadbike_01_F" createVehicle (getMarkerPos "vspawn"); 
       cutText ["", "BLACK", 0.3];  
       sleep 1; 
       _unit moveInDriver _veh;
       _unit assignAsDriver _veh;
       cutText ["", "BLACK IN", 5];     

   };
   case "ltankb": { 
       _veh = "B_APC_Wheeled_01_cannon_F" createVehicle (getMarkerPos "vspawn"); 
       cutText ["", "BLACK", 0.3];  
       sleep 1; 
       _unit moveInDriver _veh;
       _unit assignAsDriver _veh;
       cutText ["", "BLACK IN", 5];
   };
   case "apcb": {
       _veh = "B_APC_Tracked_01_rcws_F" createVehicle (getMarkerPos "vspawn");
       [[[_veh],"mhqRespawn.sqf"], "BIS_fnc_execVM", false, true] spawn BIS_fnc_MP;
       cutText ["", "BLACK", 0.3];  
       sleep 1; 
       _unit moveInDriver _veh;
       _unit assignAsDriver _veh;
       cutText ["", "BLACK IN", 5];     

   };
   case "htankb": {
       _veh = "B_MBT_01_cannon_F" createVehicle (getMarkerPos "vspawn"); 
       cutText ["", "BLACK", 0.3];  
       sleep 1; 
       _unit moveInDriver _veh;
       _unit assignAsDriver _veh;
       cutText ["", "BLACK IN", 5];     

   };
      case "lheli": {
       _veh = "B_Heli_Light_01_armed_F" createVehicle (getMarkerPos "hspawn"); 
       cutText ["", "BLACK", 0.3]; 
       sleep 1; 
       _unit moveInDriver _veh;
       _unit assignAsDriver _veh;
       cutText ["", "BLACK IN", 5];     

   };
          case "theli": {
       _veh = "B_Heli_Transport_01_F" createVehicle (getMarkerPos "hspawn"); 
       cutText ["", "BLACK", 0.3]; 
       sleep 1; 
       _unit moveInDriver _veh;
       _unit assignAsDriver _veh;
       cutText ["", "BLACK IN", 5];     

   };
          case "aheli": {
       _veh = "B_Heli_Attack_01_F" createVehicle (getMarkerPos "hspawn"); 
       cutText ["", "BLACK", 0.3]; 
       sleep 1; 
       _unit moveInDriver _veh;
       _unit assignAsDriver _veh;
       cutText ["", "BLACK IN", 5];     

   };
}; 
sleep 50;
AllowAction= true;publicvariable "AllowAction";   

spawnvehicleact.sqf

private ["_box"];
_box = _this select 0;
_obj = _this select 0; 

_box addAction ["Spawn Quadbike", "vehicleSpawn.sqf", "quadbikeb",true,true,"","AllowAction"];
_box addAction ["Spawn AMV-7 Marshall", "vehicleSpawn.sqf", "ltankb"];
_box addAction ["Spawn IFV-6c Panther", "vehicleSpawn.sqf", "apcb"];
_box addAction ["Spawn M2A1 Slammer", "vehicleSpawn.sqf", "htankb"];

Share this post


Link to post
Share on other sites

you will need to put

Allowaction = true; publicvariable "allowaction"; 

into your init.sqf to initialise the variable for use.

Share this post


Link to post
Share on other sites

Phew, ok, so after a couple of hours of tweaking the script, I found that, for some reason, the priority is required for the script to work. The only thing I need now is to have each menu individualized, basically have it so that the Quad is spawnable every 20 seconds, the APC every 300, etc etc.

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

×