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.