HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Whats better "clean coding"?

01-18-2008, 09:23 AM#1
Bloodlust
Hello.

(first, im GUI user)

Right now I have a map with lots of events "unit is attacked". So when I started I just made one trigger like event "unit is attacked" and then a couple of if-then-else actions. But after some days that trigger has grown... long. Really long. Im not sure if some weird things are related to that trigger.

Now I wonder whats better.. keep a long trigger like that or make multiple triggers with the same event for different units or take the time to split it into multiple trigger that get deactivated/activated when those units are in play.

Help, plx.
01-18-2008, 11:06 AM#2
Troll-Brain
Depends what looks like your trigger
01-18-2008, 02:15 PM#4
DioD
individual triggers faster, but you cannot know what trigger run first, second ets.

soo its better to use single trigger with multiple actions (conditions will be faster but must return boolean, soo trigger functions wont get executed by its name)
01-18-2008, 03:50 PM#5
Captain Griffen
You're a GUI user that cares about clean coding and efficiency?

Use JASS.
01-19-2008, 08:43 AM#6
Pyrogasm
And, for the love of pete, do not use the "A Unit is Attacked" event for on-attack stuff. It fires before damage happens and the attack is "committed" to happening.
01-19-2008, 09:46 AM#7
Vexorian
It is not too bad for AI...
01-22-2008, 10:13 AM#8
Bloodlust
Quote:
Originally Posted by Vexorian
It is not too bad for AI...

Exactly thats why I use it. The AI kinda hates using like all abilities that are not autocast and having all abilities as orb effects isnt cool either. I trigger most abilities with something being attacked or attacking.

Anyway, could someone help me with the question? I'd say to make use I just split it into a dozen different triggers and then enable/disable them depending on unit in play but that takes some time and if it isnt improving the map (performance or whatever), I dont waste my time doing it.
01-22-2008, 10:37 AM#9
BBDino
Is performance currently a problem in your map? If not, i wouldn't really worry too much about it.