Jump to content
Sign in to follow this  
kerozen

STHUD Icon Change

Recommended Posts

I'm trying to make a little script to change classes ingame. IE: Team Leader to Medic.

 

This is the code i use to change to the medic class:

Cmedic = {

player setVariable ["ACE_IsEngineer",0,true];
player setVariable ["ACE_isEOD",0,true];
player setVariable ["ace_medical_medicClass",1,true];
call CLimp;
};

This script works but the icon in STHUD doesn't change.

 

I've tried using:

player setUnitTrait ["Medic",true];

And it also didn't work. Does anyone know how i can do it?

 

 

Share this post


Link to post
Share on other sites

Since STHUD checks config values "engineer" and "attendant" you'll probably have to change the class of the unit itself. The only 'dynamic' class change happening are AT and MG types as they check the "UIPicture" config value of the players weapon. 

The reason your version doesn't work is because config values can't be changed of a unit (class) can't be changed mid-mission, since they're already loaded in.

 

Actually the above is no longer true for latest STUI version (which includes STHUD). It's now switched over to using pictures directly, and there's no longer a special icon for EOD/Engineers. They've also added a specific override value to make a unit an attendant:

player setVariable ["isatd_", typeOf(_unit)];

Try setting that variable instead.

 

MG and AT are still determined by checking value "UIPicture" of primary and secondary weapon respectively.

Share this post


Link to post
Share on other sites

 you'll probably have to change the class of the unit itself

 

Do you know how to change the class of the unit with a script?

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  

×