Sign in to follow this  
Followers 0
[RG] Salutesh

Reload scripts after respawn?!

3 posts in this topic

Hello Exile Community,

I need some help to get a little tweak fixed and maybe someone can help me.

I modified a little Action Menu System made by  Larrow (https://forums.bistudio.com/topic/182848-addaction-menu-system/) for Exie.

Here is a little preview:

preview.jpg.0b5d3f36bcae8fc440ed081d6609   preview2.jpg.205e54fd1f7e6173f76b505d71f

 

The script itself works very well but until the player dies and respaws the actions disapear and only comes back after a relog.

I tryed many things to reload the system after a normal respawn but i am also not a pro in coding and i still learning.

 

For better support here is my installation setup and all files:

Download Files from GitHub: https://github.com/salutesh/A3_Exile_ActionMenu/

Warning! No BE Filters ready yet!

 

Copy the addons folder into your Exile main mission folder and edit following files:

In your mission description.ext insert #include "addons\LARs\actionMenu.cpp" into your class CfgFunctions, so it looks like this:

class CfgFunctions 
{
	#include "addons\LARs\actionMenu.cpp"
};

 

In your mission init.sqf insert this or merge it, if you dont have a init.sqf just copy it over:

if (!hasInterface || isServer) exitWith {};

waitUntil {alive vehicle player};	
waitUntil {typeOF player != "Exile_Unit_GhostPlayer"};
uiSleep 2;

fnc_addon_actionmenu = Compile preprocessFileLineNumbers "addons\LARs\init_actionMenu.sqf";
call fnc_addon_actionmenu;

Thanks in advance for any help!

Share this post


Link to post
Share on other sites

Posted (edited)

You might want to check: 

https://community.bistudio.com/wiki/Event_Scripts

init.sqf is executed when mission starts. 

You probably want to add the code into: onPlayerRespawn.sqf instead, then when players are killed and respawn the menu would be executed locally on them again. 

Could you try that, see if that works out for you?

EDIT: Actually adding: 

Spoiler

fnc_addon_actionmenu = Compile preprocessFileLineNumbers "addons\LARs\init_actionMenu.sqf";
call fnc_addon_actionmenu;

Should be enough in: onPlayerRespawn.sqf.

Edited by ka0s

Share this post


Link to post
Share on other sites

Posted (edited)

16 minutes ago, ka0s said:

You might want to check: 

https://community.bistudio.com/wiki/Event_Scripts

init.sqf is executed when mission starts. 

You probably want to add the code into: onPlayerRespawn.sqf instead, then when players are killed and respawn the menu would be executed locally on them again. 

Could you try that, see if that works out for you?

Thank you for the response!

I thinked so also and tryed that already but then i just get multiply actions and also no menu actions on respawn.

Content of onPlayerRespawn.sqf:

fnc_addon_actionmenu = Compile preprocessFileLineNumbers "addons\LARs\init_actionMenu.sqf";
call fnc_addon_actionmenu;

Maybe i miss a eventhandler or a waituntil somewhere to get this to work but i dont get it.. :(

 

EDIT:

I also tryed this in onPlayerRespawn.sqf:

fnc_addon_actionmenu = Compile preprocessFileLineNumbers "addons\LARs\init_actionMenu.sqf";

waituntil {!isnull (finddisplay 46) && {alive player} && {typeOF player != "Exile_Unit_GhostPlayer"}};
if(uniform player != "Exile_Uniform_BambiOverall")then
{
	// Action Menu
	call fnc_addon_actionmenu;
};

I dont get multiply menus then on a normal spawn but no menu at dead/respawn.

Edited by [RG] Salutesh

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.