Jump to content
Sign in to follow this  
wolffy.au

Cached Units with Vehicle Support - v2.0

Recommended Posts

Guest
There you go boys!

Version 2.1

- Added group setVariable ["crB_disableCache", true]; to disable caching on groups

I am having trouble as this caching script is deleting a unit (objective) and is causing the task to be completed. I'm assuming the code above will sort out this issue but I don't know where to use it:confused:

Could someone tell me where to put this bit of code:

["crB_disableCache", true];

Thanks in advance to anyone that helps:)

EDIT: Think I figured it out: _war1 setVariable ["crB_disableCache", true];. Will this work in multiplayer?

Edited by Guest

Share this post


Link to post
Share on other sites

Hard to tell what you mean, but if _war1 is your unit, it should be:

(group _war1) setVariable ["crB_disableCache", true];

And yes, it works in multiplayer.

Share this post


Link to post
Share on other sites

Is there any way to keep the "units cached" hint from appearing? I don't want players knowing that they're near enemies.

Also I'm using script-spawned AI so not only are the hints a dead giveaway, they get annoying.

Other than that, this is a great script! Excellent for cleaning up missions.

Never mind that, I got it to work properly!

Cheers :cheers:

Edited by RangerPL

Share this post


Link to post
Share on other sites
Never mind that, I got it to work properly!

Ah, this was what I was lookign for - how do I disable the hint for unit caching (not the first one that contains the total unit count, but the one on the left of the screen) ?

Any help appreciated.

@Wolffy - great script mate, many thanks for this.

Share this post


Link to post
Share on other sites

The script was originally designed for dedicated server, so I didn't add a debug parameter (cause hints don't show up in dedi).

To disable the hints, you need to search the SQF file for the word 'hint' and comment it out using '//' at the beginning of the line.

Share this post


Link to post
Share on other sites

How would this work with something like the I44 units, does it take the groups from a list of groups for east or something or does it save the units it removes?

Share this post


Link to post
Share on other sites

Saves the units it removes.

To be honest, this script may become obsolete soon, if Noubernou's methods prove to be more effective. But in the meantime, it should work fine on I44.

Share this post


Link to post
Share on other sites
Saves the units it removes.

To be honest, this script may become obsolete soon, if Noubernou's methods prove to be more effective. But in the meantime, it should work fine on I44.

Thank you, this will prove useful then. :)

Share this post


Link to post
Share on other sites

Hey Wolffy, has this new version fixed the script lag issue the previous one had?

Share this post


Link to post
Share on other sites

I hope so :)

I'm still testing it - have taken Nou's word for it that it works at this point. Will post here once I have the results.

Share this post


Link to post
Share on other sites

Hi,

I tried your script today and noticed something strange:

Most of the groups I place in the editor without waypoints start to run to some random position a few hundred meters away when I start the mission.

It seems like this isn´t a problem in your code but some new ai behaviour, because when I use the RMM_Reducer from Rommel they do the same.

I include a sample mission:

http://www.mediafire.com/?852yzuqix29ftj6

When I start the mission, the USMC unit starts to run to a place near the airport and the russian one stays at its starting point.

Edit:

When I create a waypoint for the USMC group he first runs to his random spot and then moves to the waypoint.

Edit2:

Just tested it: The remaining unit is fleeing (tested with fleeing _unit) when all his friends disapear.

Edit3:

I have inserted two lines of code into the fsm:

At "Cache Units" :

_cep_grp allowFleeing 0;

before the group is deleted

and

At "Normalise Units":

(group _cep_leader)  allowFleeing 0.3;

as last line.

This way it works even when the AI skill is low. I would like to set the allowFleeing to the value it was before the unit is cached but I don´t know how to get the number.

Edited by Melmarkian

Share this post


Link to post
Share on other sites

Yeah, its a good point. I've never thought of it as a bad thing, but its the AI's natural behaviour when they feel overrun.

I will take into consideration your code, as its probably worthwhile putting in there.

Share this post


Link to post
Share on other sites

hi wolffy,

Thanks for all your scripts there are very good, so i have a question, you say we must write this in the init :

0 = [500] execVM "modules\CEP_Caching\main.sqf";

but in your demo mission you use this :

[500] call compile preprocessFileLineNumbers "modules\CEP_caching\main.sqf";

why?

