Jump to content

Need help with permanent references to objects


Lukasfrost9

Recommended Posts

Hi there,

I've recently started modding New Vegas and I've been trying to make a mod that's essentially a fetch quest of a lot of different items.

Each item has a unique ID and has a quest marker leading to it. This would all be done in a single stage.

The issue I'm facing is that the markers are permanently tied to the initial location of the items.

So even when the item is picked up and/or consumed, the marker stays in that location.

Is there any way that I can remove a marker / set a condition that only when the items haven't been used/picked up, they show up on the map as a marker.

 

All of the items are tied using the Permanent Reference in their respective locations.

If someone could point me in the right direction, that'd be great.

Link to comment
Share on other sites

I've since tried adding each object to a list of references when they are picked up using this script

Begin onadd player


ref rCurrentRef
set rCurrentRef to GetSelf 
rCurrentRef.ListAddReference MyPlayerList


End

And in the quest conditional I use


IsRefInList MyPlayerList, INVALID =! 1.00

This makes it work as intended but the issue is that I'm getting a 30 fps drop as soon as the object is picked up.
I assume the conditional is getting overloaded because of the "INVALID" but I have no idea what to put in there as a form to not make it appear invalid/make the game not run slow.
Link to comment
Share on other sites

For your situation, you can use quest stages, quest objectives, or quest variables (a flag for each item that is set ON when the item is picked up by the player) to control quest markers.

Hi there, thanks for your response.

 

The issue I'm facing is that I can't add a script to a specific Book , just the book type itself.

 

I would like all of the markers for all of the books to be visible at the same time, then just remove themselves once they are picked up.

 

How would I attach a script to a specific item so that it would check if it was picked up.

 

Adding multiple stages and variables doesn't help me when I can only attach the script to the entire group of items.

Link to comment
Share on other sites

Yup, this solved my issue.

Unfortunately, I didn't check the post in time so I manually did this. It essentially had to have the cell name for every single book in the game and specialized codes when they were in in the same cell/outside.

It's so annoying how simple the solution is when you know what you're doing lmao

Thanks a lot Rick

Begin onadd player


if Player.GetInCell SLFishermansShackINT
set Book1 to 0
Link to comment
Share on other sites

Glad to help! Just FYI. So, your solution is to set a global for each book based on the cell check? That is similar to using quest variables. It's up to you to decide to use globals or (what I would call a more OOP solution), encapsulating your variables into a quest script.

 

You create a quest that has a script that has nothing but the variables:

scn MyQuestScript

short Book1
short Book2
short Book3
... etc....

In your object script:

Begin onadd player

     if Player.GetInCell SLFishermansShackINT
     set MyQuest.Book1 to 1 
end

Then in the conditionals for each quest marker:

GetQuestVariable Quest: 'MyQuest', Book1  -- 0

This is one way vanilla quests do similar things. Up to you how you want to do it though!!!

Link to comment
Share on other sites

Yeah I did a similar thing with calling the variables from the Script that added the quest to your character, it sort of worked but I quickly ran into issues when there were outside cells and multiple skill books in 1 cell.

It was also really slow to manually add cell names and keep track of the variables ( ie. Is it Book6 or Book7 ).

I've since reupdated everything using your code and it works perfectly, I've also added a counter to each book so that the quest ends when all of them are picked up (hopefully).

Here's the mod in action : https://www.nexusmods.com/newvegas/mods/70648

I've made sure to credit you in the Credits section for your help!



Link to comment
Share on other sites

  • Recently Browsing   0 members

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