• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Loop stops and skips rest of the functions

Status
Not open for further replies.
Level 14
Joined
Jun 13, 2007
Messages
1,432
ok, I got a problem, basicly I have a kind off dialog system where you can choose between option a,b,c,d with the arrowkeys. So while I wait for input I have a loop that will keep the rest of the functions from triggering until some input has been done.

JASS:
loop
 exitwhen NPC.Dialog_Outputvalue !="" 
 call BJDebugMsg ("NPC.Dialog_Outputvalue is still not set")
 call TriggerSleepAction (0.4)
endloop

But when it comes to call TriggerSleepAction the function stops completely and skips the rest of the function.

Here's the entire function
JASS:
 		public method Dialog_Init takes boolean cinematic,real duration returns nothing
 			local integer x = 1
 			call BJDebugMsg ("Dialog_Init")
 			loop 
 				exitwhen x>4
 				set NPC.Dialog_Outputresponse[x] = this.Response[x]
 				set NPC.Dialog_Outputresponsetitle[x] = this.Responsetitle[x] 
 				set x=x+1
 			endloop
 			set NPC.Dialog_Outputvalue = ""
 			call EnableTrigger (NPC.Dialog_Choiceup)
 			call EnableTrigger (NPC.Dialog_Choicedown)
 			call EnableTrigger (NPC.Dialog_Choiceright)
 			call EnableTrigger (NPC.Dialog_Choiceleft)
 			call NPC.Displaychoice ()
 			call BJDebugMsg ("NPC.Displaychoice")
 			loop
 				exitwhen NPC.Dialog_Outputvalue !="" 
 				call BJDebugMsg ("NPC.Dialog_Outputvalue is still not set")
 				call TriggerSleepAction (0.4)
 			endloop
 			call ClearTextMessages ()
 			call TransmissionFromUnitWithNameBJ ( GetPlayersAll (), this.U, GetUnitName(this.U), null, NPC.Dialog_Outputvalue,  bj_TIMETYPE_SET, duration, true)
 			set x=1
 			loop 
 				exitwhen x>4 
 				set NPC.Dialog_Outputresponse[x] = ""
 				set NPC.Dialog_Outputresponsetitle[x] = ""
 				set x=x+1
 			endloop
 			set NPC.Dialog_Outputvalue = ""
 			//call BJDebugMsg ("Dialog Success")
 		endmethod

I can supply more info if needed
 
Status
Not open for further replies.
Top