Jump to content

Photo
- - - - -

RscMissionDisplay and REVERT


  • Please log in to reply
3 replies to this topic

#1 Jedra

Jedra

    Warrant Officer

  • Members
  • 2048 posts

Posted 20 March 2012 - 11:40 AM

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?
Jedra's Addons
Arma 2 : Enhanced Skills Slider
Take On Helicopters : Take On Taxi | Jedra's Time Trials | Weapon Indicators | No Radar

#2 Jedra

Jedra

    Warrant Officer

  • Members
  • 2048 posts

Posted 21 March 2012 - 12:54 PM

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.
Jedra's Addons
Arma 2 : Enhanced Skills Slider
Take On Helicopters : Take On Taxi | Jedra's Time Trials | Weapon Indicators | No Radar

#3 .kju -PvPscene-

.kju -PvPscene-

    Brigadier General

  • Members
  • 12275 posts

Posted 21 March 2012 - 01:12 PM

InitEH of XEH (AFAIK)



Current active projects: None :(

Maintained/assisted projects: IFA3, Blitzkrieg


Help: Got a crash? Report it! What is the RPT log file?


#4 Jedra

Jedra

    Warrant Officer

  • Members
  • 2048 posts

Posted 21 March 2012 - 06:33 PM

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!
Jedra's Addons
Arma 2 : Enhanced Skills Slider
Take On Helicopters : Take On Taxi | Jedra's Time Trials | Weapon Indicators | No Radar