Jump to content

Recommended Posts

Then i think you are not spawning them on the server. Do you use an HeadlessClient?

Share this post


Link to post
Share on other sites

No. Not using a HC. Spawning them inside of a script that begins with if (isServer) then {

Share this post


Link to post
Share on other sites

Is it the same function call we wrote about earlier?

Does the group spawn on server?

Maybe show me the function through PM when you don't like to post it here.

Share this post


Link to post
Share on other sites

Id love to send you the sample mission if you have any way of running it on ded server. I would be very appreciative if you could help me figure it out.

Share this post


Link to post
Share on other sites

Hello spunFIN

Amazing job on these scripts - however I seem to be having a little issue regarding the simplecache function. With MP options set to false it works as intended, spawning and despawning AI at the set distances, however once I change the MP option to true AI spawn, but never despawns. Happens both on my current map, as well as on your example-mission.

Simply changing 'nul = [[1,2,3],[player],300,true,false] execVM "LV\LV_functions\LV_fnc_simpleCache.sqf";' to 'nul = [[1,2,3],[player],300,true,true] execVM "LV\LV_functions\LV_fnc_simpleCache.sqf";' seems to void the despawning aspect of the script.

My current workaround is simply to name all playable units and add them to the player array (hence keeping the MP option to false), however I'm not sure if this is an optimal solution.

Edited by Dashnaw

Share this post


Link to post
Share on other sites

Hey Zlin Could you give me the brake down and a Sample code of what you did, and what triggers and task's You used, See I need this for a single player client side mission and not on a server so Please if you could Help me with this thanks.

Share this post


Link to post
Share on other sites

Hi Na_Palm, Earlier in the thread (like waaaaaay earlier) You mentioned that to have an addAction applied by the custom init it would need to be encapsulated in another script and called using execvm

e.g. "nul = [this] execVM 'addaction.sqf';"

So i've done this and it seems to work, but now i have a problem with the encapsulated form of my addaction :S Here is what is in addaction.sqf:

_this addAction ["Gather Intel", "Scripts\SP\Insurgents\GatherIntel.sqf"];

When a unit is spawned arma reports an error like this: "Error addaction: Type Array, expected object"

Could you be so kind as to point out where i'm being dumb? I only started scripting yesterday so most of the finer details still escape me :)

Share this post


Link to post
Share on other sites

hi Blasturbator,

found the post on side 7 :)

can you show me the whole line for the function call to AISSP, please?

both line you posted above seem to be ok.

greetings Na_Palm

Share this post


Link to post
Share on other sites

Oksy this is the line to call it, I thought it was okay because it spawns the units and they behave correctly, was sure it was a problem with the addaction.sqf

nul = [this,2,100,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\addaction.sqf';",nil] execVM "LV\militarize.sqf";

I'm using "this" instead of the name of a marker because i was just testing with game logic before I add a bunch to simpleCache.

Share this post


Link to post
Share on other sites

...got it now :)

if you change:

_this addAction ["Gather Intel", "Scripts\SP\Insurgents\GatherIntel.sqf"];

to:

(_this select 0) addAction ["Gather Intel", "Scripts\SP\Insurgents\GatherIntel.sqf"];

this should work finaly.

Share this post


Link to post
Share on other sites
Hey Zlin Could you give me the brake down and a Sample code of what you did, and what triggers and task's You used, See I need this for a single player client side mission and not on a server so Please if you could Help me with this thanks.

For single player, I found that just using this in a trigger or script works just fine:

If I spawn a group with this code:

nul = ["mkr",2,10,[true,false],[false,false,false],false,[10,0],[3,0],"default",nil,nil,1] execVM "LV\militarize.sqf";

Then I can use this in a trigger or script and see the group count for the spawned group:

hint format ["LVgroup1 cnt: %1", (count units LVgroup1)];

One thing to note though is that this count is what the team leader of LVgroup1 thinks is the number of units in his group, not that actual count necessarily. There will be a slight delay between the time a unit is killed and the time that the team leader becomes aware of the unit being killed.

Share this post


Link to post
Share on other sites
...got it now :)

if you change:

