AI Teammates Location Persistence (SOLVED)

  1. ‹ Older
  2. 8 years ago

    Cool. Thanks man. It's weird that the script actually still half works if respawnonstart = 0 is required. I'll give it a go and link the Dropbox file if it's still giving me fits. Thanks a ton.

  3. The script in this thread is definitely not working for me. Same deal. F2 and F3 AI slots still always spawn at base. F4, F5 and F6 slots do spawn with me where I last saved. Strange. Spyder sent me this and it does seem to "fix the problem" in the one test I ran:

    waituntil {(player getvariable ["alive_sys_player_playerloaded",false])};
    sleep 10;
    {
        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;

    So I guess that's good. But my gear is still not saving even with respawnOnStart = 0

    Here's my mission PBO. I'd love for someone to take a look at it for me to see if I missed anything. If my required mods are needed, I also included a readme:

    https://www.dropbox.com/s/vmuwi6rnie5n8u9/Reshmaan_Province_Afghanistan.pbo?dl=0

  4. Does the same thing happen with vanilla?

  5. Edited 8 years ago by HeroesandvillainsOS

    Vanilla? What's that? :)

    I haven't tried man. I definitely can. It just seems the people in this thread that use the script and respawn settings I do use a decent amount of mods too. And me being new to all this, I'm leaning towards it being a "me setting things up wrong" issue rather than a mod conflict.

  6. Just to elaborate on that, I had a look at your files and I can't see anything wrong with them. I've got the same ones in a mission I'm running with virtually no differences and it works fine. The only thing I can think of is some mod somewhere messing about with the loading times or something in the mission itself. So two tests:

    1. Run without mods.

    2. Create a different, simple, unmodded ALiVE mission with all the persistence stuff set up properly, test that, make sure it works, then try it again with the scripts added in.

    If you've already done that then let me know the results! I can try to send you a template I've made with those scripts and you can see if it works on your setup.

  7. Edited 8 years ago by HeroesandvillainsOS

    So just to be clear, your exact loadout that you saved with loads when you continue your mission? Everything from your helmet to ammo to guns and grenades are all at the values they were saved at? I just want to make sure what I'm expecting to load with me when I continue a mission is what's supposed to happen with ALiVE persistence.

    I'm also surprised all your AI units spawn with you on mission load too with the script in this thread. The only one that has ever worked for me was with the one test I did last night with Spyder's script adjustments I just posted. But then again, the one posted further up has worked but fails I'd say around 80% of the time so maybe this one will too. Something fishy must definitely be going on with one of my mods then, especially if you think the scripts I'm using look clean.

    If you have a template you think may be worth me testing, I'll definitely try it. Otherwise I can try a vanilla Altis one with no scripts and test this stuff one by one. I'd like to get this sorted out because I'm thinking of releasing this. Just have to get these bugs ironed out.

  8. I don't really have an unmodded mission to throw your way, but yes, everything loads as I left it for me. No issues. I imagine it would be a mods issue.

  9. Edited 8 years ago by HeroesandvillainsOS

    Have you ever tried 3CB at all?

    And I have almost every mod imaginable. I doubt you could send anything my way that I couldn't immediately play. I'd love to take a test run on one on my server and see how server saving and exit works for me and see where it leaves me on mission load.

  10. Yup but not with ALiVE. Can't imagine it would be that though.

  11. Edited 8 years ago by HeroesandvillainsOS

    Yeah. Just grasping at straws here. I'll try a vanilla one and see where it leaves me. If you have anything you know is working will all/most of these scripts I'd definitely like to try it on my server too (it would save me time from having to set something up), but no worries if you don't send one. Thanks for looking at the scripts for me.

  12. Deleted 8 years ago by HeroesandvillainsOS
  13. Edited 8 years ago by HeroesandvillainsOS

    It seems like I may actually have some report errors going on. Davidoss from BIS forums just generated a report for me using the same mission I linked above and he's right, there is alot of errors. I'll share this in the Intel script thread as well because I'd have to imagine I wouldn't be the only one getting this error spam from it (it's not the only one causing errors, mind you).

    Whether it's the source of my teleport issues too I obviously can't say without trying vanilla but I figured it would be worth sharing with you guys.

    http://pastebin.com/JW3vZSPr

  14. Edited 8 years ago by HeroesandvillainsOS

    Just a heads up to anyone using this. With the Eden Editor, I think this script conflicts with the new option to right click on the player in the editor and change their gear via the Virtual Arsenal. The player initially does load their stored gear on mission start for a *split second*, but when the AI teleport in, most of the gear reverts to default. That's too bad. If anyone knows a way around this that would be much appreciated.

  15. So your gear, persisted from a previously saved game, was overwritten (after being equipped) by default gear?

    Might be an issue with ALIVE persistence post update

  16. @SpyderBlack723 So your gear, persisted from a previously saved game, was overwritten (after being equipped) by default gear?

    Might be an issue with ALIVE persistence post update

    No. This happens on mission start in the SP editor (I mean it also happens on mission start on my server too and also when I use a persisted save. It happens any time I start the mission with any method I choose). I've set my playable guy to load my gear from the Virtual Arsenal in Eden (right click on player, load Virtual Arsenal gear). The second the mission starts or is continued with persistence, my guy is wearing the correct Virtual Arsenal gear. However, a second later when my AI teammates teleport in, my gear reverts back to the default 3CB EOD Day Patrol stuff.

  17. Edited 8 years ago by HeroesandvillainsOS

    I *think* I know what the problem with gear is. Can someone smarter than me humor me for a second?

    When this script is running, are all units (the playable units and AI teammates) technically "respawning" even on mission start? If so, I think this would explain it: https://forums.bistudio.com/topic/188187-eden-retain-custom-spawn-loadouts-after-respawn/

    I definitely feel like the AI is respawning but I can't tell if the playable unit is.

    If that sounds like what's happening here, do you think R3vo's onPlayerRespawn.sqf and onPlayerKilled.sqf adjustments would work (and play nice with this script in this thread?)?

    Quote:

    onPlayerRespawn.sqf

    [player, [missionNamespace, "inventory_var"]] call BIS_fnc_loadInventory;

    onPlayerKilled.sqf

    [player, [missionNamespace, "inventory_var"]] call BIS_fnc_saveInventory;
  18. Could be.. . check the description.ext file for this setting - respawnOnStart

    respawnOnStart = 1; //Respawn on start. Run respawn script on start.
    respawnOnStart = 0; //Dont respawn on start. Run respawn script on start.
    respawnOnStart = -1; //Dont respawn on start. Don't run respawn script on start.

    https://community.bistudio.com/wiki/Description.ext#respawnOnStart

  19. Edited 8 years ago by HeroesandvillainsOS

    I'll check. Pretty sure I removed respawnonstart = -1 since I use save player location in the ALiVE Data module. Should I put it back in and try the new adjustments I posted?

    This should probably be a question for R3vo but does "missionNamespace" need to be my mission name? So for example, Takistan_Mission.Takistan or what have you?

  20. Edited 8 years ago by SavageCDN

    Yeah I would try putting it back and test.

    missionNamespace is like a place to store variables for that mission only - once the mission stops you lose anything stored there.. KK has a good description:

    Mission namespace is the main default partition that exists from the moment you load the mission to moment the current mission ends. All variables defined in mission namespace will cease to exist when you are back in the lobby. If you want your variables exist longer you can use different namespaces

    edit: and to actually answer your question - no you would use 'missionNamespace' not your actual mission name

  21. So I didn't try the edits R3vo mentioned but the same thing with my correct gear appearing temporarily and then reverting back to default happens with -1 and 0 (which is what it was originally at, I just checked) for respawnOnStart.

    In the editor, I ungrouped my AI teammates from me just to test and it works completely fine when I do that. My Arsenal gear loads perfectly when I start the mission alone and ungrouped.

    I'm going to stick by the theory that this script treats all players as if they're respawning when grouped on even on mission start.

    I'll try R3vo's adjustments at some point. I have a feeling it will work correctly when I do that. Just a guess but it seems logical.

    Why BIS gives us an option to load custom gear and then reverts us when respawning is sort of stupid.

 

or Sign Up to reply!