Mktavish Posted February 28, 2019 Share Posted February 28, 2019 Or possibly you need both blocks with those different events .So just add the green block I did and delete the event from the MenuMode block. scn PlayerStashPreLoadScript begin MenuMode if (GetGameRestarted)else returnendif SetOnKeyDownEventHandler PlayerStashHotkeyScript 1 14 end begin GameMode if (GetGameRestarted)else returnendif SetEventHandler "OnAdd" PlayerStashOnAddScript "second"::PlayerRef end The keydown event handler is working just fine. So possibly with the 2 different blocks , the 2 different type of events will trigger ??? Link to comment Share on other sites More sharing options...
dubiousintent Posted February 28, 2019 Share Posted February 28, 2019 @KiCHo666: Very helpful. Thanks. I hadn't even known about "Callback". Added that and "Aux Vars" to the 'TIP Do not overlook EventHandlers' entry under "Scripting" section of the wiki "Getting started creating mods using GECK" article. -Dubious- Link to comment Share on other sites More sharing options...
Mktavish Posted March 1, 2019 Share Posted March 1, 2019 Yes call back is very helpful ,,, but not helping the OP Of course an item added needs couple frames before it can be used in coding to then manipulate the logic stream. Which it did make me wonder ... how does the rItem and rContainer get set in those scripts ?Or get used ? Figure the EventHandler does atleast half of it ? Link to comment Share on other sites More sharing options...
dubiousintent Posted March 1, 2019 Share Posted March 1, 2019 "Which it did make me wonder ... how does the rItem and rContainer get set in those scripts ?" - Good question. I missed that. They are both supposed to be parameters passed to the UDF "PlayerStashOnAddScript" when it is called by the EventHandler. "rItem" is used in the UDF, but "rContainer" is not at all that I can see. (Not clear it is needed as a parameter in that case) Nor is there a check in the EventHandler that either parameter is valid before passing, nor that "rItem" is actually in "rContainer", before calling the UDF. Of course we haven't seen the script after implementing the Callback either. (And I would say Callback is an essential bit of help to the OP. Just have to get around the implementation hurdle now.) -Dubious- Link to comment Share on other sites More sharing options...
baddarkl Posted March 2, 2019 Author Share Posted March 2, 2019 Update here. I just did a clean install of New Vegas, only added NVSE, 4GB Patch, JIP LN, and Quick Use, and the OnAdd function of Quick Use still didn't work. I know it works for some people, but it just won't work for me, and I've given up the idea of doing this. Link to comment Share on other sites More sharing options...
Recommended Posts