And i find a trouble, if at the start of mission i removeweapons at guys and i add via script, if i go far they disapear , you script work but after they lose their weapons. AND if in my group (east) i grouped a west guy, after the script other guys kill him.

thanks

Share this post


Link to post
Share on other sites
hi wolffy,

Thanks for all your scripts there are very good, so i have a question, you say we must write this in the init :

0 = [500] execVM "modules\CEP_Caching\main.sqf";

but in your demo mission you use this :

[500] call compile preprocessFileLineNumbers "modules\CEP_caching\main.sqf";

why?

And i find a trouble, if at the start of mission i removeweapons at guys and i add via script, if i go far they disapear , you script work but after they lose their weapons. AND if in my group (east) i grouped a west guy, after the script other guys kill him.

thanks

The difference between the two execution methods is execVM will spawn a process of and continue with the current SQF in parallel. BIS scheduling, as I found out recently is a little broken in that the more parallel processes you run, the worse the performance gets exponentially.

The second method will not continue through the existing script until the called script has finished. The allows you to wait for it to complete before trying to give more work to the scheduler.

Your second question is a BIS bug I have noticed previously. To get around it, I had to create the unit and then re-add them to the gruop for their side to be correct. I suspect with the future changes of this script, I won't be deleting/recreating units anyway, so it shold go away.

Share this post


Link to post
Share on other sites
BIS scheduling, as I found out recently is a little broken in that the more parallel processes you run, the worse the performance gets exponentially.

Do you have anymore info on this?

Is the gameengine loosing track of the script after awhile?

Any details would be very helpful.

Share this post


Link to post
Share on other sites
Do you have anymore info on this?

Is the gameengine loosing track of the script after awhile?

Any details would be very helpful.

I think this is what you're after:

http://ace.dev-heaven.net/wagn/Breaking_out_of_the_scheduled_scripting_prison

No, the game engine won't loose track of the script. Have a read of the article and let me know if it makes sense. :)

Share this post


Link to post
Share on other sites

yeah that made sense, kindof explains why domination games after a few sucessfull AO´s begin slow beheaviour when crowded server etc.. more and more as the mission goes on.

I was concerned the compiled file kindof suffered from defrag of some sorts, making it error out in the long run, but since its in ram mem i asumed before it was not.

The project looks very promising from the discussion on google wave, only read some of it.

Share this post


Link to post
Share on other sites

Is this compatible with UPSMON? If it is, how was it made compatible?

Share this post


Link to post
Share on other sites

Wolffy.au,

Is it possible you could give this scripting newbie (and potentially others?) a tip on how to remove the debug message portion of your script? I've tried editing portions I thought were relevant, but to no avail. The script is working well in its original state, I'd just like to run the mission now without the debug part :)

Share this post


Link to post
Share on other sites

I'm assuming its the hint you want to remove?

modules\CEP_Caching\main.sqf, remove or comment the following line:

        hint format["MSO-%1 CEP Caching # %2", time, _str];;

Share this post


Link to post
Share on other sites

how do you get rid of the hints that pop up on the sides in game?

Share this post


Link to post
Share on other sites

Hi all

Is there a good way to temporarily stop the caching and return all cached groups to normal strength? Basically what I want to do is have the caching running in normal circumstances, but disable it every 15 mins so that Hetman Artificial Commander can scan the battlefield and set waypoints - for this, the groups need to be normal strength otherwise it will make incorrect decisions. Then, re-enable (or restart) the caching.

This is for use in single player.

So I had thought maybe create a sqf and execVm a it on a 15 min repeating trigger:

(group _x) setVariable ["crB_disableCache", true] forEach allGroups;

then call the HAC stuff;

wait until HAC has completed;

re-enable caching;

However I am not certain what the best way is to re-enable the caching. Set it false for allGroups? Empty the array? Empty it and add the player group? Does altering the disabled array like this mean that groups in that array become instantly normalized via the loop in the fsm?

Any pointers gratefully received.

JJ

Edited by jiltedjock

Share this post


Link to post
Share on other sites

I haven't looked at this stuff for a long time now. I ended up moving both CEP Caching and another type, Nou's Caching into MSO. Nou's has the advantage that the AI numbers stay the same, so something like HETMAN continues to work correctly.

BTW - we integrated HETMAN into MSO, so you may be better off just using MSO to do what you're trying to do, and just disable all the other modules.

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
Sign in to follow this  

×