Search the Community
Showing results for tags 'messageex'.
-
This is starting to drive me crazy, and I'm really hoping one of the scripting gurus can help me. I'm creating a mod that adds a perk. The entry point of that perk is "Activate", and the function is "Add Activate Choice". This allows me to run a script whenever the player character interacts with another NPC. And all was going well, until I tried outputting a variable ("player.GetAV Strength" in my case) for debugging purposes. This is when things turned ugly - I could not. After a couple hours of researching, this is the code I have come up with: int iValue set iValue to 42 MessageEx "MessageEx: The value of iValue is %g" iValue PrintToConsole "PrintToConsole: The value of iValue is %g" iValue ShowMessage STUNuTest iValueThe message inside "STUNuTest" is "Test %g". So I start the game, activate the perk, and here are the results I get: 1) MessageEx doesn't show up. 2) PrintToConsole doesn't output anything in the console. 3) ShowMessage displays the following: "Test 0". "Ok", I thought to myself, "perhaps my G.E.C.K or FNV are broken, or my NVSE is installed incorrectly". Then I tried the exact same code from above, but put it in the script of a quest, like this: scn STUNuQuestScript begin gamemode int iValue set iValue to 42 MessageEx "MessageEx: The value of iValue is %g" iValue PrintToConsole "PrintToConsole: The value of iValue is: %g" iValue ShowMessage STUNuTest iValue endWhen I start the game, this is what I get: 1) MessageEx outputs "MessageEx: The value of iValue is 42" on the screen. 2) PrintToConsole outputs "PrintToConsole: The value of iValue is 42" in the console. 3) ShowMessage displays the following: "Test 42". :mellow: My questions are: Is there something wrong with the scripts inside the perk's "Add Activate Choice" that prevents them from passing variables and calling NVSE functions? If yes, is there any workaround that would allow me to output variables from there? If no, is there a perk-less alternative that would allow me to assign an "Activate" event to all NPCs? I'm launching both FNV and G.E.C.K with nvse_loader.exe.
-
So I've been having issues with this mod I'm building. After several hours of bug testing, I narrowed down where the problem was, and a created a new test script to eliminate the rest of my code as a variable. The test mod consists of a quest that loads on game start and has the following script attached: scn TestMessageEx int DoOnce Begin GameMode if DoOnce != 1 player.additem TinCan01 1 ;to verify the mod has been loaded let DoOnce := 1 endif if IsControlPressed 5 ;when player taps the activate key if player.IsSneaking MessageEx "You Sneaky Devil!" player.additem caps001 2 else player.additem caps001 1 endif endif EndThe script works as expected when not sneaking. The player gets a free cap each time the activate key is pressed. However, if I press the activate key while sneaking, the script to go into a loop of displaying the "You Sneaky Devil!" message and giving the player 2 caps, between 6 to 9 times. Coming out of sneak mode does not break the loop. IsSneaking probably not at fault, because I can replicate the problem by using IsWeaponOut, and my original script uses a completely different trigger. Now here's the weird part. If I comment out either ; MessageEx "You Sneaky Devil!"or ; player.additem caps001 2the looping problem goes away! I get 1 message or 2 caps. As a final note, I still get this bug if I deactivate all other mods and DLCs to the point where only FalloutNV.esm and my test mod are running. Does anybody know what's going on? If not, can you test this script out to see if you get the same bug so I'll know I'm not going crazy? Edit: More info (if it helps). MessageEx is not the problem. The same extra loops happen if I use ShowMessage with a message form in "fly" mode (message appears in the top left corner). 'Message box' mode functions without issue. It's like the activate control is being triggered by the fly message. Is there a way to clear the control buffer before using IsControlPressed or something? I'm stumped. Edit 2: Ok, so it's not IsControlPressed 5 in particular, Using IsControlPressed 0 (forward) instead results in the same extra loops. I would suspect the script is running so fast that the Control buffer doesn't have time to clear before IsControlPressed is called a second time, only there's no problem when I don't display a fly message. In fact, with 1 less command, the second half of my IF block should run just a little bit faster. Help me internet. You're my only hope...
