HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A Unit Attacks - Laggy?

11-19-2005, 05:48 PM#1
MrApples3
Ok I have this trigger, and Im wondering if it may be more torublesome than having it becdause it runs whenever A Unit is Attacked which is ALOT. Im curious if it causes lag if the initial conditions are false.

Code:
SA Smart Ally
    Events
        Unit - A unit Is attacked
    Conditions
        ((Owner of (Attacked unit)) is an ally of (Owner of (Attacking unit))) Equal to True
        ((Owner of (Attacking unit)) is an ally of (Owner of (Attacked unit))) Equal to True
        ((Attacked unit) is in (Units owned by (Owner of (Attacking unit)))) Equal to False
    Actions
        Set TempPlayerGroup = (Player group((Owner of (Attacked unit))))
        Game - Display to TempPlayerGroup for 30.00 seconds the text: ((SMART ALLY:  + (Name of (Owner of (Attacking unit)))) +  has attacked you thus declaring war.)
        Custom script:   call DestroyForce(udg_TempPlayerGroup)
        Set TempPlayerGroup = (Player group((Owner of (Attacking unit))))
        Game - Display to TempPlayerGroup for 30.00 seconds the text: ((SMART ALLY: You have attacked a unit owned by  + (Name of (Owner of (Attacked unit)))) +  thus declaring war.)
        Custom script:   call DestroyForce(udg_TempPlayerGroup)
        Player - Make (Owner of (Attacking unit)) treat (Owner of (Attacked unit)) as an Enemy
        Trigger - Run SA Smart Ally On <gen> (ignoring conditions)
        Trigger - Turn off (This trigger)
SA Smart Ally On is just there so that the player doesn't get 200 messages.
11-19-2005, 06:27 PM#2
Vexorian
I have worse stuff on that event and do not face clear problems