Jump to content

klakins

Member
  • Content Count

    12
  • Joined

  • Last visited

  • Medals

Everything posted by klakins

  1. First I want to say that I'm very new to scripting. The missions I have made in the past have been very light on scripting. I'm making a mission that will randomly generate a mission for you. All the scripts work when playing the mission in MP, hosting the mission on my own machine. The scripts also work fine on a dedicated server when I execVM them in the on activation field of a editor placed trigger, such as Radio Alpha. The problem I'm running into is, I would like to release this mission to the public, so I'm trying to put anti griefing measures in place, by only giving the first player slot the ability to generate the mission. I accomplished this by using the following code. Init.sqf if(player == p1) then {settings addAction ["Enemies: Low", "low.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Enemies: Medium", "medium.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Enemies: High", "high.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Enemies: Extreme", "extreme.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Generate Mission", "gennorm.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Generate Mission Big Cities Only", "genbco.sqf",[],1,false,true,"","_this distance _target < 5"]; }; For example selecting Generate Mission would run. gennorm.sqf removeAllActions insert; removeAllActions settings; insert addAction ["Insertion 1", "I1.sqf",[],1,false,true,"","_this distance _target < 5"]; insert addAction ["Insertion 2", "I2.sqf",[],1,false,true,"","_this distance _target < 5"]; insert addAction ["Insertion 3", "I3.sqf",[],1,false,true,"","_this distance _target < 5"]; insert addAction ["Insertion 4", "I4.sqf",[],1,false,true,"","_this distance _target < 5"]; typ = "Type: Normal Generation"; if(isServer) then { { if (alive _x && side _x == EAST) then { deleteVehicle _x; }; } forEach allUnits; sleep 2; { if (alive _x && side _x == EAST) then { deleteVehicle _x; }; } forEach allUnits; execVM "start.sqf"; }; sleep 14; if(player == p1) then { settings addAction ["Enemies: Low", "low.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Enemies: Medium", "medium.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Enemies: High", "high.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Enemies: Extreme", "extreme.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Generate Mission", "gennorm.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Generate Mission Big Cities Only", "genbco.sqf",[],1,false,true,"","_this distance _target < 5"]; }; Which would then run start.sqf if(isServer) then {_mkr = ["m1","m2","m3","m4","m5","m6","m7","m8","m9","m11","m12","m13","m14","m15","m16","m17","m18","m19","m20","m21","m22","m23","m24","m25","m26","m27","m28","m29","m30","m31","m32","m33","m34","m35","m36"] call BIS_fnc_selectRandom; _obj = markerpos _mkr; "A" setMarkerPos _obj; o1 setPos markerpos _mkr; s1 setPos (getPos o1 vectorAdd [0,600,0]); s2 setPos (getPos o1 vectorAdd [600,0,0]); s3 setPos (getPos o1 vectorAdd [-600,0,0]); s4 setPos (getPos o1 vectorAdd [0,-600,0]); "I1" setMarkerPos s1; "I2" setMarkerPos s2; "I3" setMarkerPos s3; "I4" setMarkerPos s4; comp setPos (getPos o1); end setPos (getPos o1); g1 = [getPos o1, east, ["CUP_O_INS_Officer", "CUP_O_INS_Soldier_AR", "CUP_O_INS_Soldier_AK74", "CUP_O_INS_Soldier"],[],[],[],[],[],180] call BIS_fnc_spawnGroup; sleep 2; null = [leader g1,"A","random","min:",mn,"max:",mx,"noai"] execVM "ups.sqf"; }; [player, "task1", ["Clear the area of all enemies", "Clear The Area", "Marker: Area"], (markerPos "A"), true] call BIS_fnc_taskCreate; I also tried removing the if(player == p1) then from the addActions and got the same results. The variables that these scripts define update on the persons machine that ran these scripts, but not the other machines, and obviously not the server, because the mission isn't generated. I know this, because I have a radio trigger set up to display the variables I'm using for testing. Again I want to reiterate that the scripts run fine when I have an editor placed trigger, with on activation being execVM "gennorm.sqf", and they also run fine when I host a local server. I'm obviously missing something that is causing these scripts to only be run on the client that execs them. I would appreciate any help on this.
  2. That looks like a great way to do that. Thank you. Also, thanks for noticing the missing marker. One change that I will need to make to what you provided is, put the addActions for insert in another script, and remote exec those for all clients, because all players need to be able to see those. Thanks again.
  3. Alright, I got it working using this workaround if(player == p1) then { settings addAction ["Enemies: Low", "l.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Enemies: Medium", "m.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Enemies: High", "h.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Enemies: Extreme", "e.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Generate Mission", "g.sqf",[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Generate Mission Big Cities Only", "gb.sqf",[],1,false,true,"","_this distance _target < 5"]; }; Then for example in g.sqf ["gennorm.sqf"] remoteExec ["execVM"]; I'm assuming this isn't the most efficient way to do this, so any further help would be appreciated.
  4. Thanks for the tips. I will be reading those links, and cleaning up the code. I now have this in my init.sqf if(player == p1) then { settings addAction ["Enemies: Low", ["low.sqf"] remoteExec ["execVM"],[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Enemies: Medium", ["medium.sqf"] remoteExec ["execVM"],[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Enemies: High", ["high.sqf"] remoteExec ["execVM"],[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Enemies: Extreme", ["extreme.sqf"] remoteExec ["execVM"],[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Generate Mission", ["gennorm.sqf"] remoteExec ["execVM"],[],1,false,true,"","_this distance _target < 5"]; settings addAction ["Generate Mission Big Cities Only", ["genbco.sqf"] remoteExec ["execVM"],[],1,false,true,"","_this distance _target < 5"]; }; The script now works on a dedicated server, but now as soon as p1 loads into the game missions get spam generated all over the map. What did I do wrong? And to answer your questions settings and insert are both editor placed object. I understand your point about the names, and will be changing them after I get this figured out. comp and end are both triggers.
  5. I have the same problem as the OP. I'm pretty sure the respawn system was broken from a somewhat recent patch (last few years or so). I have made countless missions in OFP, ARMA 2, and ARMA 3, and have never had this issue until now. I haven't made an Arma 3 mission in a few years though, so don't know when exactly it broke. BTW OP you can test this by yourself by setting up a dedicated server, and joining it. When i test my broken missions from the editor i respawn as I should, but when i upload the mission to my dedicated server, I respawn on my dead body. I will try both having multiple respawn points, and checking the select respawn position option and report back.
  6. I'm not new to making missions in Arma, but i am new to writing my own scripts. For my first attempt I'm just trying to create a simple spawn script for an ambush. I'm having a hell of a time randomizing the spawns. Here is what I have so far. if(isServer) then { _w1g1 = ["amb1","amb2","amb3"] call BIS_fnc_selectRandom; _w1g2 = ["amb1","amb2","amb3"] call BIS_fnc_selectRandom; _g1 = [getpos _w1g1, INDEPENDENT, (configfile >> "CfgGroups" >> "Indep" >> "CUP_I_TK_GUE" >> "Infantry" >> "CUP_I_TK_GUE_Group")] call BIS_fnc_spawnGroup; _wp1 = _g1 addWaypoint [getmarkerpos "w1", 50]; _wp1 setWaypointType "SAD"; _g2 = [getpos _w1g2, INDEPENDENT, (configfile >> "CfgGroups" >> "Indep" >> "CUP_I_TK_GUE" >> "Infantry" >> "CUP_I_TK_GUE_Group")] call BIS_fnc_spawnGroup; _wp1 = _g2 addWaypoint [getmarkerpos "w1", 50]; _wp1 setWaypointType "SAD"; }; amb1, amb2, and amb 3 are objects, each with a placement radius of 100. Basically what im going for is 2 groups that will spawn on 1 of 3 spawn points, that are further randomized by having a placement radius. I've tried many different things, but just cant it to work. If i use getmarkerpos instead of getpos the units do spawn, but off the edge of the map. If anyone has any idea of how to get this to work, or if you have a better idea to accomplish the same thing, I would love to hear your suggestions. I did get this same script working earlier with amb1, amb2, and amb3 being markers, but markers cant have a placement radius, so doesn't quite accomplish what I'm trying to do.
  7. Ok I am making a large mission, with respawn and AI recruitment, and I need help with a few scripts. The first I need help with is player location markers on the map. I can not figure out how to call the script again, once the player respawns. The markers wont follow the players after they die the first time. The second script I need help with is for disbanding the recruited AI. I want the players to be able to hit radio alpha to remove all the AI units in their squad. The third script will be the most difficult. I want the player to be able to take ownership of a vehicle, using add action. Once the player owns that vehicle, I want them to be able to blow up that vehicle, with radio bravo. That way they can respawn their vehicle when they see fit.
  8. Ok i have another question. Would it be possible to make it so we can disband ai? That way if i get killed, and all my ai are still alive somewhere far away, I can get a fresh crew.
  9. klakins

    UPSMON for arma3

    I have a question that might be pretty complicated. Lets say we have 2 objectives with patrol areas around them. Players engage enemys at obj one. The players get killed and decide to do obj 2 instead. Is it possible for all the units at obj one, to despawn and respawn, at obj 1 patrol area, when they have not had contact in a certain amount of time? The point of this would be to kind of reset the obj after the players have left it alone, for lets say 15 minutes.
  10. That is what I figured. Thanks again for making this.
  11. Right, I knew that. What I was asking is if it is possible to have best of both worlds. For example, I recruit one AI. I get killed and spawn into that AI. I get killed again, this time I respawn at base, and am able to recruit more AI.
  12. Great script. I will be using this in a few of my missions. I have one question that would make this script perfect for me. Is it possible to make the player respawn into recruited ai, unless they are all dead, in which case they would respawn at base?
×