Jump to content

Recommended Posts

its like this, sometimes ai spawns, sometimes not, sometimes ai despawn sometimes not, sometimes the correct numbers spawn some times i get doubble triple numbers.. i dont know why.. but the thing is it's not allways some times it works as it should.. kind of the same problems people has been talking about here some pages back.

Share this post


Link to post
Share on other sites

spunFIN, just what I have been looking for to help run my missions at high fps throughout. Great work! I do have a problem in MP and there are so many post on this and Armaholic forums I could not look through all of them to see if this issue have been talked about but in militarize and fillhouse when I add vehicles sometimes it seems like they just keep adding up, will start with 2 helo's spawning, then 3,4,5,6 seems like they would just keep coming if I didn't end the mission. I have adjusting what I can think of and sometimes it will seem to work fine but most times they just keep adding up. Here is what I entered:

[Red4,2,50,[true,false],[true,false,false],true,[12,4],[1,0],""default"",nil,nil,4] execVM ""LV\militarize.sqf"";";

with this:

";nul = [[4],[player],400,true,true] execVM ""LV\LV_functions\LV_fnc_simpleCache.sqf"";";

Both are put in with gamelogic

Any ideas would be great.

Share this post


Link to post
Share on other sites

I'd like to be able to use AISSP and Simplecache in conjunction with crB unit caching to handle caching of units create outside AISSP. To stop groups being handled by crB, i need to use "group setVariable ["crB_disableCache", true];" this is not hard to add to militarize or fillhouse so that any groups it creates are automatically given this variable. Where would I have to change Simplecache so that the groups it creates (both when it creates the cached groups, and when it recreates the full groups when players get in range) so that they also receive this variable.

Would one place be after

call compile format["_grp = LVgroup%1;",(str (_ids select _i))]; //get group

by adding

_grp setVariable ["crB_disableCache", true];

and what other places would this need to be added?