_this addAction ["Gather Intel", "Scripts\SP\Insurgents\GatherIntel.sqf"];

to:

(_this select 0) addAction ["Gather Intel", "Scripts\SP\Insurgents\GatherIntel.sqf"];

this should work finaly.

Thank you so much, it works like a charm :D *gives you all my internets*

One more question, this time about simpleCache, I know what to write to make the spawn array but i can't for the life of me figure out where i'm meant to save said array. I went trhough the whole of the example mission and didnt see the array anywhere :/

When i say spawn array i mean this bit :P

//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"; 

Share this post


Link to post
Share on other sites

Thats an new simpleCache version I wrote for spunFIN.

you have to download it from here: http://na-palmplace.net/downloads/simpleCachev2.zip

should be extracted in the "\LV\LV_functions" directory, so it sits beside the other ones.

It don't requires to call ANY militarize or fillHouse script beforehand. Handles all internally but therefore needs this array to work.

greetings Na_Palm

Share this post


Link to post
Share on other sites

Yeah I see, but what is confusing me is i don't know where to put the array, does it go in LV_fnc_simpleCachev2.sqf somewhere? is it saved as another .sqf? There isn't any example missions using V2 that i can find :(

This is my current array btw, hoping it works cos 76 calls will be a pain in the ass to change xD http://pastebin.com/fY6LeaKt

Edited by Blasturbator

Share this post


Link to post
Share on other sites

simply put it directly before you use the execVM.

---------- Post added at 19:34 ---------- Previous post was at 19:30 ----------

have now looked into the pastebin...

seems to be right in that way. Didn't controlled every parameter.

Share this post


Link to post
Share on other sites

if you have it that way, as in the pastebin file it should work.

execVM, this one:

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"; 

Share this post


Link to post
Share on other sites

Sorry for being a pain but i just don't understand, could you show me an example or a screenshot of it?

Share this post


Link to post
Share on other sites

ok, the simplest way:

put this in a new file called "initsimpleCachev2.sqf", saved in the directory of your mission:

//aissp spawn array

_sC_Scripts = [ 
[1,["east1",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",1]],
[1,["east2",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",2]],
[1,["east3",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",3]],
[1,["east4",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",4]],
[1,["east5",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",5]],
[1,["east6",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",6]],
[1,["east7",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",7]],
[1,["east8",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",8]],
[1,["east9",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",9]],
[1,["east10",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",10]],
[1,["east11",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",11]],
[1,["east12",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",12]],
[1,["east13",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",13]],
[1,["east14",2,150,[true,false],[true,false,true],false,[12,30],[0,2],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",14]],
[1,["east15",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",15]],
[1,["east16",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",16]],
[1,["east17",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",17]],
[1,["east18",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",18]],
[1,["east19",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",19]],
[1,["east20",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",20]],
[1,["east21",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",21]],
[1,["east22",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",22]],
[1,["east23",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",23]],
[1,["east24",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",24]],
[1,["east25",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",25]],
[1,["east26",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",26]],
[1,["east27",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",27]],
[1,["east28",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",28]],
[1,["east29",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",29]],
[1,["east30",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",30]],
[1,["east31",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",31]],
[1,["east32",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",32]],
[1,["east33",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",33]],
[1,["east34",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",34]],
[1,["east35",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",35]],
[1,["east36",2,100,[true,false],[true,false,true],false,[8,12],[0,1],"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",36]],
[2, ["east37",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",37]],
[2, ["east38",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",38]],
[2, ["east39",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",39]],
[2, ["east40",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",40]],
[2, ["east41",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",41]],
[2, ["east42",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",42]],
[2, ["east43",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",43]],
[2, ["east44",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",44]],
[2, ["east45",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",45]],
[2, ["east46",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",46]],
[2, ["east47",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",47]],
[2, ["east48",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",48]],
[2, ["east49",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",49]],
[2, ["east50",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",50]],
[2, ["east51",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",51]],
[2, ["east52",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",52]],
[2, ["east53",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",53]],
[2, ["east54",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",54]],
[2, ["east55",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",55]],
[2, ["east56",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",56]],
[2, ["east57",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",57]],
[2, ["east58",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",58]],
[2, ["east59",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",59]],
[2, ["east60",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",60]],
[2, ["east61",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",61]],
[2, ["east62",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",62]],
[2, ["east63",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",63]],
[2, ["east64",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",64]],
[2, ["east65",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",65]],
[2, ["east66",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",66]],
[2, ["east67",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",67]],
[2, ["east68",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",68]],
[2, ["east69",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",69]],
[2, ["east70",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",70]],
[2, ["east71",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",71]],
[2, ["east72",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",72]],
[2, ["east73",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",73]],
[2, ["east74",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",74]],
[2, ["east75",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",75]],
[2, ["east76",2,true,2,50,50,"default",nil,"nul = [this] execVM 'LV\GatherIntel.sqf';",76]]
];

nul = [_sC_Scripts,[p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16],800,true,false] execVM "LV\LV_functions\LV_fnc_simpleCacheV2.sqf";

and then call this file with:

nul = [] execVM "initsimpleCachev2.sqf";

in an gamelogic or in your "init.sqf" or "initserver.sqf".

if you use "init.sqf" or "initserver.sqf" you can also delete the beginning "nul = " part.

Share this post


Link to post
Share on other sites

Yay, i understand it now :D

And as is typical of scripting, a new problem has arisen, It's now saying that the V2 scripts can't be found, which makes no sense because they are definitely there.

Share this post


Link to post
Share on other sites

check if they are in:

<your mission folder>\LV\LV_functions\LV_fnc_simpleCachev2.sqf

and

<your mission folder>\LV\LV_functions\LV_fnc_removeGroupV2.sqf

Share this post


Link to post
Share on other sites

I found the problem, inside simplecachev2 it was referencing them as being in addons\lv\lv_functions. I removed the addons\ part and now its not showing any more errors. But AI aren't spawning in D: Do i need to do something with the markers other than name them?

Here is a dropbox link to the mission in case you feel i'm a lost cause https://www.dropbox.com/s/dq93zgl15hakud1/Insurgency.Altis.7z

You don't need to fix it for me or anything, but it'll make it easier for you to find my problem probably :confused:

(The execVM is in a game logic at the blufor base)

Edited by Blasturbator

Share this post


Link to post
Share on other sites

ok, finaly found it out.

Error on my end.

If you want to change it for your self change the following in simpleCachev2.sqf line 39+40:

old:

if(_mp)then{if(isNil{LV_GetPlayers})then{LV_GetPlayers = compileFinal preprocessFile "LV\LV_functions\LV_fnc_getPlayers.sqf";};};
waitUntil {!isNil{LV_GetPlayers}};

change to:

if(_mp)then{if(isNil{LV_GetPlayers})then{LV_GetPlayers = compileFinal preprocessFile "LV\LV_functions\LV_fnc_getPlayers.sqf"; waitUntil {!isNil{LV_GetPlayers}};};};

The waitUntil there should be included into the if then conditional.

As the error only arises if you have "_mp = false" or don't have LV_GetPlayers compiled beforehand, i have missed it till now...

Will put the new version of the archive online in a few minutes.

greetings Na_Palm

---------- Post added at 02:20 ---------- Previous post was at 02:05 ----------

new corrected version of simpleCachev2 online.

grab it here: http://na-palmplace.net/downloads/simpleCachev2.zip

greetings Na_Palm

Share this post


Link to post
Share on other sites

Well it's all working in the editor, but when i host the mission on mp i'm getting two errors, they both say there is an undefined variable, one is in the call line of my spawn array and the other is in line 159 of LV_fnc_simpleCachev2.sqf

The spawn array line:

nul = [_sC_Scripts,[p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16],800,true,false] execVM "LV\LV_functions\LV_fnc_simpleCacheV2.sqf";

I'm pretty sure _sC_Scripts is defined as the array.

The simplecache line 159-161:

				if ((_x distance _posOfScriptMrkr) < _distance) exitWith {
				_needSpwn = true;
			};

And i thought _x didn't need to be defined because its floating or something?

The scripts both work 100% in the editor preview, but when exported to an mp mission it kicks up those errors.

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

×