grogerson Posted January 12, 2009 Share Posted January 12, 2009 I'm working on a tweak to allow Taerom to make more than one Ankheg armor. Having the "MakeArmor" global revert to 0 after he makes a set of armor has led me to another problem: GlobalTimerExpired("Taerom2","GLOBAL") and GlobalTimerExpired("Taerom","GLOBAL"). Now he tells me my new shell has rotted. How do you go about resetting these timers to TEN_DAYS? The same as the MakeArmor global? Link to comment
Mike1072 Posted January 12, 2009 Share Posted January 12, 2009 I'm working on a tweak to allow Taerom to make more than one Ankheg armor. Having the "MakeArmor" global revert to 0 after he makes a set of armor has led me to another problem: GlobalTimerExpired("Taerom2","GLOBAL") and GlobalTimerExpired("Taerom","GLOBAL"). Now he tells me my new shell has rotted. How do you go about resetting these timers to TEN_DAYS? The same as the MakeArmor global? I checked this out again (this time without Baldurdash installed! heh) and made the following table describing a way I think would make this work. I'd re-work the MakeArmor global into one that changes between 0 and 1 basically depending on whether the rotting timer should be active or not with the intention of making multiple armors. The initial state where he finds out you have an ankheg shell would have the condition Global("MakeArmor","GLOBAL",0). Leaving this state, the global would generally change here to 1. States with the condition Global("MakeArmor","GLOBAL",1) would therefore only activate when he's already checked your shells and set the timer to start them rotting. When you either 1) give in and sell your shell, 2) get him to make you armor, or 3) wait too long until the armor rots, then the variable gets set back to 0 and you can start over. The following table indicates which states should have the appropriate Conditions (ie. Global("MakeArmor","GLOBAL",1)) and Actions (ie. SetGlobal("MakeArmor","GLOBAL",1)). To use this, you'd basically want to remove the existing MakeArmor checks and then add these in. 1) C: 0 A: - // wow, you've got ankheg shells? 2) C: - A: 0 // sold shells for g 3) C: - A: - 4) C: - A: 1 // be careful, it's gonna rot! ** there's also a bug here, see below 5) C: 1 A: - // hello again, have you reconsidered? 6) C: 1 A: 0 // eww, it rotted! 7) C: - A: - 8) C: - A: 1 // make me an armor! 9) C: 1 A: - // the armor's not finished yet 10) C: 1 A: 0 // the armor's done, here you go 11) C: - A: 1 // (it's gonna rot, but i'm not going to tell you!) 12) C: - A: 1 // be careful, it's gonna rot! 13) C: 1 A: - // you got mad at me last time, have you reconsidered now? 14) C: - A: - 15) C: - A: - ** In the initial dialogue "I'll give you 500 gold...", taking the third option "Hardly a fair price..." which leads to "Take it or leave it!", then selecting the second option "Well, I'll just have to leave it, then." (leading to state 4) results in the rotting timer "Taerom" not being set (I think). Link to comment
grogerson Posted January 13, 2009 Author Share Posted January 13, 2009 The problem exists in the two global timers that get set, Taerom and Taerom2. Taerom sets to TEN_DAYS when you first appear with a shell and refuse to sell it (reply 1), which is the only way to get him to make the armor. Taerom2 sets to TEN_DAYS when you pay to have the armor made and expires when he finishes. The problem isn't in the MakeArmor global. The tweak sets it back to 0 instead of 2 when he gives the first set. I got the armor but get the response of the expired Taerom timer. What I need is a way to restart the timers. I'll see if I can reset via CLUA, but I'll need something that can do it automatically. Any ideas? Link to comment
Mike1072 Posted January 13, 2009 Share Posted January 13, 2009 The problem exists in the two global timers that get set, Taerom and Taerom2. Taerom sets to TEN_DAYS when you first appear with a shell and refuse to sell it (reply 1), which is the only way to get him to make the armor. Taerom2 sets to TEN_DAYS when you pay to have the armor made and expires when he finishes. The problem isn't in the MakeArmor global. The tweak sets it back to 0 instead of 2 when he gives the first set. I got the armor but get the response of the expired Taerom timer. What I need is a way to restart the timers. I'll see if I can reset via CLUA, but I'll need something that can do it automatically. Any ideas? This is my attempt to get around that issue. Using my method, all states that trigger when one of the two timers are set should now only when it makes sense to - after the first shell is dealt with, you'll go back to initiating the first dialogue, which will reset the timers. Link to comment
grogerson Posted January 15, 2009 Author Share Posted January 15, 2009 My apologies for taking so long to reply. My current Taerom.baf: IF GlobalGT("MakeArmor","GLOBAL",1) THEN RESPONSE #100 SetGlobal("MakeArmor","GLOBAL",0) Continue() END My problem is that I have an expired timer that states any ankheg shells I have are rotted: GlobalTimerExpired("Taerom","GLOBAL")... While I've been working on this reply, I just thought about adding SetGlobalTimer("Taerom","GLOBAL",TEN_DAYS) after setting the MakeArmor global. He now takes the shell and the gold to make another set. Guess I'll have to play a bit to see if he actually makes it. Now to see about changing State 1, Action 1 (offset 4a8) from TakePartyItemAll to TakePartyItem. Maybe he'll buy the shells one at a time instead of taking them all... Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.