if((isNil("LVgroup"+(str (_ids select _i))+"spawned"))&&(_inRange))then{
		//hint format ["CREATING: LVgroup%1",_id];
		if(_script == "militarize")then{ 
			call compile format["nul = %1 execVM 'LV\militarize.sqf';",_params];
		}else{
			call compile format["nul = %1 execVM 'LV\fillHouse.sqf';",_params];
		};
		call compile format["LVgroup%1spawned = true;", (_ids select _i)];

Could I add

call compile format ["%1 setVariable ['crB_disableCache',true", LVgroup"+(str (_ids select _i))+"spawned"];"

Share this post


Link to post
Share on other sites

Wondering if anyone has run into an issue with empty vehicles? I'm using militarize with simplecache, as well as ambient combat on it's own. I'm wondering simplecache is caching vehicles/crews but the crew isn't getting back into the vehicle on respawn.

Share this post


Link to post
Share on other sites

Cache script has some compatibility problems with Real Weather script (http://www.armaholic.com/page.php?id=23507). When running both scripts units dont despawn after you leave Cache Zone. Though they do despawn initially (on mission start).

I wonder whats the problem.

Share this post


Link to post
Share on other sites

I don't use Real Weather script, I use randomWeather (which I wrote :)) and have had no problems with it. I figured it out with some help from spunFin as well.

Basically it wasn't the caching, it was Ambient Combat and the LV_fnc_removeAC call using Style 2 (Kill the units). It was killing all the crew in a vehicle when it was called, but not deleting/destroying the vehicle. So if the players happened upon the vehicle they had a brand new enemy vehicle sitting there. I simply changed the LV_fnc_killAfterDelay.sqf to read as follows:

//ARMA3Alpha function LV_fnc_killAfterDelay v0.1 - by SPUn / lostvar
//kills unit after random delay, used by LV_fnc_removeAC.sqf
private ["_unit","_delay"];

_unit = _this select 0;
_delay = _this select 1;

sleep random _delay;
if(vehicle _unit != _unit)then{(vehicle _unit) setDamage 1;};
sleep 1; 
_unit setDamage 1;

Seems to blow up the vehicles just about all of the time.

Share this post


Link to post
Share on other sites

I guess that wasn't the weather script. Seems like there is a small chace that units will not despawn. Or I'm doing something wrong.

Share this post


Link to post
Share on other sites

One way to troubleshoot is to uncomment the two hints in the simpleCache script. Should be lines 79 and 90 where you can hint when groups are created and deleted.

Share this post


Link to post
Share on other sites

Hey i really need some help:confused:. I registered just to make this post. I love the scripts they are some of the most helpful tools around. The problem is i can't get them to consistently work in multiplayer. I do everything correctly but still get the error message on start up "'X' script not found".They work fine in singleplayer and the editor. I have tried everything for 3 days now with a group of friends and have found no solution. Any help would be greatly appreciated. If you need any more information at all i can give it to you. posted this on the other forum aswell. thanks

Share this post


Link to post
Share on other sites

simpleCache looks to be broken. Here's what I have.

nul = [this,2,300,[true,false],[true,false,false],false,[50,50],[3,3],0,nil,nil,1] execVM "LV\militarize.sqf";

nul = [[1],[unit1],1000,true,false] execVM "LV\LV_functions\LV_fnc_simpleCache.sqf";

Here's the RPT

Error in expression <LVgroup1CI = ['militarize',[L Alpha 2-2:1,2,300,[true,false],[true,fal>

Error position: <Alpha 2-2:1,2,300,[true,false],[true,fal>

Error Missing ]

Share this post


Link to post
Share on other sites

simpleCache isnt broken you have an error in your expression. My community use this script and it works fine

Share this post


Link to post
Share on other sites

I've actually been trying to track down something with simpleCache as well. I've found is that if a militarize area that gets cached includes vehicles, everything will de-spawn correctly. But when the militarized area respawns as players move within range it will respawn the correct number of units but will spawn some un-crewed vehicles as well. These vehicles don't appear to be getting added to the proper group because if you then move back out of range, all infantry and crewed vehicles will despawn, but the spawned un-crewed vehicles will not.

This leaves a bunch of empty and open enemy vehicles just sitting there for the taking. I'm trying to figure out where the problem is, but haven't been able to pinpoint it yet.

Share this post


Link to post
Share on other sites
simpleCache isnt broken you have an error in your expression.

I haven't modified the scripts, I'm even using the Flash app to generate the execVM lines.

I will correct myself that it's not the simpleCache, its militarize when I add an ID at the end. with nil it works fine, with an ID number it gives the error and simpleCache doesn't cache it.

The example mission for simpleCache works fine, though some other errors pop up.

Edited by Outlawz7

Share this post


Link to post
Share on other sites
I've actually been trying to track down something with simpleCache as well. I've found is that if a militarize area that gets cached includes vehicles, everything will de-spawn correctly. But when the militarized area respawns as players move within range it will respawn the correct number of units but will spawn some un-crewed vehicles as well. These vehicles don't appear to be getting added to the proper group because if you then move back out of range, all infantry and crewed vehicles will despawn, but the spawned un-crewed vehicles will not.

This leaves a bunch of empty and open enemy vehicles just sitting there for the taking. I'm trying to figure out where the problem is, but haven't been able to pinpoint it yet.

same problem here, vehicles are empty on activated zones.

Share this post


Link to post
Share on other sites

I compared my mission with the simpleCache example and the only thing different was that the target was a marker (mine was 'this' as in the game logic where I put the line). I used a marker instead of an object; no errors and militarize gets cached.

:smiley-punched:

Share this post


Link to post
Share on other sites

Mine are all set on markers as well, let me test using a dummy object or game logic and see if that fixes it.

---------- Post added at 21:21 ---------- Previous post was at 20:30 ----------

Alright, well I just tested using both a GameLogic object and a dummy object (a pencil) as the center points for my militarize script and I'm still getting empty vehicles. On the plus side, I think I have a possible explanation. I believe it has something to do with crews for vehicles and how vehicles are removed when the cache runs deleteVehicle.

I don't believe the vehicles that are created are considered part of the group/ID of militarize units that are spawned. Because of that, there's a need in the simplecache 'cleanup script' to check every 'unit' in the group to see if the objects vehicle name is the same as the object name:

if(vehicle _x != _x)then{deleteVehicle (vehicle _x);};

If vehicle _x and _x are not equal, it means the unit is actually sitting inside another vehicle and the two will have different names, so it then deletes the vehicle that _x is sitting in.

This could possibly be causing empty vehicles to be left behind. Perhaps when the vehicle is originally created, for some reason it never gets a crew, so when the cleanup check runs, there are no units in the group that ever get checked that are in the vehicle, so it will never get deleted. It's basically orphaned out and just left there until a player hops in.

To be honest, I've no idea if that's really the issue, or how to fix it if it is, but maybe it'll help someone else figure it out.

Edited by Meatball

Share this post


Link to post
Share on other sites

Hey everyone! o/

I must apologize that I've been away few months and left this drifting around.

I found couple hours time today to work on the bugs you people have reported about (thanks Meatball for pushing me :D ), and I think here's a quick fix for vehicle & amount bugs of simpleCache:

http://forums.bistudio.com/showthread.php?165089-AI-Spawn-Script-Pack&p=2588051&viewfull=1#post2588051

(Also militarize updated a bit so that simpleCache will remove abandoned vehicles.)

I'm hoping to find soon some more time for this so that we could finally get it all updated and push the promising simpleCacheV2 out. Thanks for your support and patience. :)

Outlawz7,

Where are you calling militarize? Try to name the object/unit where you call it and use its name as first parameter of militarize call (instead of 'this'). For example name your object/unit as milTarget, and:

nul = [milTarget,2,300,[true,false],[true,false,false],false,[50,50],[3,3],0,nil,nil,1] execVM "LV\militarize.sqf";

quatr0,

What does your folder structure look like? Should be for example: ...Documents\Arma 3\missions\MyMission\LV\

DudeGuyManBro,

In simpleCache you can choose if it respawns every unit each time, or only the ones which was left alive before despawning (keep count -parameter).

Edited by spunFIN

Share this post


Link to post
Share on other sites

Outlawz7,

Where are you calling militarize? Try to name the object/unit where you call it and use its name as first parameter of militarize call (instead of 'this').

I am doing this now and it works. Excellent scripts btw.

edit: I grabbed the new scripts and gave them a try. Problems with caching persist.

Here's what I did:

gamelogic named drp, in init field:

nul = [drp,2,500,[true,false],[true,false,false],false,[10,0],[1,0],0,nil,nil,1] execVM "LV\militarize.sqf"; nul = [[1],[player],1500,true,false] execVM "LV\LV_functions\LV_fnc_simpleCache.sqf";

I start outside the cache distance. Units get created correctly, then cached. I then move into the radius and units get multiplied on spawn. I move out, units don't get cached or only some get cached, I move in, they start multiplying.

I do move into and out of the radius with a teleport radio trigger:

onMapSingleClick "player setpos _pos; onMapSingleClick ''; true;"

, but I tried militarize without vehicles and teleporting in and out spawned and despawned the infantry units correctly.

edit2: this doesn't happen when using the same two commands with the civilian side(!), both infantry and vehicles get spawned and despawned correctly, although after the first despawn and spawn one unit seems to be missing (counted 10+1car as in the command before first cached, then 9+1car afterward.)

Edited by Outlawz7

Share this post


Link to post
Share on other sites

I _think_ I might have pinned down the problem with empty vehicles popping up. First, definitely use the new files that spunFin listed above as they fix some other bugs. But I was still seeing empty vehicles popped up. I narrowed it down that it appeared the vehicles were spawning, but crews were not being created for them, so they'd just sit there empty and the cache script would bypass them for cleanup because they'd not have any crew in them.

What _seems_ to have fixed it for me was a minor tweak to one of the functions. In LV_fnc_fullLandVehicle.sqf there are two 'sleep 2;' commands on lines 58 and 60. If you comment those out (put two backslashes in front of the line) it seems to fix the non crew problem for me. That block should look like this:

_vehicle allowDamage false;
//sleep 2;
if(((vectorUp _vehicle) select 2) != 0)then{ _vehicle setvectorup [0,0,0]; };
//sleep 2;
_vehicle allowDamage true;

At least in all my testing so far I haven't noticed any empty vehicles showing up, but if some other folks having the issue want to try it and see if it fixes it, I'd be interested to know if it works for you as well.

My completely uneducated guess is between the vehicle being spawned and a crew being spawned that 4 second delay causes a hiccup when other vehicles are being created as well and a vehicle or two just gets bypassed for crew creation...

Share this post


Link to post
Share on other sites

Outlawz7,

Ahh yes, in your case it seemed to handle everything too fast and that might be the issue for multiple spawnings. As in Meatballs case everything happens too slow, it's sometimes hard to think it all logically. :P

Here's new fix: http://lostvar.com/arma3/simpleCacheFix/fix2/

-Now it should not spawn extra units due to too fast loop

-Included Meatballs fix for empty vehicles

-Caching starts without extra delay and should work lot better now with multiple zones

-It also loops quicker now, so with 20+ zones you should not get ~3min delays on spawn/despawn anymore

Share this post


Link to post
Share on other sites

Well, it seems to works with 10 infantry and 1 vehicle, but breaks and starts multiplying on large numbers (75+75 inf, 25+25 veh).

Also, does the multiplayer parameter in simplecache work? I never saw it working on local whereas it worked with an array of named units.

Edited by Outlawz7

Share this post


Link to post
Share on other sites

Hi all,

great set of scripts spunFIN, thanks for putting so much effort into them.

I've been having trouble getting the syntax correct so that an infantry group which is originally spawned by the reinforcement chopper script, later calls the LV_fnc_follow.sqf script by means of a trigger. The trigger fires when the infantry group, called LVgroup1, has a certain knowsAbout value of the player called s1. So I want the enemy group to chase the player, but only if they have actually spotted him/her to begin with.

My first question would be, is this possible and second of all, how might the script call look?

Share this post


Link to post
Share on other sites

I have a proof of concept mission with nothing other than a rifleman and a Game Logic unit with a fillHouse script taken directly from the app. I am positive the LV folder is in place. However, I get the error

Script LV\fillHouse.sqf not found

Why is this happening?

Thanks for the help

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

×