Jump to content
⚠ Known Issue: Media on User Profiles ×

Cogneter

Supporter
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Cogneter

  1. In response to post #23243514. Why not strike a deal with copyright holders? For example, they allow Nexus users distribute copyrighted assets on the Nexus site in exchange for a small royalty, or an ad space on the mod's page. Some developers might even agree to a free non-commercial distribution of their assets to increase their brand's recognizability, or just out of common decency. :)
  2. I don't think there's a way to do it besides scripting, so better scripting tools would come in handy. :smile: It seems what you are looking for is the onFire event, which you need to put in a script attached to your gun. I imagine the code would look something like this: scn GunScript ref rTarget begin onFire set rTarget to GetCrosshairRef rTarget.PushActorAway player 1000 endNote that GetCrosshairRef is a function added by NVSE, so you'll need NVSE for the function to work. If you would prefer to do it with vanilla functions, you could use a combination of GetPos, GetAngle, SetPos, SetAngle and math functions. This mod has the code that does that.
  3. It seems you didn't define the variable "actor". I don't think the function "gettarget" exists either. I recommend getting The GECK 1.4 PowerUp - it's a nice GECK upgrade that will show you the scripting errors when it doesn't save the script.
  4. Yup, you're right. I declared some temporary variables in a quest and was able to use them. Less than optimal, but I can work with that. For the reference, I changed the code in my perk to: set STUNuQuest.tmpTest to 42 MessageEx "MessageEx: The value of iValue is %g" STUNuQuest.tmpTest PrintToConsole "PrintToConsole: The value of iValue is %g" STUNuQuest.tmpTest ShowMessage STUNuTest STUNuQuest.tmpTestWhen activating the perk, the output was as expected: 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". Apparently, MessageEx and PrintToConsole weren't showing up because they didn't receive a matching number of parameters (iValue being null). Thanks senterpat, you really helped!
  5. 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.
×
×
  • Create New...