Author Topic: Vanishing Penalty Icons?  (Read 416 times)

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Vanishing Penalty Icons?
« on: February 12, 2015, 08:08:18 pm »


               

I've a strange little issue going on with the icons that appear next to the PC's portrait.  I have an event that decreases the PC's ability score using:


 


        effect eChange = EffectAbilityDecrease(STRENGTH, 3);

        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eChange, oPC);


 


This works exactly like it's suppose to.  When I want to increase or decrease the penalty I'm using:


 


   eBad = GetFirstEffect(oPC);

 


   while(GetIsEffectValid(eBad))

    {

        if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE)

        {

            RemoveEffect(oPC, eBad);

        }

        eBad = GetNextEffect(oPC);

    }


 


and then I again use the above snippit of code with the new penalty.


 


That works as well, BUT the Strength Decreased Icon next to the PC's portrait vanishes even though the Strength is decreased (as seen on the character sheet.)  When I save/load the game at this point, the Icon returns.   


Any help?  Is there a better--more proper--way of doing this that doesn't kill the icon?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Vanishing Penalty Icons?
« Reply #1 on: February 12, 2015, 09:23:25 pm »


               

Delay the new penalty application by a short while like 0.3, should work



               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Vanishing Penalty Icons?
« Reply #2 on: February 12, 2015, 09:40:47 pm »


               

Indeed it did.  Thanks.