Improve my 'base' trigger system for my map? (long)

Synoscope

New Member
Reaction score
1
I use this system a lot. It involves setting and unsetting variables dependent on player actions. I'd like to know if it can be improved or if it's a bad system in general because I think I know enough start producing a map I've been working on (for realzies)

Okay. Each player has 1 unit they use. That unit is assigned a variable (arrayed) that corresponds with the controller.

Red's Unit is PlayerUnitArray[1]
Blue's Unit is PlayerUnitArray[2]
All the way through 11.
Player 12 is used for NPCs

Now I use this variable to set other variables to make my triggers work and in return make the game function in an interesting manner.

Example:
Code:
Event
    A unit is attacked
Condition
    Attacked unit-type = Survivor (survivor is the 1 unit each player has)
    Attacking unit-type = Zombie 
    And: (All conditions are true)
        Triggering Unit not equal to Immune_Zombify_Surv[1]
        Triggering Unit not equal to Immune_Zombify_Surv[2]
          //All the way through 11.  This way units can't get 'zombified' if they have acquired an immunity to it.

Now I would set these immunities through variables and players would acquire them through items (most likely) Example, within an example: Player 1 uses an item that gives him immunity to zombify status --- Set PlayerUnitArray[1] = Immune_Zombify_Surv[1]. Now he can't become zombified for the duration of the match.

Code:
Action
    If/Then/Else
        If:
            Triggering unit = PlayerUnitArray[1]
        Then:
            Set Zombie_Surv[1] = Triggering Unit
            Create 1 dummy for player 12 (Brown)
            Give last created unit Zombify (Passive) //Envenomed spears- damage over time until cured.
            Order last created unit to attack once Zombie_Surv[1]
            Add ability Zombify(tornado) to Zombie_Surv[1] //Tornado has a blank buff that lets the player know what's happening to his character
        Else
            Do Nothing
    If/Then/Else
        If:
            Triggering unit = PlayerUnitArray[2]
        Then:
            Set Zombie_Surv[2] = Triggering Unit
            Create 1 dummy for player 12 (Brown)
            Give last created unit Zombify (Passive)
            Order last created unit to attack once Zombie_Surv[2]
            Add ability Zombify(tornado) to Zombie_Surv[2]
        Else
            Do Nothing

I have this If/Then/Else action for every player on the map. That way if a survivor gets hit with zombify they can be used to activate other triggers that effect 'zombified' units. (Create zombie on death for example)


Code:
Event:
    Unit- A unit starts the effect of an ability
Condition
    Ability being cast = "UnZombifyItem" effect  //An item that would have the discription of "Removes the state of Zombify, bla bla bla."
Action
    If/Then/Else
        If:
            Target of Ability Being cast= Zombie_Surv[1]
        Then:
            Remove Zombify (tornado) ability from Zombie_Surv[1] 
            Remove debuff Zombified from Zombie_Surv[1] 
            Set Zombie_Surv[1] = PlayerUnitArray[12] //This clears the 'zombify' status from the survivor by placing it onto a dummy,
            Set Immune_Zombify_Surv[1] = PlayerUnitArray[1] //This will make the survivor immune to the zombify effects.
        Else
            Do Nothing

I, of course, have the If/Then/Else for every player's unit.


Example of a reasoning for setting the Zombify_Surv Variable
Code:
Event
    A unit dies
Condition
    Or
        Triggering unit is equal to Zombify_Surv[1]
        Triggering unit is equal to Zombify_Surv[2] //for each player
Action
    Create 1 Zombie for player 12 at location of dying unit.


I know it's a lot to read through but I'd really like to know what the better mappers think of it so I can start this map. If it's a bad system I don't won't to use it (for I'll be using it a lot) or if it could use improvement I'd like to know.

Also, if it's a bad system I'd appreciate a better one (a link or a quick run through)

Thanks.
 

Exide

I am amazingly focused right now!
Reaction score
448
Code:
Event
    A unit dies
Condition
    Or
        Triggering unit is equal to Zombify_Surv[1]
        Triggering unit is equal to Zombify_Surv[2] //for each player
Action
    Create 1 Zombie for player 12 at location of dying unit.

-Could check the Unit Type of the (Triggering Unit) instead of comparing each unit.
For example:

Code:
Event
    A unit dies
Condition
    Unit -Type of (Triggering Unit) Equal to [B]*Your_Unit_Type_Here*[/B]
Action
    Create 1 Zombie for player 12 at location of dying unit.


Same thing here:
Code:
Event
    A unit is attacked
Condition
    Attacked unit-type = Survivor (survivor is the 1 unit each player has)
    Attacking unit-type = Zombie 
    And: (All conditions are true)
        Triggering Unit not equal to Immune_Zombify_Surv[1]
        Triggering Unit not equal to Immune_Zombify_Surv[2]
You can use Unit -Types there as well. (Unless, of course, you are using the same unit type for other things. -When it comes to player Heroes, you normally don't, though..)


You can remove all the 'Do Nothing' functions, they're useless.
IE:
Code:
Event:
    Unit- A unit starts the effect of an ability
Condition
    Ability being cast = "UnZombifyItem" effect  //An item that would have the discription of "Removes the state of Zombify, bla bla bla."
Action
    If/Then/Else
        If:
            Target of Ability Being cast= Zombie_Surv[1]
        Then:
            Remove Zombify (tornado) ability from Zombie_Surv[1] 
            Remove debuff Zombified from Zombie_Surv[1] 
            Set Zombie_Surv[1] = PlayerUnitArray[12] //This clears the 'zombify' status from the survivor by placing it onto a dummy,
            Set Immune_Zombify_Surv[1] = PlayerUnitArray[1] //This will make the survivor immune to the zombify effects.
        Else
            Do Nothing

Could be:

Code:
Event:
    Unit- A unit starts the effect of an ability
Condition
    Ability being cast = "UnZombifyItem" effect  //An item that would have the discription of "Removes the state of Zombify, bla bla bla."
Action
    If/Then/Else
        If:
            Target of Ability Being cast= Zombie_Surv[1]
        Then:
            Remove Zombify (tornado) ability from Zombie_Surv[1] 
            Remove debuff Zombified from Zombie_Surv[1] 
            Set Zombie_Surv[1] = PlayerUnitArray[12] //This clears the 'zombify' status from the survivor by placing it onto a dummy,
            Set Immune_Zombify_Surv[1] = PlayerUnitArray[1] //This will make the survivor immune to the zombify effects.
        [COLOR="Red"]Else[/COLOR]
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top