• 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.

A dialog bug?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Edit: It's not a dialog bug, but rather my misunderstanding of boolexpr. This is solved!

Hi,

I have this code which creates a dialog wrapper. For whatever reason, it doesn't create a valid wrapper in the very first time the function is called. BUT, it works perfectly well everytime afterwards. So in the body I literally created the wrapper the same way twice, and the second time it's created it starts working. Why is this?

JASS:
			set newDialog = farm.monstersToDialog(SWAPOUT_MSG, Condition(function swapoutMain), 3)
			call newDialog.setBackdialog(linkedDialog.backDialog)
			call print("showing the NEW DIALOG")
			set g = newDialog.get(FIRST_DIALOG)
			call g.show(pid, true)
			call print("showed the new dialog #: " + I2S(g))
			call newDialog.flush()
			set newDialog = farm.monstersToDialog(SWAPOUT_MSG, Condition(function swapoutMain), 3)
			call newDialog.setBackdialog(linkedDialog.backDialog)
			call print("showing the NEW DIALOG")
			set g = newDialog.get(FIRST_DIALOG)
			call g.show(pid, true)
			call print("showed the new dialog #: " + I2S(g))

Note that everywhere else I've done the same code and haven't had an issue.

If it helps, the very first wrapper made gets assigned id #252, which apparently isn't an allocated struct (considering all its fields are null / default).

However, afterwards the id bounces between #71 and #73, presumably because the struct is getting allocated / deallocated successfully.
 
Last edited:
Status
Not open for further replies.
Top