Is there a way to attach a script so that the item could be carried as a misc item, and the menu accessed from there without putting it down?
I know the problems you're about to run into with this.
Once a misc item is in your inventory, you cannot make its onactivate block run again while it is still in there. Or, its onequip block. Its a pain in the ass.
To use the item again, you could do - -
- require the item to be put on the ground before use.
- hijack the ONDROP block. hehe!!!! I did this recently, and its nice. What you have to do is, at the end of the ondrop block, when you're done menuing and farting around with the player, you delete the original item and add a new one.
Here's a segment of known-good code I'm using to hijack an ondrop block on a misc. item for my own purposes. There is no provision to allow the player to actually drop the item to the ground, but you could add it via a messagebox menu.
scn PhalanxPassCardRedSCRIPT; This script runs 3 different-named items. Globals used: PhalanxWeapIdent PhalanxWeapIdent2 PhalanxWeapIdent3ref containerbegin ondrop playerset container to GetContainerif container returnendif ;player put the item into a container/teammate/vendorif PhalanxWeapIdent == 0 set PhalanxWeapIdent to 1 if PhalanxWeapIdent2 == 0 showmessage PhalanxIdentONMSG set PhalanxWeapIdent2 to 1 endif Playerref.additem PhalanxPassCardRedON 1 1else set PhalanxWeapIdent to 0 if PhalanxWeapIdent3 == 0 showmessage PhalanxIdentOFFMSG set PhalanxWeapIdent3 to 1 endif Playerref.additem PhalanxPassCardRedOFF 1 1endifplayerref.additem Pencil01 1 1playerref.removeitem Pencil01 1 1disablemarkfordeleteend