tron34 10 Posted January 21, 2014 This might come in handy, thanks. Share this post Link to post Share on other sites
Flens 10 Posted January 24, 2014 One of the last few dev updates broke the simplecache script http://i.imgur.com/qlB76K1.png Share this post Link to post Share on other sites
overhaul 10 Posted January 25, 2014 Switched to dev and can't seem to get the simplecache working, everything just stays spawned. Share this post Link to post Share on other sites
spunfin 34 Posted January 26, 2014 One of the last few dev updates broke the simplecache scripthttp://i.imgur.com/qlB76K1.png Haven't tried for a while, but this error refers to that you have some files from the fix, but not all. Militarize.sqf had also little changes in it, so you need to take all files from the fix. Share this post Link to post Share on other sites
brians200 51 Posted January 28, 2014 (edited) Hello, I am having trouble with the people inside the reinforcement helicopters refusing to get out once they land on the ground. There is nothing in the rpt indicating any error. This is the command I am using. nul = [_pos,2,350,[true,false],[false,false,false],true,[15,20],[3,0],"default",nil,nil,groupNumber] execVM "LV\militarize.sqf"; sleep 15; call compile format["waituntil{sleep 1; ({alive _x} count units LVgroup%1) < 8};", groupNumber]; ["Reinforcements inbound!", "messageEverybody", true, false] call bis_fnc_mp; nul = [_pos,false,2,4,false,false,[_pos],"random",2500,true,false,8,"default",[false,true,false,true],call compile format["LVgroup%1",groupNumber],nil,groupNumber,false] execVM "LV\reinforcementChopper.sqf"; sleep 5; nul = [_pos,false,2,4,false,false,[_pos],"random",2500,true,false,8,"default",[false,true,false,true],call compile format["LVgroup%1",groupNumber],nil,groupNumber,false] execVM "LV\reinforcementChopper.sqf"; sleep 5; call compile format["waituntil{sleep 1; ({alive _x} count units LVgroup%1) < 5};", groupNumber]; In terms of reproducing this error, it seems to sometimes happens if you shoot at the chopper, but it sometimes happens even if you don't shoot at it. EDIT As a temporary fix, you can force them to get out using. if(vehicle _x != _x) then {_x action["getOut", vehicle _x];}; //eject works too You probably want to put a small sleep in there, like sleep .5; or else they will all get out at once. Another problem I noticed is that the AI helicopter pilots do not use flares to try to protect the chopper. Is there an option to allow this again? Edited January 29, 2014 by brians200 Share this post Link to post Share on other sites
m0nkey 111 Posted January 31, 2014 (edited) Might have found a small error in patrol_vD.sqf If I place a unit and in its init use this nul = [this] execVM "LV\patrol-vD.sqf"; Then on line 16 an error occurs because there is no 2 index to assign to _radius. At least thats what my machine kept telling me. The comments gave that init value as a suggested syntax, so I used it. I worked around it by using this instead if (count _this > 1) then {_radius = _this select 2;}; //_radius = _this select 2; Maybe its nothing. Or maybe its something. I also wanted to make a note, for anyone who might need to know, that when you use AISS with UPSMON, you can pass the group that AISS made onto UPSMON by using "nil" in the "group" parameter and instead put a number in the "ID" parameter (such as 17). Then when you pass that group on to something like UPSMON you prepend LVGroup to the number you chose (ie. LVgroup17). That might be documented but I haven't seen it yet. EDIT: I have a question that just occurred to me. Normally when scripting if you are going to do something many times you just set a variable with the value. I don't see that, in the case of "count" much in arma scripts. Why is that? Is count just so fast that reading the pre-read value from a variable just not that big of a difference? ie. _intX = count _someArray Then rather than counting all the time, you reference the variable. Just curious :) Edited January 31, 2014 by m0nkey Share this post Link to post Share on other sites
redarmy 422 Posted February 1, 2014 Hi spunfin,got these scripts a while back and messed around with them.Very easy to use an just plain fantastic. However my knowledge on scripting and modding are limited as iv onyl been in the ArmA universe about two months. Is there a way to spawn a simple patrol that can follow waypoints abnd be cached to spawn when player nears? I did see some patrol script but cant make head nor tail from it-total noob at this-i use your LV folder to quickly drop game logics with militirize etc and cache but there is no patrol script in there(or at least no quick option to select it) Is there a way to do what i ask? Thanks again for this excellent performance saver! Share this post Link to post Share on other sites
m0nkey 111 Posted February 2, 2014 Maybe someone can help me sort this out. I've been banging on this for two nights now. Have learned a lot of other stuff, but now how to solve this issue. I am trying to use militarize to spawn some units on a marker. Then pass that "group" of units to UPSMON with the "spawned" parameter so UPSMON can handle the AI portion of the units. Prior I had it working but did not understand all that I needed. It worked but was not doing what I expected. I actually learned about the command line parameter to show script errors and now I've been learning for real lol. So because it would not work in my trigger and because I read a few notes about using AISS with UPSMON, I made an addaction that calls a script, which in turn calls another script. The idea is the action script passes some parameters to the spawn script. The spawn script then lets me test what I am sending to the militarize script. Here is what the addaction passes to my spawn script myt3st = player addaction [_textAction,'["MRKUM",2,50,true,[5,2],"default",69] execVM "woo_spawn.sqf"']; Here is my spawn script that gets sent to the militarize script // define a variable for the group (was using group_x = grpNull but don't know if correct use) group_x = 0; private ["_groupx","_aSkills","_mkey"]; // get passed values _marker_name = _this select 0; // test if marker has been assigned/initialized if (isNil "_marker_name") exitWith {hint "marker name not correct"}; _side = _this select 1; _radii = _this select 2; _still = _this select 3; _num_men = _this select 4; _skillset = _this select 5; _gid = _this select 6; // create center and create group for the chosen side switch (_side) do { case 0: {_SideHQ = createCenter civilian; group_x = createGroup civilian;}; case 1: {_SideHQ = createCenter west; group_x = createGroup west;}; case 2: {_SideHQ = createCenter east; group_x = createGroup east;}; case 3: {_SideHQ = createCenter resistance; group_x = createGroup resistance;}; }; // test if _group is of typename "GROUP" - don't know if any of these will work, they all error! // if (typeName group_x != "GROUP") exitWith {hint "not create group!";}; // if (isNil ("group_x")) exitWith {hint "not created group!";}; // if (isNull group_x) exitWith {hint "not created group!";}; switch (_skillset) do { case "default": {_aSkills = "default";}; case "green": {_aSkills = [0.25,0.75,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25];}; case "proven": {_aSkills = [0.35,0.65,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35];}; case "veteran": {_aSkills = [0.45,0.55,0.45,0.45,0.45,0.45,0.45,0.45,0.45,0.45];}; }; script_handler_x = [_marker_name,_side,_radii,[true,false],[false,false,false],_still,_num_men,[3,0],"default",group_x,nil,nil] execVM "LV\militarize.sqf"; hint "AISS has spawned the men!"; I keep getting an error in militarize Error in expression <f(!isNil("_milGroup"))then{if(_milGroup == "nil0")then{_milGroup = nil;};}; _cu> Error position: <== "nil0")then{_milGroup = nil;};}; _cu> Error Generic error in expression File C:\Users\xxx\Documents\Arma 3 - Other Profiles\xxx\mpmissions\aiss_test_3.Stratis\LV\militarize.sqf, line 59 This looks to me like there is an issue with using a group as a parameter for militarize. I've seen others note they have gotten spawned AISS units to work by creating a group, then calling militarize with that group, then passing that group on to UPSMON. I cannot even figure out how to test if group_x is actually a group other than typeName = "GROUP" which is true. Basically I have written a complex call to militarize lol. Its ok, it teaches me a lot. But I am stumped. The AISS documentation says to use a group if desired. Unless I am wrong, this verifies that using a group should work http://www.armaholic.com/forums.php?m=posts&id=151349 I can get militarize to work by itself if i don't try to pass a group in. But if I want to get UPSMON to work with that group, I have to give it some reference that will point it to the spawned group/units. Another week of this and I might be able to make my own minimalistic spawn script lol! Share this post Link to post Share on other sites
m0nkey 111 Posted February 2, 2014 Finally got this bugger to work. Maybe not the best solution, but its what I could come up with. Now spawning units with AI Spawn Script and then passing them over to UPSMON. Not even sure yet if thats really any better than just using ai spawn script. The whole purpose of this was to see if UPSMON would give better AI or not and to make the spawned units behave as a group. I never could get a group working with both ai spawn script and upsmon. I ended up just using ID. It was quite useful when I figured out that to programatically use LVgroup# you had to use "call compile format[]" to do it. Once I figure that was how you get a reference to something like an object and not just a string value, things started working. Its slow work I am finding out because you have to load the mission to see any values, and unless you figure out to use different tools like "typename" etc, you just "hint str" things and think they will be usable in a parameter array. Another oddity, either with this script or arma in general is that I had to use the same case in the quoted marker name as the marker name. Further, if the marker name was not all caps, it just would not work. There is an upper case conversion going on, so I had to name the marker all upper. I can use getPosATL to get a position array as well I realize, but I'm out to learn too I suppose. Anyway, here is what I put in a trigger nul = ["MRKUM",2,50,true,[5,2],"green",68] execVM "scripts\m0nkey\m0nkey_spawn.sqf"; and here is the script that does the work (I comment the crap out of things usually, reminding myself what I am doing, old habit so its pretty busy) if (!isServer && hasInterface) exitWith{}; // is this needed if called from a trigger? /* a trigger will activate this script this script will use AI Spawn Script to militarize an area it will then call UPSMON on the group for its AI features input parameters: [center,side,radius,still,men,skillset,id] center (obj/unit/marker/pos) = center point, as per AI Spawn Script side (integer) = 0/1/2/3 (civ/west/east/guer), as per AI Spawn Script radius (integer) = meters from center, as per AI Spawn Script still (boolean) = do units patrol radius, as per AI Spawn Script [men,+random#] (array of integers) = see AI Spawn Script skillset (string) = 4 values to use, "default" "green" "proven" "veteran" ID (integer) = group ID to use for the created group, as per AI Spawn Script *Init (string) = future? ie. ["markerx",2,50,[5,5],false,"green",88] execVM "script.sqf" - this is passed from trigger etc to this script */ // declare private variables private ["_aSkills","_full_gid"]; // get input array values as parameters _marker_name = _this select 0; // center point or target _side = _this select 1; // side or faction _radii = _this select 2; // radius of center/target _still = _this select 3; // unit patrols or not _num_men = _this select 4; // number of units to deploy _skillset = _this select 5; // which skillset to create for units _gid = _this select 6; // group ID to use // select case for each skillset and populate array with associated values // very generic values to test switch (_skillset) do { case "default": {_aSkills = "default";}; case "green": {_aSkills = [0.25,0.75,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25];}; case "proven": {_aSkills = [0.35,0.65,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35];}; case "veteran": {_aSkills = [0.45,0.55,0.45,0.45,0.45,0.45,0.45,0.45,0.45,0.45];}; }; // assign the call to a handle for later use // pass values to militarize.sqf - use _gid script_handler_aiss = [_marker_name,_side,_radii,[true,false],[false,false,false],_still,_num_men,[3,0],_aSkills,nil,nil,_gid] execVM "LV\militarize.sqf"; // ensure AI Spawn Script is finished, check handle waitUntil {scriptDone script_handler_aiss}; // wait for militarize to finish // concatenate string LVgroup and integer _gid into a true reference call compile format ["_full_gid = LVgroup%1",_gid]; // assign the call to a handle for later use next_handle_upsmon =[_full_gid,_marker_name,"SPAWNED","delete:",5] execVM "scripts\upsmon.sqf"; waitUntil {scriptDone next_handle_upsmon}; // indicator of success if desired hint "UPSMON complete"; If anyone happens to take a look at it and knows what they are doing, any advice on redundancy or best-practice would be gladly accepted ;) Share this post Link to post Share on other sites
SERE 10 Posted February 5, 2014 Simplecache doesn't appear to be working at all. Units will just stay on the map regardless of what I try. http://pastebin.com/fs3XZ9ZB The above is the script I use to call the spawns and the caching, I've been wrestling with this now for the better part of an afternoon and regardless of what I tyr changing I always get the same result; nothing is ever despawned. Share this post Link to post Share on other sites
na_palm 19 Posted February 16, 2014 (edited) Hi SERE, simpleCache only needs to be called once with every ID to manage. so it should look like this: //aissp spawns nul = ["destination",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,1] execVM "LV\militarize.sqf"; sleep 10; nul = ["destination_1",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,2] execVM "LV\militarize.sqf"; sleep 10; nul = ["destination_2",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,3] execVM "LV\militarize.sqf"; sleep 10; nul = ["destination_3",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,4] execVM "LV\militarize.sqf"; sleep 10; nul = ["destination_4",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,5] execVM "LV\militarize.sqf"; sleep 10; nul = ["destination_5",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,6] execVM "LV\militarize.sqf"; sleep 10; nul = ["destination_6",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,7] execVM "LV\militarize.sqf"; sleep 10; nul = ["destination_7",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,8] execVM "LV\militarize.sqf"; sleep 10; nul = ["destination_8",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,9] execVM "LV\militarize.sqf"; sleep 10; nul = ["destination_9",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,10] execVM "LV\militarize.sqf"; sleep 10; nul = [[1,2,3,4,5,6,7,8,9,10],[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24],1400,true,true] execVM "LV\LV_functions\LV_fnc_simpleCache.sqf"; I also changed a possible type mismatch at player 10, think it should read p10 and not 10 there... ---------- Post added at 03:28 ---------- Previous post was at 02:26 ---------- As i wrote earlier, i rewrote the simpleCache script to fasten up the mission start. If you DL it beforehand, download it again. Had missed an now corrected error in SP the new version is here: http://na-palmplace.net/downloads/simpleCachev2.zip should be extracted in the "\LV\LV_functions" directory, so it sits beside the other ones. The function call therefor needs to be changed. nul = [[script parameter list],[players],distance,keep count,MP] execVM "LV\LV_functions\LV_fnc_simpleCache.sqf"; script parameter list = array of [scriptID, [parameter]] scriptID = 1: militarize, 2: fillHouse parameter = array of required parameters for the script the same as you would use for them direcly players = array of players (doesnt matter what you set here if you use MP mode) distance = distance between player(s) and militarize/fillHouse on where scripts will be activated keep count = true = script will count & save AI amounts, false = AI amount will be reseted on each time it activates again MP = true = all alive non-captive playableUnits will activate scripts, false = only units in players-array example 1: nul = [[[1, [<parameter for 1>]], [2, [<parameter for 2>]]],[playerUnit1],500,true,false] execVM "LV\LV_functions\LV_fnc_simpleCachev2.sqf"; example 2: LV_fnc_simpleCachev2 = compileFinal preProcessFileLineNumbers "LV\LV_functions\LV_fnc_simpleCachev2.sqf"; [[[1, [<parameter for 1>]], [2, [<parameter for 2>]]],[playerUnit1],500,true,false] spawn LV_fnc_simpleCachev2; To give a quick example you could do the following: //aissp spawns _sC_scripts = [ [1,["destination",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,1]], [1,["destination_1",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,2]], [1,["destination_2",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,3]], [1,["destination_3",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,4]], [1,["destination_4",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,5]], [1,["destination_5",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,6]], [1,["destination_6",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,7]], [1,["destination_7",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,8]], [1,["destination_8",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,9]], [1,["destination_9",2,150,[true,false],[true,false,false],false,[20,20],[1,2],"default",nil,nil,10]] ]; nul = [_sC_scripts,[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24],1400,true,true] execVM "LV\LV_functions\LV_fnc_simpleCachev2.sqf"; This would do the same for v2 as my above reply does for "simpleCache". No calling of militarize or fillHouse directly, only putting it into an array and hand it over to "simpleCachev2" Edited March 10, 2014 by Na_Palm Share this post Link to post Share on other sites
thesnypr 38 Posted February 17, 2014 hu sorry i spend time read but i found nowhere about group spawning with "MILITARISE" i try to make one with specific vehicule "CAF_AG_AFR_Offroad_armed_01" but always i have russian crew and russian vehicule? where can change it? i supose it is in "LV_fnc_fullLandVehicle" but can i modify it without attemp to your licence it s just for a private lan party; thanks a lot and great job ! Share this post Link to post Share on other sites
phronk 898 Posted February 17, 2014 Does the new updated script allow spawning of units on the position of a marker? Also, is this an ideal script to use for making an insurgency type mission (100+ possible spawn markers)? Share this post Link to post Share on other sites
na_palm 19 Posted February 18, 2014 hu sorry i spend time read but i found nowhere about group spawning with "MILITARISE" i try to make one with specific vehicule "CAF_AG_AFR_Offroad_armed_01" but always i have russian crew and russian vehicule? where can change it?i supose it is in "LV_fnc_fullLandVehicle" but can i modify it without attemp to your licence it s just for a private lan party; thanks a lot and great job ! Hi thesnypr, if the vehicle or unit you try to get in is from a mod/addon you will have to edit the array that controls them. If that offroader is an op.f. vehicle than you have to add it to "_OPFveh" in line 8 of this "LV_fnc_fullLandVehicle" file. For the license you should maybe pm SpunFIN directly, if you have questions therefor. He is hard at work, as far as i know, and could have missed the post. Does the new updated script allow spawning of units on the position of a marker? Also, is this an ideal script to use for making an insurgency type mission (100+ possible spawn markers)? Hi Phronk, The position gathering works the same way as in "simpleCache". So if it works there it works in v2, too. Personally i like it, too, to place a marker on a map and reference him then in the parameters and after that, forget him. I haven't tested it with 100+ script's but in my test missions i tested it with 53 militarize and 21 fillHouse on the same time and running this mission with players for few hours, so i can say that 74 calls are no problem at all. It's nearly instant ready for players. I'am working now on a system for vehicles, thats based on the same concept, for now it runs fluidly on altis with 293 entities to handle and don't shows signs of stress. And i think vehicles are more demanding than the militarize and fillHouse version of it. Especially if you put them on an HC. greetings Na_Palm Share this post Link to post Share on other sites
HaZZarD 2 Posted February 19, 2014 I'am having troubles with the militarize script in my mission when I capture the enemy officer and tell him to follow me I have this script : /* File: follow.sqf Author: cobra4v320 */ _officer = _this select 0; _caller = _this select 1; _id = _this select 2; _officer removeAction _id; _officer enableAI "ANIM"; _officer enableAI "MOVE"; _officer switchMove ""; [_officer] joinSilent _caller; _officer setCaptive false; EAST setFriend [WEST, 0]; WEST setFriend [EAST, 0]; if (alive _officer) then { _officer addAction ["<t color=""#1EFF00"">" + "Wait Here" ,"stop.sqf", [], 1, true, false, "", "_target distance _this < 10 && side _this == blufor"]; }; the problem here is that as soon as the Officer join my group , enemies stop firing at us uhmm the officer see EAST as enemies but look like they see us as friendly Share this post Link to post Share on other sites
solentis 10 Posted February 23, 2014 Very easy an usefull system. Did you know if there is a way to limite the militarize land vehicle fonction with only light armored vehicules to simulate motorized patrols? Actually, patrol spawning with MBT is a little tough. Share this post Link to post Share on other sites
na_palm 19 Posted February 23, 2014 @HaZZarD: personally, i havn't much experience with "setCaptive". Have you tried to reverse the order of commands for "setCaptive" and "joinSilent" or/and checked that the officer isn't the highest ranking unit in the assigned to group "_caller"? Thats for now all i can think off... @Solentis: for civilian vehicles look at/edit "militarize.sqf" the array "_yellowCarArray" ~line 113, for all other side look at/edit "LV_fnc_fullLandVehicle.sqf" the arrays "_BLUveh","_OPFveh","_INDveh" ~line 7-9 greetings Na_Palm Share this post Link to post Share on other sites
mech79 10 Posted March 2, 2014 I have been using this script on some of my smaller mission but am trying to make a bigger one with multiple cities. I have used this script, if (triggeractivated trg1) then {nul = [this,3,200,[true,false],[true,false,false],false,[20,10],[3,2],[0.7],nil,nil,1] execVM "LV\militarize.sqf";}, trying to get Ai only to spawn after Blufor sets off a trigger. Any help please. Not the best at this and am still learning this whole script thing. Share this post Link to post Share on other sites
na_palm 19 Posted March 3, 2014 I have been using this script on some of my smaller mission but am trying to make a bigger one with multiple cities. I have used this script, if (triggeractivated trg1) then {nul = [this,3,200,[true,false],[true,false,false],false,[20,10],[3,2],[0.7],nil,nil,1] execVM "LV\militarize.sqf";}, trying to get Ai only to spawn after Blufor sets off a trigger. Any help please. Not the best at this and am still learning this whole script thing. Hi mech79, your problem will most likely be the use of "this" in the militarize call. Edit it to give an position or an marker name, then it should work. greetings Na_Palm Share this post Link to post Share on other sites
mech79 10 Posted March 3, 2014 (edited) Hi mech79,your problem will most likely be the use of "this" in the militarize call. Edit it to give an position or an marker name, then it should work. greetings Na_Palm Cool I will try that right now and see if it works. Edited: No still doesn't work right. I have this script in a game logic setting. It works even with "this" in the script, but to save FPS all I am trying to get this script to activate when troops are near or by trigger. Any suggestions. Edited March 3, 2014 by mech79 Share this post Link to post Share on other sites
na_palm 19 Posted March 3, 2014 I don't know if you can get a position out of a gamelogic with getPos. Have you tried to place a marker nearby, give it a name and then use it intead of the "this". greetings Na_Palm Share this post Link to post Share on other sites
mech79 10 Posted March 3, 2014 Sorry... let me explain better. I have the script originally set up on Game Logic- Object- game logic written this way nul = [this,3,200,[true,false],[true,false,false],false,[20,10],[3,2],[0.7],nil,nil,1] execVM "LV\militarize.sqf";. The mission works fine but I have two cities set up with this script plus tanks. Mission works fine but can effect FPS at times. I am trying to set it up to where the second script only places soldiers after a trigger is activated or the enemy from first script is wiped out. Share this post Link to post Share on other sites
na_palm 19 Posted March 3, 2014 (edited) Ah,ok. You can put the script call directly in the onActivation field of the trigger but use a marker as described above. So i tested your call earlier. greetings Na_Palm PS: is your mission for SP or MP? Edited March 3, 2014 by Na_Palm Share this post Link to post Share on other sites
cryptonat 10 Posted March 3, 2014 This is actually pretty handy. Allows me to test quite a few things Share this post Link to post Share on other sites