The following warnings occurred: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "extra" - Line: 100 - File: inc/plugins/google_seo/url.php PHP 8.1.28 (Linux)
|
Gamedayspassed. What's wrong? - Printable Version +- Silgrad Tower from the Ashes (https://www.silgradmodding.net/forum) +-- Forum: Discussions for Silgrad Tower TES IV (Oblivion) & TES III (Morrowind) (https://www.silgradmodding.net/forum/Forum-Discussions-for-Silgrad-Tower-TES-IV-Oblivion-TES-III-Morrowind) +--- Forum: General Discussions TESIV (https://www.silgradmodding.net/forum/Forum-General-Discussions-TESIV) +---- Forum: General ES Modding (https://www.silgradmodding.net/forum/Forum-General-ES-Modding) +---- Thread: Gamedayspassed. What's wrong? (/Thread-Gamedayspassed-What-s-wrong) |
Gamedayspassed. What's wrong? - MarekVelgar - 06-12-2011 Hello. I'm having problem with my timer to work. The idea is to set a variable through dialogue "Entertained to 1" and once one day passes it is set to 0 again by quest script. scriptname MVTawernaPodZmijaRozmowyQuestScript short Entertained float BardTimer Begin Gamemode if Entertained == 1 ; this is set in dialogue to 1 to mark that PCalready spoke ;with NPC set BardTimer to GameDaysPassed endif if GameDaysPassed > ( BardTimer + 1 ) set Entertained to 0 endif end So when Entertained is set to 1 ( by dialogue) you cannot talk about certain topic with NPC unless one day is up and Entertained is set to 0 again. But it doesn't work. Apparently the script doesn't change "Entetained" to 0 because after more than 1 day PC still cannot talk with NPC. Tell me please what am I doing wrong? - Koniption - 06-12-2011 Hi Marek, Ok, I've done a few timer scripts before (with GetSecondsPassed), so I'll take a stab at helping you: Try this instead - -------------------------------------- scn MVTawernaPodZmijaRozmowyQuestScript short Entertained float BardTimer Begin Gamemode if Entertained == 1 set BardTimer to 1 ;; the number is how many days is to pass endif if BardTimer > 0 set BardTimer to ( BardTimer - GetDaysPassed ) ;; can try GameDaysPassed instead, if GetDaysPassed does not work (wiki was down, so I couldn't look it up) elseif BardTimer <= 0 ;; the day has passed, so... set Entertained to 0 endif end ------------------------ Koniption - MarekVelgar - 06-13-2011 Thanks for reply. Unfortunately this script doesn't work for me. Either the timer works and "Entertained" is not set to 0 OR simply timer just refuses to start counting. I thought that maybe I messed up something in my dialogue window but no. There is one topic: "Tell a joke" When you press it and variable "Entertained == 0 , you tell a joke, get money, set "Entertained to 1 and BardTimer here should start counting so that you may not tell a joke until one day passes. If "Entertained == 1" NPC tells you to come back tomorrow. Well after telling one joke, he keeps saying "Come back tomorrow" and no matter how many days will pass he keeps saying that. - Koniption - 06-13-2011 Quote:Originally posted by MarekVelgar Hmm. The CS wiki is still down, so I can't doublecheck about GetDaysPassed (or if it's proper term is GameDaysPassed..plus some other things) First try these tips, in order I post them, testing in game in-between each step.: 1) Make sure you are saving your script as a "Quest" script, and not an "Object" script. Simply adding "Quest Script" at the end of the scn script name is not good enough. If not work, proceed to #2 below... 1b) Make sure you add the proper indentation into my script, whereas mine lacked it when I posted it. 2)Make BardTimer a "short" , instead of a "float". If not work, proceed.... 3) Try turning "getDaysPassed" into "GameDaysPassed", in the script. Make sure BardTimer is a "float" again. 4) Same as #3 above, but make BardTimer a "short"again. 5) Something might be wrong with the Dialogue section of things. Can you post the scripting you put in the Dialogue window, that goes with this Quest script? Koniption - MarekVelgar - 06-14-2011 My cousine came by to me and helped me with the script. Now it works properly.: Scriptname Timer short Entertained short BardTimer short DoOnce Begin Gamemode if Entertained == 1 && DoOnce == 0 set DoOnce to 1 set BardTimer to GameDaysPassed + 1 ; endif if GameDaysPassed >= BardTimer set Entertained to 0 set DoOnce to 0 set BardTimer to 0 endif end - sandor - 06-14-2011 I am glad you solved the problem, I wanted to reply but was busy with other stuff. Further the BardTimer is a short and not a float as mentioned in the OP. - Koniption - 06-14-2011 Hi Marek, Great! I'm glad you got the problem solved. So is your cousin an Oblivion modder, too? Koniption |