Author Topic: Text Appears Check  (Read 323 times)

Legacy_Kingdom_Of_Hearts

  • Full Member
  • ***
  • Posts: 142
  • Karma: +0/-0
Text Appears Check
« on: September 20, 2013, 04:46:06 am »


               It compiles, however the text does not display. It's supposed to, even though it's checking for not having the feat and gold. Help? '<img'> Thanks.

 int StartingConditional(){
   //Here we are checking for the gold amount with variables..    object oPC = GetPCSpeaker();    object oVa = GetItemPossessedBy(oPC, "VariableHolder");
    int nSkill = GetLocalInt(oVa, "SkillLevel");    int nECL   = GetLocalInt(oVa, "ECL");    int nGP    = nSkill + nECL * 100 + 400 * nSkill + nECL;
    if ( GetGold(oPC) >= nGP || GetHasFeat(FEAT_SPELL_FOCUS_CONJURATION, oPC))        return FALSE;

    return TRUE;}
               
               

               
            

Legacy_Khuzadrepa

  • Sr. Member
  • ****
  • Posts: 347
  • Karma: +0/-0
Text Appears Check
« Reply #1 on: September 20, 2013, 04:41:37 pm »


               Try swapping the FALSE and TRUE statements?

Another spot to look at is the equation that determines nGP. Are the order of operations correct?

I don't know exactly what you are trying to do, but those seem like the likely spots for an issue.

Hope that helps!
               
               

               
            

Legacy_Kingdom_Of_Hearts

  • Full Member
  • ***
  • Posts: 142
  • Karma: +0/-0
Text Appears Check
« Reply #2 on: September 20, 2013, 06:35:07 pm »


               That worked. Awesome!
               
               

               
            

Legacy_Kingdom_Of_Hearts

  • Full Member
  • ***
  • Posts: 142
  • Karma: +0/-0
Text Appears Check
« Reply #3 on: September 20, 2013, 07:39:06 pm »


               Getting confused and loss with these checks quickly. Can somebody confirm this; In the code below, if all the integers are true, but the GetHasFeat is not true, the text will appear?

if ( nB >= 2 || nC <= 1 || nD <= 1  || nP <= 6 || nR <= 6  || nS <= 2 || nW <= 1 )
       return TRUE;

if ( GetHasFeat(FEAT_EXTEND_SPELL, oPC) )
        return FALSE;

   return TRUE;
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Text Appears Check
« Reply #4 on: September 20, 2013, 10:01:00 pm »


               No, in this snippet, if any of the int evaluations is TRUE, OR if oPC does not have the feat the text will appear.
               
               

               
            

Legacy_Kingdom_Of_Hearts

  • Full Member
  • ***
  • Posts: 142
  • Karma: +0/-0
Text Appears Check
« Reply #5 on: September 22, 2013, 07:13:40 pm »


               Great. Got that part to work! This is for an alternate option, this text is supposed to appear. However, I've found that it's not working. I've not been able to spot some errors. The text is supposed to appear if oPC doesn't have more or equal gold, or if they have the feat, or if the integers don't return true. Is this correct?

if ( GetGold(oPC) >= nGP )
       return FALSE;

  if ( nB >= 2 || nC >= 1 || nD >= 1  || nP >= 6 || nR >= 6  || nS >= 2 || nW >= 1)
       return FALSE;

  if ( GetHasFeat(FEAT_EXTEND_SPELL, oPC) )
       return TRUE;

   return TRUE;
}
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Text Appears Check
« Reply #6 on: September 23, 2013, 12:12:51 am »


               return  (GetGold(oPC) <= nGP) || GetHasFeat(FEAT_EXTEND_SPELL, oPC) || !  ( nB >= 2 || nC >= 1 || nD >= 1 || nP >= 6 || nR >= 6 || nS >= 2 || nW >= 1);