Jump to content

How to print variables from a perk's "Add Activate Choice"?


Cogneter

Recommended Posts

Reposting from the Nexus forums, in case I get a faster reply here.

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 iValue

The 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 GECK 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
end

When 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".

 

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.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use