Jump to content

How do I make a local variable which counts passing days?


Recommended Posts

I'm trying to make a mod in which the player is asked to wait a day and come back. I can see: DayCheck, DayCount, daysgoneby and DaysPassed in local variables but this leaves several problems. I don't know how to use these variables and even if I did I feel I need to make a new one so any vanilla content relying on these doesn't get reset or overwrite my attempt. Unfortunately I don't know how to make new local variables. "Capostrophic" on the morrowind modding discord said "local variables are variables you define in the script itself" but scrolling through the game's scripts I can't see any scripts which relates to the passing of days (despite this happening multiple times with House Strongholds and Raven Rock.) Is there a dictionary which lists what each local variable does and are there guides to making new locals or more specifically making a local to count the days?

Also if this question can't be answered please post some mods which use days passing as a mechanic so I can try to reverse engineer their work.

Edited by hurrdurrmurrgurr
Link to comment
Share on other sites

For anything scripting related, your primary source of information should be last version of Morrowind Scripting For Dummies

if you are using a local script attached to your npc or creature, you can use the standard WaitOneDay script as example (attached/used in dialog by e.g. "yagrum bagarn" creature, "Iulus Truptor" NPC...)
local variables are stored locally/are unique for that NPC/creature so no risk of messing with other creatues/npc.
if you need to wait more than 1 days, you should change your day counting logic accordingly

Note that since Tribunal, Bethesda defined a global short DaysPassed variable which is auto updated by the engine, making so several script using the local dayspassed variable ambiguous. It is considered bad practice to use the same identifier for two different variable/objects as it may cause errors. In short, don't declare a local dayspassed variable, use something like mydayspassed instead.






Edited by abot
Link to comment
Share on other sites

  • Recently Browsing   0 members

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