Jump to content
Sign in to follow this  
CarlGustaffa

How do you deal with disableAI and saves?

Recommended Posts

Hi

Being relatively new to this, I have just become "aware" of one of the greater bugs in the engine/editor -- the fact that units which has been disabled using disableAI "MOVE", will be reset during saving.

I use MOVE, TARGET, and AUTOTARGET disabling A LOT! sad_o.gif Basically this means that my mission (2-4 hours of playtime using my playstyle) doesn't really work out as planned; Once I'm "on location" the units are no longer in the position and arrangement I gave them.

So, how do you cope with this?

And, is this another "feature by design" by BIS, or will this eventually be fixed? I'm just about ready to give up all together crazy_o.gif

Share this post


Link to post
Share on other sites

How do you activate the disableAI commands?

I am very unfamiliar with Single Player and thus Saving/Loading, but I would guess that scripts ran from the init.sqs/sqf or commands executed from the init lines of soldiers are ran again when you load?

If this is the case then simply executing in either of above mentioned options will disable the AI again upon load.

Share this post


Link to post
Share on other sites

I have this some unnamed units initfield:

this setUnitPos "MIDDLE"; this disableAI "MOVE"

When I want to cancel it, I use enableAI "MOVE" (and setUnitPos "AUTO" respectively).

When I click the savegame, it instantly starts to move. If I load that savegame, it also instantly starts to move. setUnitPos does not seem to be cancelled.

Just checked, and bugtracker lists it as a bug:

http://bugs.armed-assault.net/view.php?id=2419

Re-executing init lines doesn't sound like a good idea, think about all those addmagazine commands smile_o.gif Maybe I misunderstood you though.

I did try a singleplayer mission with sort of a fix for this, but it only gave limited saves and ruins one of the key features I like in ArmA over OFP -- unlimited saves for us that can't shoot straight but still would like to enjoy the game.

Share this post


Link to post
Share on other sites

Init commands are not run again after a save or load. Only at mission start.

The global variable time is reset to 0 after loading a game. So you could have a script check it every so often and execute commands when a game is loaded.

Info on time.

Share this post


Link to post
Share on other sites

rough code:

unit's initfield:

this execVM "disableAIMove.sqf"

disableAIMove.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_unit = this;

while {true} do

{

waitUntil {Time < 2};

_unit disableAI "Move";

sleep 1;

};

Share this post


Link to post
Share on other sites

Hmm, would this affect any laggyness? Also, how do I cope with units that have started moving, wouldn't they just stop when they shouldn't? Seems like a whole lot of global variables at work, considering the number of units this affects.

Have to rest a couple of days on this one... But thanks, nice suggestions.

Would unit stop true and false work better at least until the player is in the general area? At least I could work out "auto saves" that could work this way, but it won't prevent the "user saves" from going bad.

Frequent autosaves are annoying, and too rare autosaves with buggy usersaves, are extremely frustrating. How to determine the balance? Oh well..... Need sleep...

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  

×