AI Teammates Location Persistence (SOLVED)

  1. 8 years ago

    Hi all, looking for some help on a single player / co-op scenario running on a dedicated server. I've got a mission running almost exactly how I want it with two exceptions. First is AI teammates. Basically, I'd like them to spawn with me at the start of the mission, wherever I end up. Persistence currently saves my location but that's not very helpful when all my AI team still spawn right at the base and I have to go back and pick them up. For things like Long Range Recon style missions or roaming guerrilla style missions, where I'd rarely go back to base, this breaks the immersion a bit. They are currently set up as playable so they respawn if killed after a time delay but this is non-essential. Is there a way to make their location alongside me persist?

    The second is Advanced Markers. I can't get them to save! Everything else works fine and it's not a massive issue, but for some reason they just won't stick around. I'm wondering if using ACE conflicts with it? Or if anybody knows any common reasons for them not saving?

    Awesome mod by the way, one of the coolest for any game that I've seen. Thanks in advance for the help!

  2. I have used ACE with the ALiVE markers and they don't conflict at all. Make sure you are 'ctrl+clicking' on the map to use ALiVE persistent markers. Also, the issue with your AI teammates not saving could be that they are not players, and they are not synced to the Profile system. Try synching them to the Virtual AI module.

  3. Edited 8 years ago by SpyderBlack723

    Doesn't persist AI locations, but if you put this code at the bottom of your mission's init.sqf they should teleport to you at the start of the mission (granted they are in your group)

    waituntil {(player getvariable ["alive_sys_player_playerloaded",false])};
    sleep 2;
    {
    	if !(isPlayer _x) then {
    		if !(_x getVariable ["Persistent_Teleport", false]) then {
    			_x setPos (getPos player);
    			_x setVariable ["Persistent_Teleport", true, true];
    			sleep .5;
    		};
    	};
    } forEach units group player;
  4. That's a good idea with syncing them to the Virtual AI system. Please report back if that works. Spyder and I have talked about AI teammate persistent locations in the past and from what I understand, it's not possible (but we never discussed how syncing them might or might now work) without a custom script.

    He briefly mentioned that he might be able to write something that could be used as a one time teleport for AI teammates at mission start. That would be cool.

    Regarding the ALiVE markers, I've never had an issue with or without ACE. Try going through every module and making sure Persistence is set to yes. I'm not sure if there's even an option for the markers in the modules but it's worth a look.

  5. Edited 8 years ago by HeroesandvillainsOS

    @SpyderBlack723 Doesn't persist AI locations, but if you put this code at the bottom of your mission's init.sqf they should teleport to you at the start of the mission (granted they are in your group)

    waituntil {(player getvariable ["alive_sys_player_playerloaded",false])}; sleep 2; {_x setPos (getPos player); sleep .5;} forEach units group player;

    And here he is. LOL! Ninja'd and given a present too!

  6. Edited it to only teleport AI once even if there are multiple players in the squad

  7. All, thanks for the replies. Spyder, your addons are incredible and I can't play without them now - and cheers to HeroesandvillainsOS for recommending them! The script works flawlessly too, absolutely what I was after.

    Re: the persistence issue, I do all the right stuff for the markers to save (ctrl click, persistence on in modules etc.,) but it seems they just don't for some reason. Logistics is a bit temperamental too. Not sure if I'm just not giving it time to load in (running test missions at the moment that last for a few minutes just to check everything is working as it should). What's the best way to debug this? Past a copy of the logs?

  8. Edited 8 years ago by HeroesandvillainsOS

    Spyder. Hey man this script works amazingly. I have a question though and wonder if this just may be an issue with ALiVE and vehicle location persistence.

    So I just tested this. I played for one hour with a 3CB vehicle and another hour with a Massi UKSF vehicle. In both instances, I played the mission, got out of the vehicle and server saved and exited. In both instances, when I restarted the server, I spawned at my last know location (with my AI teammates which is awesome) but the vehicles I had used had disappeared.

    I keep hearing that it's "impossible" for vehicle location not to persist as long as you enter and exit the vehicle, but I swear man I have everything that has the word persistence in it set to "yes" and vehicle persistence simply doesn't work with ALiVE. No matter the class, vehicles just vanish, literally vanish with ALiVE when you continue a mission.

    Is there any way around this with your script or ALiVE in general that you are aware of? I enter a vehicle. Exit. Restart the server and the vehicle is gone forever right now. With or without your script. No matter the mods.

    Now, all that said, these are vehicles that have been originally spawned wth your spawner module. If perhaps these are treated differently than manually placed vehicles, and not considered physical and salable objects with ALiVE, that could explain it. If you think it could be useful, I could definitely manually place some vehicles in my mission and try your script/server save and exit again.

  9. Edited 8 years ago by SpyderBlack723

    Will need some good old testing probably when devs who know how to analyze persistence logs can look at it.

  10. Have you got the virtualise all units except synced enabled in the Virtual AI module? For some reason that stopped vehicle persistence for me. Had major issues with it for ages. Just started working when I switched the module setting to virtualise only synced units.

  11. I am using the virtualized all units except synced option. Strange. I'll try changing it.

    Will that kill performance though?

  12. Edited 8 years ago by incontinenetia

    Shouldn't do, unless you use a lot of manually placed units. In which case, just sync them to the module.

    Edit: this also seemed to fix the marker persistence issue weirdly. No idea why but there we go!

  13. Are you using any vehicle mods at all? I'm gonna test this later with Massi's UKSF vehicles and 3CB.

  14. Rhs but doesn't seem to matter too much.

  15. @incontinenetia Rhs but doesn't seem to matter too much.

    Yep! That solved it. I love you so much!!! LOL!

    This has to be a bug so hopefully a dev sees this thread. Thank you so so much! With Spyder's new AI teleport script this is a dream come true! Thanks guys!

  16. No worries mate. Spyder, if you're still reading this thread, is there any way to make your script for teammate spawning work if the player dies and respawns back at base? Long shot, but I am not a very good player and keep dying!

  17. Edited 8 years ago by SpyderBlack723

    Like have them move back to base when you respawn?

    If so, in the root of your mission folder create a folder named onPlayerRespawn.sqf

    Inside that file put this code inside

    {
    	if !(isPlayer _x) then {
    		_x setPos (getPos player);
    		sleep .5;
    	};
    } forEach units group player;
  18. Ah awesome, thank you Spyder! I actually tried to make that script on my own but fucked it up. Cheers buddy, really appreciate all the help you've given me.

  19. Edited 8 years ago by HeroesandvillainsOS

    https://www.dropbox.com/s/uynxmbqkpw7alxg/Sangin_Patrol.hellskitchen.pbo?dl=0

    Could someone take a look at my files if they have a second? I currently have the script working when I restart the server (it saves my location and my AI teammates teleport to my location) but when I die, I'm respawning at my current position.

    I have respawn= "Base" so I'm not sure what I'm missing or if that's wrong. Perhaps I have the onPlayerRespawn.sqf provided in this thread set up wrong?

    EDIT: I forgot to place the respawn_west marker editor. I'll just go ahead and smack myself now. :)

  20. Hello buddy. Sorry it took a while. Try using respawn = 3; rather than respawn = base; in your description.ext.

  21. Newer ›
 

or Sign Up to reply!