Miltiades Posted February 7, 2007 Share Posted February 7, 2007 Have you added the new global boolean variable to globalcat.2da, and saved that modified 2DA file in your override folder? Scripts cannot use new globals unless they are defined in that 2DA file. Yes, I did all that, thought I didn't know, in the 2DA file, what type it was. It just typed in Boolean. If that's also right already, try inserting a line like... SendMessageToPC(GetPartyLeader(), "DEBUG: TRIGGER RUNS!"); ... as the first line inside the main() function block in the OnEnter script of the trigger. Then (in-game) walk where the trigger should be and check the feedback screen. If "DEBUG: TRIGGER RUNS!" is posted in the feedback log then the trigger is properly configured at least. If not, then there is something wrong with how you've created the trigger. Done that, and it says "DEBUG:TRIGGER RUNS!". So it's properly configured, but it still doesn't want to activate the dialog. Link to comment Share on other sites More sharing options...
stoffe Posted February 7, 2007 Share Posted February 7, 2007 Done that, and it says "DEBUG:TRIGGER RUNS!". So it's properly configured, but it still doesn't want to activate the dialog. Hmm... then I would guess that either the tag of the NPC or the name of the DLG file is set incorrectly. Also, have you run the script that sets the Global Boolean to TRUE before walking onto the trigger? If that's not the problem, does the NPC who should talk to the player when triggered exist in the area already, or are you spawning it in at the same time? If you are spawning it you'll need to delay the conversation by half a second or so to allow the NPC to be properly created before issuing it actions. Link to comment Share on other sites More sharing options...
Miltiades Posted February 7, 2007 Share Posted February 7, 2007 If that's not the problem, does the NPC who should talk to the player when triggered exist in the area already, or are you spawning it in at the same time? If you are spawning it you'll need to delay the conversation by half a second or so to allow the NPC to be properly created before issuing it actions. The NPC already exist in the area. Something of possible importance is that the dialog file can't be attached to him because he already has another dialog file. Not that this is a problem, because with the script you gave me before, the dialog file doesn't have to be attached to the NPC. Also, have you run the script that sets the Global Boolean to TRUE before walking onto the trigger? Yes, I linked the script with a node in a previous dialog file. Link to comment Share on other sites More sharing options...
stoffe Posted February 7, 2007 Share Posted February 7, 2007 The NPC already exist in the area. Something of possible importance is that the dialog file can't be attached to him because he already has another dialog file. Not that this is a problem, because with the script you gave me before, the dialog file doesn't have to be attached to the NPC. Hmm, strange. Try moving the Feedback Debug line you added down to to the bottom of the main() function block instead, just above the last } character. Does it still get printed to the feedback screen when you trip the trigger? Link to comment Share on other sites More sharing options...
Miltiades Posted February 7, 2007 Share Posted February 7, 2007 No, it doesn't... Link to comment Share on other sites More sharing options...
stoffe Posted February 7, 2007 Share Posted February 7, 2007 No, it doesn't... Hmm, strange. Insert the debug feedback printout between the two If-statements at the top to see which of the conditions is blocking the script execution... Also try adding this debug line at the top of the script: SendMessageToPC(GetPartyLeader(), "VALUE = " + (GetGlobalBoolean("[color=Yellow]MY_TRIGGER_VAR[/color]") ? "TRUE" : "FALSE")); Change the yellow part to the name of your new global boolean, and check the feedback log in the game. If it says "VALUE = FALSE" in the Feedback log after the trigger should be active there is something wrong with how you set the variable. Link to comment Share on other sites More sharing options...
Miltiades Posted February 7, 2007 Share Posted February 7, 2007 Hmm, strange. Insert the debug feedback printout between the two If-statements at the top to see which of the conditions is blocking the script execution... Nothing appears in the Feedback when I put the debug line between the two If-statements. Also try adding this debug line at the top of the script: SendMessageToPC(GetPartyLeader(), "VALUE = " + (GetGlobalBoolean("[color=Yellow]MY_TRIGGER_VAR[/color]") ? "TRUE" : "FALSE")); If it says "VALUE = FALSE" in the Feedback log after the trigger should be active there is something wrong with how you set the variable. Where exactly do I need to put this? I've put this as the first line in the main() function block, but nothing appeared in the Feedback. Edit: Oh yeah, did it matter that I used both lines at once? Link to comment Share on other sites More sharing options...
stoffe Posted February 7, 2007 Share Posted February 7, 2007 Nothing appears in the Feedback when I put the debug line between the two If-statements. Hmm, strange. Try replacing the line... if (GetEnteringObject() != GetPartyLeader()) ...with... if (GetEnteringObject() != GetFirstPC()) ...and see if that makes a difference. I can't see why it should, but it seems like this line is blocking the script for some reason. You are running this script from the triggers OnEnter event, right? Where exactly do I need to put this? I've put this as the first line in the main() function block, but nothing appeared in the Feedback. It should have worked if you insert it as the first line of the main function block. If it didn't, are you sure you recompiled the script and put the NCS file in the MOD or override? If it's on the first line there should be nothing blocking its execution if the script gets fired at all. Link to comment Share on other sites More sharing options...
Miltiades Posted February 7, 2007 Share Posted February 7, 2007 You are running this script from the triggers OnEnter event, right? Yep. Using the Debug line together with the Value line in one script doesn't give any problems, does it? Link to comment Share on other sites More sharing options...
Miltiades Posted February 7, 2007 Share Posted February 7, 2007 Okay, the "Debug:Trigger Run!" can again been seen (I think I have to make my trigger area bigger, 'cause I think that's why I couldn't see the Debug line before. So I think the "if (GetEnteringObject() != GetPartyLeader())" isn't wrong). On the other hand, the Value line also worked, but gave "Value=False". So I did something wrong with the variable then? Link to comment Share on other sites More sharing options...
stoffe Posted February 7, 2007 Share Posted February 7, 2007 On the other hand, the Value line also worked, but gave "Value=False". So I did something wrong with the variable then? If you have run the script that should enable the trigger then the global variable should be set to TRUE. If it's not, then you probably either have a typo in the variable name in either of the scripts or in globalcat.2da, or the script that sets the boolean/enables the trigger is not run properly (check that there are no typos when you specify the script name in the DLG file, and that it isn't longer than 16 characters). Link to comment Share on other sites More sharing options...
Miltiades Posted February 7, 2007 Share Posted February 7, 2007 Everything is filled in correctly. No typos, neither in the scripts nor in the 2DA. The name of the scripts are no longer than 16 char.,and in the dialog file, the script has the correct name. But I was wondering, do I have to put something in the String Param column in the dialog file? Link to comment Share on other sites More sharing options...
stoffe Posted February 7, 2007 Share Posted February 7, 2007 Everything is filled in correctly. No typos, neither in the scripts nor in the 2DA. The name of the scripts are no longer than 16 char.,and in the dialog file, the script has the correct name. But I was wondering, do I have to put something in the String Param column in the dialog file? Hmm, very odd. You could try to modify the script where you set the global to immediately print out the value of the variable it just set to the feedback log to see if the error lies there. As for script parameters in the dialog, that depends on how the script you are using is made. If it uses the string parameter for something you may need to fill it in. If you use the standard game scripts in TSL for setting globals you set the variable name there. How does the scripts you currently use look? Link to comment Share on other sites More sharing options...
Miltiades Posted February 8, 2007 Share Posted February 8, 2007 It may sound weird now, but it worked! I don't know if it's because I put the name of the trigger (utc file) in the String Param, or if it's because the trigger square didn't work (the dialog only started when I walked exactly at the spot where I got my coordinates). It's really strange, because not only does the trigger activate just on that one spot, the Debug en Value line can only be seen when on some places of the square I made, and the Value actually says False. It's still not what it has to be, and I think the geometry has something to do with it. But it's a start. Edit: Fixed the geometry thing, now it works like a charm Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.