Jump to content

Scripting Questions: What's the best way to...


Philosophiac

Recommended Posts

... handle the long-term 'tracking' of an intangible resource?

 

 

I'm trying to figure out the best way to track the production/loss of resources over time. Before I can even start to think about how to enable the player to allocate said resources, I need to come up with some kind of a system to actually track how much of 'X' resource is produced and consumed. I'm still very shaky when it comes to scripting, but this does sound like the sort of thing a script with some kind of variable and some plus-ery and minus-ery would be called for. Maybe a timer? I'm not entirely sure.

 

I'm okay as long as I can find other scripts which do similar things and reverse-engineer them into a new script... but I can't find anything in New Vegas that does what I'm trying to do. Now, maybe it exists and I just haven't found it yet (on account of my terrible computer not really allowing for me to play a whole lot), but here's what I'm looking for:

 

 

I need to be able to track how much power is being produced.

I need to be able to track how much purified water is being produced.

I need to be able to track how much food is being produced.

I need to be able to track the overall 'health' of the Vault.

I need to be able to track the morale of individual NPCs.

 

 

I thought it might be easier if I used non-playable 'tokens' to represent those things, but then I've got to worry about commands that remove items from the player's inventory don't I? There's a lot to think about, and I'm still only just in the preliminary stages of making this mod work. I've got a lot of cells and NPCs to create before I start really getting down and dirty with scripting, quests, and balancing the mechanics.

Link to comment
Share on other sites

Everything you need to track down can be stored in variables declared in scripts attached to quests. The NPCs probably would require an array variable (NVSE 4+). The "event" that causes a change in value, well... you decide how to handle it, concerning the type of event. You can use an event handler, you can use few conditional statements on a GameMode script attached to a quest with low frequency, or if you are doing it for a mod of yours where every item involved is custom (i.e. not vanilla references) then you could simply attach a script to them.

I'm sorry but the question seems a bit too much generic. From what I understood, you need to script the whole "core" that handles your mod, so the only suggestion I can give is learning to script or ask a scripter to do it for you. Copy pasting random scraps of code isn't really the best option and I discourage it, it only leads to neverending headaches during debug and it's-not-my-fault-it's-surely-something-bad-in-your-load-order kind of answers.

Edited by Fallout2AM
Link to comment
Share on other sites

  • Recently Browsing   0 members

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