Author Topic: Why would this very simple script decide not to work?  (Read 370 times)

Legacy_simomate2

  • Full Member
  • ***
  • Posts: 133
  • Karma: +0/-0
Why would this very simple script decide not to work?
« on: March 28, 2013, 04:15:22 am »


                When you first meet the NPC, this variable is set.
#include "x3_inc_skin"
void main()
{
// Find the PC //   
object oPC = GetPCSpeaker();   
//The Variable being set //   
SetSkinInt(oPC, "npc_elf_allahRS", 15);}

Then theres' a text that only appears if this variable is lower then 11
----------------------------------------------------------------------------
#include "x3_inc_skin"int StartingConditional()
{   
// Get the PC who is involved in this conversation   
object oPC = GetPCSpeaker();
    // Check a local variable.   
if ( GetSkinInt(oPC, "npc_elf_allahRS") >= 11 )        return FALSE;
    // If we make it this far, we have passed all tests.   
return TRUE;}
---------------------
But for some reason, whenever I test it the message that appears under that condition keeps appearing despite the fact the variable should still be 15. The exact same script works for a different NPC so why wouldn't it work for this one?
               
               

               


                     Modifié par simomate2, 28 mars 2013 - 04:28 .
                     
                  


            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Why would this very simple script decide not to work?
« Reply #1 on: March 28, 2013, 04:41:10 am »


               Are both scripts on the correct tabs in the conversation editor?
Have you rebuilt your module scripts since you have done this?
Might try adding a debug message to see what the script actually thinks the value is.

SendMessageToPC(oPC,IntToString(GetSkinInt(oPC,"npc_elf_allahRS")));

Put that right after you define object oPC, but before the if statement.

Sorry, if the answer is more obvious and I am missing it.
               
               

               
            

Legacy_simomate2

  • Full Member
  • ***
  • Posts: 133
  • Karma: +0/-0
Why would this very simple script decide not to work?
« Reply #2 on: March 28, 2013, 05:45:11 am »


               Oddly after I added that to the script it worked properly. And then, when I removed it from it it continue to work. Strange.
               
               

               
            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Why would this very simple script decide not to work?
« Reply #3 on: March 28, 2013, 06:14:48 am »


               Hmm, yay!