Jump to content

Master script?


Tagaziel

Recommended Posts

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

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 1

then

When (item) is activated in the gameworld

Display (itemdescription)

 

Alternatively...

 

If variable ADMmode is 1

then

When (item) is activated in the inventory menu

Display (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

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

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

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

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

  • Recently Browsing   0 members

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