CoM_Solaufein Posted December 21, 2014 Share Posted December 21, 2014 I've been getting reports on my mod's NPC banters going off one after another. I have them set up on a timer. Samples below. NPCs BCS file for the banters: IF InParty(Myself) RealGlobalTimerExpired("CallistoTalkTimer","GLOBAL") See(Player1) !StateCheck(Player1,CD_STATE_NOTVALID) !StateCheck(Myself,CD_STATE_NOTVALID) CombatCounter(0) !See([ENEMY]) OR(9) Global("CallistoTalk","GLOBAL",1) Global("CallistoTalk","GLOBAL",3) Global("CallistoTalk","GLOBAL",5) Global("CallistoTalk","GLOBAL",7) Global("CallistoTalk","GLOBAL",9) Global("CallistoTalk","GLOBAL",11) Global("CallistoTalk","GLOBAL",13) Global("CallistoTalk","GLOBAL",15) Global("CallistoTalk","GLOBAL",17) THEN RESPONSE #100 IncrementGlobal("CallistoTalk","GLOBAL",1) SetGlobal("CallistoTalkCheck","GLOBAL",1) Interact(Player1) END IF InParty(Myself) Global("CallistoTalkCheck","GLOBAL",1) !AreaType(DUNGEON) See(Player1) !StateCheck(Player1,CD_STATE_NOTVALID) !StateCheck(Myself,CD_STATE_NOTVALID) CombatCounter(0) !See([ENEMY]) OR(9) Global("CallistoTalk","GLOBAL",2) Global("CallistoTalk","GLOBAL",4) Global("CallistoTalk","GLOBAL",6) Global("CallistoTalk","GLOBAL",8) Global("CallistoTalk","GLOBAL",10) Global("CallistoTalk","GLOBAL",12) Global("CallistoTalk","GLOBAL",14) Global("CallistoTalk","GLOBAL",16) Global("CallistoTalk","GLOBAL",18) THEN RESPONSE #100 Interact(Player1) END Sample of the trigger in the dialog file: IF ~Global("CallistoTalk","GLOBAL",2)~ THEN BEGIN pc_chat2 SAY @22 ++ @23 DO ~RealSetGlobalTimer("CallistoTalkTimer","GLOBAL",2000) SetGlobal("CallistoTalkCheck","GLOBAL",0) SetGlobal("CallistoTalk","GLOBAL",3)~ + pcc2a ++ @24 DO ~RealSetGlobalTimer("CallistoTalkTimer","GLOBAL",2000) SetGlobal("CallistoTalkCheck","GLOBAL",0) SetGlobal("CallistoTalk","GLOBAL",3)~ + pcc2b ++ @25 DO ~RealSetGlobalTimer("CallistoTalkTimer","GLOBAL",2000) SetGlobal("CallistoTalkCheck","GLOBAL",0) SetGlobal("CallistoTalk","GLOBAL",3)~ + pcc2c END Link to comment
Jarno Mikkola Posted December 21, 2014 Share Posted December 21, 2014 Hmm, I would advice resetting the timer in this: ... Global("CallistoTalk","GLOBAL",18) THEN RESPONSE #100 SetGlobalTimer("CallistoTalkTimer","GLOBAL",2000) <---added line Interact(Player1) END I could be totally off though. Link to comment
jastey Posted December 23, 2014 Share Posted December 23, 2014 Setting the timer in the dialogue is good, too. Weird, I don't see a problem in your code. ? I would erase the "Interact(Player1)" in your first script block, but I don't think it makes any harm, either. Link to comment
CoM_Solaufein Posted August 24, 2015 Author Share Posted August 24, 2015 In regards to this code, my NPC starts to stutter as if its trying to start a dialog with my character but the dialog window doesn't show up. I have to click on the game's dialog on the menu and point it at my NPC in order to start the dialog that my NPC is stuttering about. Link to comment
jastey Posted August 24, 2015 Share Posted August 24, 2015 Interact() calls the B.DLG. If you can Start the dialogue by clicking, it is in the J.dlg. Link to comment
cmorgan Posted August 24, 2015 Share Posted August 24, 2015 There are also some old posts about oddities with RealSetGlobalTimer() and related commands (soemthing about action queues and such) - the safest way to code this is IF ~Global("CallistoTalk","GLOBAL",2)~ THEN BEGIN pc_chat2 SAY @22 ++ @23 DO ~SetGlobal("CallistoTalkCheck","GLOBAL",0) SetGlobal("CallistoTalk","GLOBAL",3) RealSetGlobalTimer("CallistoTalkTimer","GLOBAL",2000)~ + pcc2a ++ @24 DO ~SetGlobal("CallistoTalkCheck","GLOBAL",0) SetGlobal("CallistoTalk","GLOBAL",3) RealSetGlobalTimer("CallistoTalkTimer","GLOBAL",2000)~ + pcc2b ++ @25 DO ~SetGlobal("CallistoTalkCheck","GLOBAL",0) SetGlobal("CallistoTalk","GLOBAL",3) RealSetGlobalTimer("CallistoTalkTimer","GLOBAL",2000)~ + pcc2c END The "set in script and advance in dialogue" is still the safest way of making sure things work right, so I would not move that to a script block. The stutter is probably like what Jastey indicated - check Callisto's APPEND and see if it is to the J ( StartDialogNoSet() ) or B ( Interact() ). If the weighting works, I would not bother remapping the doialogue states; I'd just swap out the script call from I() to SDNS() Link to comment
CoM_Solaufein Posted March 17, 2016 Author Share Posted March 17, 2016 Couple months behind. Thanks for the suggestions. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.