That code looked very promising, but unfortunately it does not seem to work for my intention :(.
I tried simply creating a dialog item, assign it to variable, and then delete it.
However it still detects it as a dialog item.
Probably because the variable is set to the variable type "Dialog item"
Edit:
My problem is that i have a while loop that changes the properties of a dialog item over time. But if the dialog item is removed while the loop is still active it causes errors unitl the loop runs out
Edit: My problem is that i have a while loop that changes the properties of a dialog item over time. But if the dialog item is removed while the loop is still active it causes errors unitl the loop runs out
Could I get some code? I could probably fix it but I don't really understand what you mean.
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
Just add "Dialog Item != No dialog item" to the while loop's condition (in its AND part).
You might need to set the variable to to no dialog item, too, wherever you delete it while this function is running.
At least that is required for dialogs. I'm not sure if dialog items require the same treatment in this use case.
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
That does not work, since it won't detect the dialog item as "No dialog item". I believe the reason for this is because the dialog item is removed from outside the action definition. This way the variable "Dialog item" within the action definition still contains the dialog item, even though it really is removed.
EDIT: I spoke too soon, I tried to make a crude trigger based on the information given, which would move a dialog item on acquiring of target, but I couldn't even get that to work.
Hope you find help. Sorry I couldn't be any help. :(
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
What you are suggesting could work well if there only were a few items being moved, however having multiple items would be more of a pain. I want the action to work on every dialog item, without having to bother where i use it.
I assume that dialog items remain in an invalid state. :S
For dialogs it was integer 16 in my map, but I'm never using a reference on dialogs that I remove in parameters. Maybe it's the same for dialog items.
Try to check the variable's value in the trigger debugger in the beta or in 1.5 (tomorrow in EU).
If you know the value, you might be able to check the dialog item reference's internal value (integer) in custom code.
Or I just try something in the editor now. I will post my research result here later.
edit:
OK, there is no specific destruction value. BUT it is possible to detect that the item is about to be destroyed.
The item is still a dialog item, but it is not "any" dialog item.
My recommendation is to have a global array which keeps track of all of your dialog items, each indexed by a unique ID. In your "DestroyDialog" method, simply update this array, replacing True with False or <Dialog Item> with <No Dialog Item>, depending on the data type you choose to store in the array. This should let you easily check if it still exists.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Is there any way to check if an dialog item exists? Like: "Dialog item 'VARIABLE' exists == true"
I can't find it as a trigger condition, is there a workaround?
VARIABLE != No Dialog Item
That should do the job.
Im not sure if it always works though, like when linking the variable to a dialog item and then destroying this dialog item.
Thanks for the reply!
That code looked very promising, but unfortunately it does not seem to work for my intention :(. I tried simply creating a dialog item, assign it to variable, and then delete it. However it still detects it as a dialog item. Probably because the variable is set to the variable type "Dialog item"
Edit: My problem is that i have a while loop that changes the properties of a dialog item over time. But if the dialog item is removed while the loop is still active it causes errors unitl the loop runs out
Could I get some code? I could probably fix it but I don't really understand what you mean.
The code looks like this
Where "X+=(X-target)*m" is the function below
I get errors if the dialog item is removed before the code has finished running. And that is because it is trying to move the item after it's gone
Just add "Dialog Item != No dialog item" to the while loop's condition (in its AND part).
You might need to set the variable to to no dialog item, too, wherever you delete it while this function is running.
At least that is required for dialogs. I'm not sure if dialog items require the same treatment in this use case.
Maybe the dialog reference is your problem.
Already tried this, it does not make any difference.
This won't work for me, because right after deleting the dialog item the variable gets assigned another dialog item. As shown below.
@SylphCraft: Go
So you're trying to make a movement system or just trying to move the dialog box with the screen or?
I'm not entirely sure and I'll see if I can't solve it, but in the meantime try adding this right after "wait .01 seconds":
That does not work, since it won't detect the dialog item as "No dialog item". I believe the reason for this is because the dialog item is removed from outside the action definition. This way the variable "Dialog item" within the action definition still contains the dialog item, even though it really is removed.
@SylphCraft: Go
Well, you could set an integer variable and then add or subtract 1 depending on how you're trying to make the trigger work, then just do:
EDIT: I spoke too soon, I tried to make a crude trigger based on the information given, which would move a dialog item on acquiring of target, but I couldn't even get that to work.
Hope you find help. Sorry I couldn't be any help. :(
@Yaksmanofage: Go
All help is appreciated! :)
What you are suggesting could work well if there only were a few items being moved, however having multiple items would be more of a pain. I want the action to work on every dialog item, without having to bother where i use it.
I assume that dialog items remain in an invalid state. :S
For dialogs it was integer 16 in my map, but I'm never using a reference on dialogs that I remove in parameters. Maybe it's the same for dialog items.
Try to check the variable's value in the trigger debugger in the beta or in 1.5 (tomorrow in EU).
If you know the value, you might be able to check the dialog item reference's internal value (integer) in custom code.
Or I just try something in the editor now. I will post my research result here later.
edit:
OK, there is no specific destruction value. BUT it is possible to detect that the item is about to be destroyed.
The item is still a dialog item, but it is not "any" dialog item.
Nvm ...
Update
This is what the error looks like with patch 1.5
And the code near line 587
Assumingly the error is caused by line 588, when the dialog item is moved.
My recommendation is to have a global array which keeps track of all of your dialog items, each indexed by a unique ID. In your "DestroyDialog" method, simply update this array, replacing True with False or <Dialog Item> with <No Dialog Item>, depending on the data type you choose to store in the array. This should let you easily check if it still exists.