So, it's a silly question, but in my triggers I put = if ( (used dialog item) == "Some Dialog item") then Destroy "Some Dialog Item". I used this but it didn't worked, it's probably logically wrong, but then what condition should I use?
do you want to destroy the whole dialog or just the button which is a dialog item. as you did above just use the "destroy dialog" action and get the parent dialog of used dialog item.
Hmm... Now that I think of it, I think I should make a trigger, with an event that occurs everytime a player uses a dialog, under condition check if the dialog is the one that I want and if it is destroy the dialog. But is this efficient? Isn't there another way to do it? Because I don't want a laggy game.
I wouldn't say triggers with periodic events are laggy triggers, but everything that triggers periodically hits the overall performance at least a very tiny bit, in most cases not even noticable I'd say. For example, if you'd do extremly complex math every 0.2 seconds, yes that would lag. Probably less with an condition or so, but then it would lag every time that condition returns true (and checking the condition every time is also hitting the performace just a little bit)
Oh not a problem, and woops, yes you're right the periodic event has to be very small for it to lag, I forgot to mention that :P. 0.2 is a perfect example, no wonder I had a laggy game in a map that I created. xD
My only encounter with lag was when I had an AI controlling hundreds of units. Every second, the trigger picked every unit, and calculated where they would attack/move. It only became a problem when there were tons of units on the map, when there would be a slightly noticeable pause every second. And in the map, the lag was worth it and necessary.
My point is, maps/bnet can handle a lot. Instantaneous functions (actions/conditions) are going to be your biggest concern (i.e. picking every unit and running a bunch of checks and actions for each one - in the same moment - I'm talking thousands; even hundreds can be unnoticeable).
It's just mapping ethical to keep the code as efficient as possible and require as little processing as possible. But it can take a lot before it becomes noticeable. I just do it in case I ever need a very heavy system (see AI example).
I wouldn't call it "ethical" so much as "good practice" for future projects or programming... though I suppose you could make an argument for the unnecessary expenditure of another person's resources, as minuscule as that expenditure may happen to be.
Well, I just meant, in most cases, even the most inefficient coding (within reason) won't have an impact on the game. It's just something people should do, even if it makes no difference, though the practice at making things more dynamic does improve skill.
And I meant ethical towards the engine. It has feelings, too, you know ; ;
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So, it's a silly question, but in my triggers I put = if ( (used dialog item) == "Some Dialog item") then Destroy "Some Dialog Item". I used this but it didn't worked, it's probably logically wrong, but then what condition should I use?
do you want to destroy the whole dialog or just the button which is a dialog item. as you did above just use the "destroy dialog" action and get the parent dialog of used dialog item.
@FunkyUserName: Go
The whole dialog, I want it gone after someone clicks on it.
@FunkyUserName: Go
Hmm... Now that I think of it, I think I should make a trigger, with an event that occurs everytime a player uses a dialog, under condition check if the dialog is the one that I want and if it is destroy the dialog. But is this efficient? Isn't there another way to do it? Because I don't want a laggy game.
@joemart06: Go
you need a trigger for every dialog button anyway. won't affect performance, only triggers that run very often can cause problems
@FunkyUserName: Go
So, an example of laggy triggers would be periodic events?
@joemart06: Go
I wouldn't say triggers with periodic events are laggy triggers, but everything that triggers periodically hits the overall performance at least a very tiny bit, in most cases not even noticable I'd say. For example, if you'd do extremly complex math every 0.2 seconds, yes that would lag. Probably less with an condition or so, but then it would lag every time that condition returns true (and checking the condition every time is also hitting the performace just a little bit)
Sorry for sneaking into this thread
@LordJaraxx: Go
Oh not a problem, and woops, yes you're right the periodic event has to be very small for it to lag, I forgot to mention that :P. 0.2 is a perfect example, no wonder I had a laggy game in a map that I created. xD
@joemart06: Go
My only encounter with lag was when I had an AI controlling hundreds of units. Every second, the trigger picked every unit, and calculated where they would attack/move. It only became a problem when there were tons of units on the map, when there would be a slightly noticeable pause every second. And in the map, the lag was worth it and necessary.
My point is, maps/bnet can handle a lot. Instantaneous functions (actions/conditions) are going to be your biggest concern (i.e. picking every unit and running a bunch of checks and actions for each one - in the same moment - I'm talking thousands; even hundreds can be unnoticeable).
It's just mapping ethical to keep the code as efficient as possible and require as little processing as possible. But it can take a lot before it becomes noticeable. I just do it in case I ever need a very heavy system (see AI example).
@Charysmatic: Go
I wouldn't call it "ethical" so much as "good practice" for future projects or programming... though I suppose you could make an argument for the unnecessary expenditure of another person's resources, as minuscule as that expenditure may happen to be.
@BasharTeg: Go
Well, I just meant, in most cases, even the most inefficient coding (within reason) won't have an impact on the game. It's just something people should do, even if it makes no difference, though the practice at making things more dynamic does improve skill.
And I meant ethical towards the engine. It has feelings, too, you know ; ;