I'm sure he meant the the event were listened every time an unit enter the map but not executing it so it was a loss of traffic. My solution would be to change "Any unit" in your event to Unit - Unit from unit type -> Marine (i'm not have the editor here but it should be something like that)
I'm sure he meant the the event were listened every time an unit enter the map but not executing it so it was a loss of traffic. My solution would be to change "Any unit" in your event to Unit - Unit from unit type -> Marine (i'm not have the editor here but it should be something like that)
I don't know if you can setup unit types in events right now. Making a custom function that returns a Gamelink - Unit Type or Boolean doesn't show up for the Event Unit selection, and there's no Built-in way to do it without also having to call an index (Unit from Unit Group) I think, which also breaks it unless the unit tested happens to be in index 1 (in which, it will only work with that one unit until something replaces it in that index)
Quote from Paranoiks:
Failed triggers?!?!? This must work when a marine enters map and if it is not marine it won't do anything
Gimme map and I can help u.
----
Yes failed triggers, if the event is set to "Any Unit enters region x", and there is a condition that states the specific unit, the map will run the trigger every time "Any unit enters region x", then check if the conditions apply, if they dont, the trigger fails.
This doesnt cause much of a problem by itself, and is virtually unnoticeable, but when stacked with hundreds of "Any Unit" event triggers with specific conditions, then you get an endless stream of failing triggers which generates lag.
If you run your map in window mode with the the debugger window you'll see all your triggers, how many times they're run and how many times they fail. Anytime something happens which triggers an event "Any unit enters region", it will begin to run the trigger, then check the conditions, if they dont meet, the trigger is listed as a fail. For example, the condition is set to = marine, but lets say a zergling enters region x, the maps identifies that an "Any unit" just entered region x, now it checks if it meets the "is = to marine" condition... no it doesnt, trigger is listed as a fail. When these triggers are stacks too often, errors appear in game - also these are the reasons why most maps have that 5-10 seconds of lag during start up, because the map places all the starting units in the game, then checks the hundreds of units to see if they meet conditions, then fails them all at once (run one of these maps with the debugger and you'll understand).
I know this is how most people have been doing it, because its the most simple way of doing it, but on larger maps, its very inefficient and contributes a good chunk of lag. I know that the more advanced mappers have found workarounds so the trigger is run when a specific event happens, so the game doesnt constantly check and fail the trigger. I'm just hoping someone can give me some kinda alternate to "any unit" events with conditions.
Let me guess KewlCrayon you've never used Warcraft 3 Editor & you have many Any Unit Enters Region x for each unit type you want to trigger the Actions, no Problem.
My suggestion is that you Use If Then Else Action instead of conditions if you don't wanna use the OR Condition. You put If Entering Unit = Marine THEN (put what you want done there)
and in Else Put a New If Then Else and do a If Entering Unit = Zergling THEN (put what you want done there) Rinse and Repeat.
That way only one trigger fires once reducing lag from Multiple Triggers firing Simultaneously.
That seemed to work for me in Warcraft 3 very well and Starcraft 2 has a Similar although more Powerful Trigger setup. I hope that helps. :-)
P.S I'm going to be making A Starcraft 2 Map showing off some of the Kewl things done in Starcraft 1/ Broodwar, that I never saw in warcraft 3 redone. Such as Bring Unit A and Unit B to Location Z Create Unit G (aka Yu-gi-oh Fusions and a dbz Map) as well a Stand in Location K Heals you Constently (think DBZ All Saga's Perfect) no Entering and Exit Region like Warcraft 3 mapper's seem to only do. That last one also allows you to Summon a Enemy in a Region your in for you to Level up against. That's what I'm going to Show off in Phase 2 of Beta.
Whew sorry for the long Post but this was a Common Problem in Warcraft 3 and I think it's part of what KILLED the MAPPING SCENE, leaving ONLY DOTA as the main map played. Sure there was Battleships and S3's Marine Corps, even some DBZ although not as Enjoyable as the Starcraft 1 DBZ Maps, most mapper's ended up using the Fountain of Health and making it's Regen so high it was basicly a Heal but that doesn't work well when the Enemies are Heal'd too lol. Unfortunatly my Solution is too late now I think for Warcraft 3 but I belive it will ENSURE Starcraft 2's Map Scene to be as Strong if not HOPFULY Stronger than the First's. So long as Copyright Content in Maps & Models are not Removed from B-Net 2.0. Thanks all who read this far I'm all ready working on this map and should have it done before Phase 2, if I'm late or on Time look for DaFunk's DBZ Demo. It will have these system in them so anyone can just copy and paste no Credit required but I'd be grateful if you do. I care more about letting this Knowledge flowing out to everyone, so even a total noob can Rename this demo and claim it as there's. That still allows others to learn and use them selves.
My Projects:
Sorted Multiplayer Leader Board
Card Shuffle Dialog Demo
Air Wars Mass
Blizzard Fan since Starcraft. The Single Player story is AMAZING IMO, I can't wait for the Expansions. In Warcraft 3 I only enjoy the Custom Maps scene (& Blizzards...
If then Else wont work, there are about 30 units that need to do specific actions and 8 different players they need to apply to. Setting them to if then else would either be one massive trigger full of 240 if then elses, or 8 triggers with 30 if then elses or whatever.
Or if I set the if then else to each trigger individually, the trigger doesnt fail, but it still runs it every time "any unit enters region x", it just runs no actions if it doesnt meet the conditions, this still creates lag (although wont create any popup errors from failed trigger flooding)
Damnit blizzard really made a stupid way of making these triggers work, why couldnt they just have a "Unit Type" function for an event, why does it HAVE to be either "Any unit" or "Unit from Unit Group" then having to have conditions that will always cause the game to fail them whenever conditions arent met.
Why cant it be like SC1, where when the 'marine' enters the region, it does the action, not when 'any unit' enters the region, check if its a marine, its not a marine, fail the trigger, create lag, piss people off...
If the only reason you won't use if-then-else is because you'll have a giant trigger, then I'd suggest making an action definition for each unit and in the trigger that has the event, make a single switch statement that will call the appropriate action definition. In case you're not familiar with switch statements, they are identical to if-then-else statements, except that they only compare one value - in this case, you only need to compare the unit type of the triggering unit. Here's what it might look like if applied to the Marine and Zergling. Let me know if you have any questions, there are 1 trigger and 2 action definitions:
@OP: The only way you can do is to use condition in your trigger. The "failed trigger" (where the event fire but nothing was done) doesnt actually cost that much traffic as you think it should. I havent figured how to use event definition so that you might take a look into. But for now just stick with condition.
Yeah I know its not 'that' bad of a problem, the lag that it makes is still very small, but I'd still like to fix it. It does contribute late game, and the errors that pop up when flooding happens is annoying. Also its the reason for the 5-10 seconds of startup lag.
I found an alternative anyways. I decided to do everything through the data editor, and have those specific units set as abilities instead of training, this way I can set an even so when "Command center uses buy zerglings ability" -> do actions. (My trigger is set up so when you buy zerglings, a spawning pool is created which spawns zerglings - so instead of having it train the first unit to start the spawning, I made it an ability instead)
@Paranoiks:
I'm sure he meant the the event were listened every time an unit enter the map but not executing it so it was a loss of traffic. My solution would be to change "Any unit" in your event to Unit - Unit from unit type -> Marine (i'm not have the editor here but it should be something like that)
Use the 'OR' condition and just list the unit-types that are acceptable to run the trigger.
I don't know if you can setup unit types in events right now. Making a custom function that returns a Gamelink - Unit Type or Boolean doesn't show up for the Event Unit selection, and there's no Built-in way to do it without also having to call an index (Unit from Unit Group) I think, which also breaks it unless the unit tested happens to be in index 1 (in which, it will only work with that one unit until something replaces it in that index)
Quote from Paranoiks:
Failed triggers?!?!? This must work when a marine enters map and if it is not marine it won't do anything
Gimme map and I can help u.
----
Yes failed triggers, if the event is set to "Any Unit enters region x", and there is a condition that states the specific unit, the map will run the trigger every time "Any unit enters region x", then check if the conditions apply, if they dont, the trigger fails.
This doesnt cause much of a problem by itself, and is virtually unnoticeable, but when stacked with hundreds of "Any Unit" event triggers with specific conditions, then you get an endless stream of failing triggers which generates lag.
If you run your map in window mode with the the debugger window you'll see all your triggers, how many times they're run and how many times they fail. Anytime something happens which triggers an event "Any unit enters region", it will begin to run the trigger, then check the conditions, if they dont meet, the trigger is listed as a fail. For example, the condition is set to = marine, but lets say a zergling enters region x, the maps identifies that an "Any unit" just entered region x, now it checks if it meets the "is = to marine" condition... no it doesnt, trigger is listed as a fail. When these triggers are stacks too often, errors appear in game - also these are the reasons why most maps have that 5-10 seconds of lag during start up, because the map places all the starting units in the game, then checks the hundreds of units to see if they meet conditions, then fails them all at once (run one of these maps with the debugger and you'll understand).
I know this is how most people have been doing it, because its the most simple way of doing it, but on larger maps, its very inefficient and contributes a good chunk of lag. I know that the more advanced mappers have found workarounds so the trigger is run when a specific event happens, so the game doesnt constantly check and fail the trigger. I'm just hoping someone can give me some kinda alternate to "any unit" events with conditions.
Let me guess KewlCrayon you've never used Warcraft 3 Editor & you have many Any Unit Enters Region x for each unit type you want to trigger the Actions, no Problem. My suggestion is that you Use If Then Else Action instead of conditions if you don't wanna use the OR Condition. You put If Entering Unit = Marine THEN (put what you want done there) and in Else Put a New If Then Else and do a If Entering Unit = Zergling THEN (put what you want done there) Rinse and Repeat. That way only one trigger fires once reducing lag from Multiple Triggers firing Simultaneously. That seemed to work for me in Warcraft 3 very well and Starcraft 2 has a Similar although more Powerful Trigger setup. I hope that helps. :-)
P.S I'm going to be making A Starcraft 2 Map showing off some of the Kewl things done in Starcraft 1/ Broodwar, that I never saw in warcraft 3 redone. Such as Bring Unit A and Unit B to Location Z Create Unit G (aka Yu-gi-oh Fusions and a dbz Map) as well a Stand in Location K Heals you Constently (think DBZ All Saga's Perfect) no Entering and Exit Region like Warcraft 3 mapper's seem to only do. That last one also allows you to Summon a Enemy in a Region your in for you to Level up against. That's what I'm going to Show off in Phase 2 of Beta.
Whew sorry for the long Post but this was a Common Problem in Warcraft 3 and I think it's part of what KILLED the MAPPING SCENE, leaving ONLY DOTA as the main map played. Sure there was Battleships and S3's Marine Corps, even some DBZ although not as Enjoyable as the Starcraft 1 DBZ Maps, most mapper's ended up using the Fountain of Health and making it's Regen so high it was basicly a Heal but that doesn't work well when the Enemies are Heal'd too lol. Unfortunatly my Solution is too late now I think for Warcraft 3 but I belive it will ENSURE Starcraft 2's Map Scene to be as Strong if not HOPFULY Stronger than the First's. So long as Copyright Content in Maps & Models are not Removed from B-Net 2.0. Thanks all who read this far I'm all ready working on this map and should have it done before Phase 2, if I'm late or on Time look for DaFunk's DBZ Demo. It will have these system in them so anyone can just copy and paste no Credit required but I'd be grateful if you do. I care more about letting this Knowledge flowing out to everyone, so even a total noob can Rename this demo and claim it as there's. That still allows others to learn and use them selves.
@DaFunk86:
If then Else wont work, there are about 30 units that need to do specific actions and 8 different players they need to apply to. Setting them to if then else would either be one massive trigger full of 240 if then elses, or 8 triggers with 30 if then elses or whatever.
Or if I set the if then else to each trigger individually, the trigger doesnt fail, but it still runs it every time "any unit enters region x", it just runs no actions if it doesnt meet the conditions, this still creates lag (although wont create any popup errors from failed trigger flooding)
Damnit blizzard really made a stupid way of making these triggers work, why couldnt they just have a "Unit Type" function for an event, why does it HAVE to be either "Any unit" or "Unit from Unit Group" then having to have conditions that will always cause the game to fail them whenever conditions arent met.
Why cant it be like SC1, where when the 'marine' enters the region, it does the action, not when 'any unit' enters the region, check if its a marine, its not a marine, fail the trigger, create lag, piss people off...
@KewlCrayon: Go
have u tried the "Unit Is Created Trigger"?
@Naim2k10: Go
If the only reason you won't use if-then-else is because you'll have a giant trigger, then I'd suggest making an action definition for each unit and in the trigger that has the event, make a single switch statement that will call the appropriate action definition. In case you're not familiar with switch statements, they are identical to if-then-else statements, except that they only compare one value - in this case, you only need to compare the unit type of the triggering unit. Here's what it might look like if applied to the Marine and Zergling. Let me know if you have any questions, there are 1 trigger and 2 action definitions:
@Lascero: Go
Sorry my bad, it cannot call unit type in event.
@OP: The only way you can do is to use condition in your trigger. The "failed trigger" (where the event fire but nothing was done) doesnt actually cost that much traffic as you think it should. I havent figured how to use event definition so that you might take a look into. But for now just stick with condition.
@progammer:
Yeah I know its not 'that' bad of a problem, the lag that it makes is still very small, but I'd still like to fix it. It does contribute late game, and the errors that pop up when flooding happens is annoying. Also its the reason for the 5-10 seconds of startup lag.
I found an alternative anyways. I decided to do everything through the data editor, and have those specific units set as abilities instead of training, this way I can set an even so when "Command center uses buy zerglings ability" -> do actions. (My trigger is set up so when you buy zerglings, a spawning pool is created which spawns zerglings - so instead of having it train the first unit to start the spawning, I made it an ability instead)
Thanks for the help/suggestions guys.
Thread is resolved, closed now...