Forum Jump :

Author Message


Posts: 29
Rank:


Level: Member

Country: au
Location:
Occupation:
Age:
In-game name:

 
#186082 Posted at 2016-02-01 02:17        
     
Alright so far if i have this in the init. It calls the menu
nul = [] spawn {waitUntil {!alive player}; 
[player] call BIS_fnc_respawnMenuInventory;};

The thing is once you click spawn it doesn't actually spawn you with the actual loadout. It seems like it's missing a function to actually remove current items and add the new ones.

Once that is solved, I think the next thing to do is to just call a script that waits for you to die a second time before calling the spectator script.
I have no idea how to see what other functions is calling BIS_fnc_respawnMenuInventory, but Phantom_wolf seems to be good at that XD

Added 23 minutes later:

ok so it turns out if I use
[player] call BIS_fnc_respawnMenuInventory;
after i've already selected my loadout in the menu...it magically adds the gear. So what I did was just add a crate with
this addAction ["Confrim Loadout", {[player] call BIS_fnc_respawnMenuInventory;}];
The initial 2 lines of code
nul = [] spawn {waitUntil {!alive player}; 
[player] call BIS_fnc_respawnMenuInventory;};
Still need to be in the init, otherwerwise the scroll wheel action obviously won't work on the new crate.

We are so close guys! Hopefully phantom_wolf's inital code where it waits for the player to be killed a second time can just be added.

I've also moved the code from the init to an external .sqf, leaving it in the init causes the rest of the code below the waituntil to not run in my mission (I have further code adding markers etc)

Added 12 minutes later:

The code below isn't calling the spectate script on the second death :( Any suggestions.
nul = [] spawn 
{
waitUntil {!alive player};  //Initial death thanks to respawnonstart = 1; This lets us call the loadout menu
[player] call BIS_fnc_respawnMenuInventory; //Calling the loadout menu
waituntil (alive player);// Waits until the player is alive
waituntil (!alive player); //Waits until player has first offical death
waituntil (alive player); //Waits for the player to respawn
call ace_spectator_fnc_setSpectator; //Calls the spectate function
};

Added 5 hours 45 minutes later:

UPDATE

Ok so I have a clunky version working!!!!!!!!!!!!!!

SQF Executed from Init:
nul = [] spawn 
{
waitUntil {!alive player};  //Initial death thanks to respawnonstart = 1; This lets us call the loadout menu
[player] call BIS_fnc_respawnMenuInventory; //Calling the loadout menu
["spectate.sqf","BIS_fnc_execVM",true,true] spawn BIS_fnc_MP; //Load other script that waits for unit's second death
};

Spectate.sqf called by above script:
sleep 30; //Wait 30 seconds so the spectate function isn't called straight away whilst choosing loadout
nul = [] spawn 
{
waitUntil {!alive player};   //Wait for player to die in combat
call ace_spectator_fnc_setSpectator; //Send user to spectator mode
};

Unfortunately after the specate script is called, the player still respawns back at the BASE. I dont know how to disable the respawn after the intial death. So i think I will just wait for the player to die, then teleport the player to somewhere far away from the starting area.

This post was edited by danjoo (2016-02-01 08:40, ago)