Jump to content

OnAdd Event Handler Not Firing


baddarkl

Recommended Posts

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
return
endif
SetOnKeyDownEventHandler PlayerStashHotkeyScript 1 14
end
begin GameMode
if (GetGameRestarted)
else
return
endif
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

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

"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

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

  • Recently Browsing   0 members

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