Jump to content
Sign in to follow this  
jedra

RscMissionDisplay and REVERT

Recommended Posts

Hi all,

I have a problem with the mod I released to display weapons and ammo...

I used the onload of the RscDisplayMission as a hook into my script which works very well. Unfortunately if the user reverts to a previous save or reverts to mission start, my script is killed but the onload trigger of RscDisplayMission is not fired. It seems that RscDisplayMission does not get unloaded when the mission is reverted to any point.

This is my class definition for RscDisplayMission;

class RscDisplayMission : RscDisplayEmpty {
onLoad = "_jedh = [] execVM '\x\jed_weapStatGUI\addons\jed_weapCheckGUI\init.sqf'; uiNamespace setVariable ['JED_RscDisplayMission',_this select 0]; ";
onUnload = "diag_log 'display unloaded';"; //Checking if it ever gets unloaded
class controlsBackground {
 class RscText_1000: RscText
 {
  idc = 1000;
  text = ""; //--- ToDo: Localize;
  x = 0.879439 * safezoneW + safezoneX;
  y = 0.0181822 * safezoneH + safezoneY;
  w = 0.11628 * safezoneW;
  h = 0.035255 * safezoneH;
 };
 class RscText_1001: RscText
 {
  idc = 1001;
  x = 0.475781 * safezoneW + safezoneX;
  y = 0.628143 * safezoneH + safezoneY;
  w = 0.0391679 * safezoneW;
  h = 0.0470066 * safezoneH;
 };
};
};

I have tried to use CBA instead, but again the general Init handlers do not fire when a mission is reverted within a mission. I can get it to work with 'getin' and 'getout' handlers, but unfortunately this doesn't help if the play starts in a vehicle.

Anyway, my question is;

Is there an event (either display or CBA) that I can utilise so I can re-initialise my script when a user reverts?

Share this post


Link to post
Share on other sites

Ok, never mind now, I discovered a better way of doing this using RscTitles instead! The key was to re-display the layer using cutRsc in my main loop. Should anyone want any further info then please feel free to PM me or post here.

Share this post


Link to post
Share on other sites

InitEH of XEH (AFAIK)

Share this post


Link to post
Share on other sites
InitEH of XEH (AFAIK)

Cool - useful to know for the future. As it happens I didn't need to get CBA to re-initialise.

Dialogs and the UI will be the death of me!

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  

×