Tagaziel Posted November 10, 2010 Share Posted November 10, 2010 Let me finish: is it possible to create a script that will display a message box when an item is activated but doesn't need to be attached to the item in question? Link to comment Share on other sites More sharing options...
Cipscis Posted November 10, 2010 Share Posted November 10, 2010 By "activated", do you mean actually activated, as in the player walks up to it, aims at it, and presses the "activate" button, or clicked on in the player's inventory? Generally, it's much easier and very much more efficient to just attach a script to the form in question so that you can detect the activation. What exactly are you trying to accomplish? Cipscis Link to comment Share on other sites More sharing options...
Tagaziel Posted November 10, 2010 Author Share Posted November 10, 2010 I want to script item descriptions. 1. I've already created a variable toggling system, to toggle between Examine mode (which will display Messageboxes with descriptions) and Gameplay mode (no descriptions) 2. While I wanted to attach a script to every item to display a description, that's not going to happen. Many items have their own scripts attached and many share those descriptions. It'd bloat the mod quite a bit. 3. So, what I would like to accomplish is: If variable ADMmode is 1thenWhen (item) is activated in the gameworldDisplay (itemdescription) Alternatively... If variable ADMmode is 1thenWhen (item) is activated in the inventory menuDisplay (itemdescription) I can do the latter, except I can't figure out how to make it work without attaching the script to the item. Link to comment Share on other sites More sharing options...
Cipscis Posted November 10, 2010 Share Posted November 10, 2010 I think, in order to do this while the player is viewing items in their inventory, you'd need to utilise NVSE's UI-related functions. Unfortunately, I don't know much about how the UI is set up, so I couldn't tell you how to go about this. DarN or HugePinball would be two good people to ask, though, particularly if nothing much has changed since Fallout 3. When it comes to actually activating things (as opposed to clicking on them in the player's inventory), this could be done either via a perk, which would require the player to click through a menu when activating them so would be kind of clunky, or by using NVSE to detect when the player activates something and check what it is via GetCrosshairRef. However, you couldn't prevent the default action with this method yet, so it's probably not what you're looking for. Hopefully future versions of NVSE will make that possible though. Cipscis Link to comment Share on other sites More sharing options...
Tagaziel Posted November 10, 2010 Author Share Posted November 10, 2010 Wish I could test it. As it is, the latest patch that NVSE requires to work is anathema to polish versions of New Vegas - Steam refuses to update the game. :( I was thinking about using the GetCrosshairRef function and tying it with a hotkey, so, say, you're looking at a pistol, hit "U" and you are shown a description for it. Not sure if it's possible, though. Link to comment Share on other sites More sharing options...
Cipscis Posted November 10, 2010 Share Posted November 10, 2010 Yeah, that approach should work quite well. If I remember correctly, NVSE includes the form list functions from FOSE, which would make things easier. I'd recommend using two form lists - a list of items and a list of messages - which has each item's associated message at the same position in the message list as the item is in its list. That way, you can use IsInList to check if the item being looked at is in the items list, and if it is then grab its index via GetBaseObject and ListGetFormIndex, then use that to get the message via ListGetNthForm. In the meantime, you could use an older version of NVSE until you can get the update - that way you can still test stuff out. Cipscis Link to comment Share on other sites More sharing options...
Tagaziel Posted November 10, 2010 Author Share Posted November 10, 2010 Well, the problem is that I can't even run the first version. Steam simply doesn't update, even if set to update automatically. Link to comment Share on other sites More sharing options...
gsmanners Posted November 10, 2010 Share Posted November 10, 2010 I'm just tossing this out there, but they do have some new functions in FNV, like PlaceAtReticle. set bHasTarget to player.PlaceAtReticle EuclidTarget 1 0 20000 if (bHasTarget == 0) rPointer.Disable; rPointer.MarkForDelete; set nFailures to nFailures + 1; endif I notice that there's also a "ObjectUnderReticle" function. I wonder if that might help. Link to comment Share on other sites More sharing options...
Recommended Posts