Can inventory mouseover + hotkey press identify the inventor

Post » Sat Nov 20, 2010 7:03 pm

A little background first: I'm working on a mod resource, a bunch of scripts & activators really, that allows you to add clothing to new, predefined formlists, have the game walk through your inventory to check if what you're wearing is in those formlists & set a bunch of variables stored in a quest script accordingly. Eg, if I think an outfit looks badass, I can add it to a 'badass' list, & if I do the inventory walk with getequipped & isinlist checks, the game will 'remember' that what I'm wearing is badass & store that in the variable quest script - ie: 'player is looking badass atm'. Dependent plugins adding dialogue options, passing remarks, AI behavior etc can then check against that variable.
I've hit a snag, however, when it comes to identifying the outfit I want to add to the formlist. My first idea was to have an option in my little intro menu (that also holds the inv-walk & a reset option) activate a persistent container in a dummy cell, in which the outfit has to be placed manually, then run an Onactivate with flag & GetInventoryObject to identify the base form, then get it back in my inventory with removeallitems. Some way or another the Onactivate doesn't fire off though - always a pesky thing when you think you got it all covered & it turns out you just don't.
As an alternative, I'm considering using inventory mouseover + hitting a hotkey (like the repair function, really) as a way to identify the outfit that is going to be 'evaluated', which might speed things up in-game, even though it means one more hotkey to set & not forget. But I don't know if it's possible. Any ideas on how to go about this? I'm ok with defining a hotkey & checking whether it's pressed; it's the mouseover and identifying the object part that I can't figure out.
If that's too hard, I also welcome any help getting my first idea to work. Because I felt doing the 2 different activates right after another was guaranteed to fail I added a little timer & a doonce like this (maybe that's the problem, maybe it's something else):

scn DSCESIntroMenuTokenScriptint iButtonshort doonceshort ftimerbegin OnAddshowMessage DSCESIntroMsgendbegin GameModeset iButton to GetButtonPressedif iButton == -1	returnelseif iButton == 0 ; describe an item	DSCESContainerRef.activate player 0 ; open container	set ftimer to 2	set doonce to 1elseif iButton == 1 ; reset current evaluation	set DSCESCleanerRef.Cleaning to 1	DSCESCleanerRef.activate player 1	RemoveMeelseif iButton == 2 ; evaluate current clothing	DSCESEvaluatorRef.activate player 1	RemoveMeelseif iButton == 3 ; done	RemoveMeendifif doonce == 1	if ftimer > 0		set ftimer to ftimer - GetSecondsPassed	else		DSCESContainerRef.activate player 1 ; run container script		set doonce to 0		RemoveMe	endifendifend


The script on the container looks like this (there might be something superfluous in the first lines there):

scn DSCESContainerScriptref meref CESItemref CESItemBaseint CESItemTypeshort sApprovedbegin OnActivateset me to getself  ; me = the containerset CESItemBase to me.GetInventoryObject 0 ; identify the object in itset CESItemType to GetType CESItemBaseif CESItemType == 24 ; check if it's clothing	set sApproved to 1	player.additem DSCESMenuToken 1 1else	set sApproved to 0	showMessage DSCESNotClothingMsgendifRemoveAllItems player 1 ; give it back to the playerend


Any help much appreciated.
User avatar
RObert loVes MOmmy
 
Posts: 3432
Joined: Fri Dec 08, 2006 10:12 am

Return to Fallout 3