Aller au contenu

Photo

Why would this very simple script decide not to work?


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
simomate2

simomate2
  • Members
  • 73 messages
 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 .


#2
Terrorble

Terrorble
  • Members
  • 194 messages
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.

#3
simomate2

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

#4
Terrorble

Terrorble
  • Members
  • 194 messages
Hmm, yay!