1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Setting it so units only live at night.

Discussion in 'World Editor Help Zone' started by Leet_Zeno, Aug 10, 2008.

  1. Leet_Zeno

    Leet_Zeno

    Joined:
    Aug 10, 2008
    Messages:
    6
    Resources:
    0
    Resources:
    0
    I'm trying to work on a skill that summons creatures, and i'm trying to make a trigger where it will only be alive at night, as well as the spell being castable only at night.


    And I am also trying to make it so that my hero is invulnerable when casting. Any trigger advice?
     
  2. CMarket

    CMarket

    Joined:
    Apr 21, 2007
    Messages:
    1,233
    Resources:
    12
    Maps:
    12
    Resources:
    12
    Well, you can create a Real Variable and set it up in a trigger like this:

    • Events
      • Time - Every 0.1 seconds
    • Conditions
    • Actions
      • Set TIME = (In-game time of day)

    Now for the casting trigger we will use a spell that requires 3 seconds to cast called Summon Shade and this trigger:

    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Summon Shade
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • A Greater than or equal to 18.00
          • A Less than 6.00
        • Then - Actions
          • Unit - Add Invulnerable (Neutral) to (Casting unit)
          • Wait 3.00 seconds
          • Unit - Remove Invulnerable (Neutral) from (Casting unit)
        • Else - Actions
          • Unit - Order (Casting unit) to Stop


    Now since all of those shades can be summoned after 18 pm we need a trigger that will kill any shades still alive at 6 am so we use this:

    • Events
      • Game - The in-game time of day becomes Equal to 6.00
    • Conditions
    • Actions
      • Set ShadeUG = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Shade))
      • Unit Group - Pick every unit in ShadeUG and do (Unit - Kill (Picked unit))


    Oh, ShadeUG is a unit group variable.
     
  3. Leet_Zeno

    Leet_Zeno

    Joined:
    Aug 10, 2008
    Messages:
    6
    Resources:
    0
    Resources:
    0
    ty and sorry for posting in wrong board.


    I can't seem to find the "a greater than or equal to 18.00" and the "a less than 6.00"
     
    Last edited: Aug 10, 2008
  4. RunBa

    RunBa

    Joined:
    Jul 22, 2008
    Messages:
    353
    Resources:
    0
    Resources:
    0
    Lag!!

    • Time - every 0.1 second? NOOOO!!!

    TO LAGY. why not
    • Time - Every 1 second of the game time

    Kafandzhijo...
     
  5. Squiggy

    Squiggy

    Joined:
    Mar 25, 2008
    Messages:
    2,620
    Resources:
    18
    Maps:
    2
    Spells:
    15
    Tutorials:
    1
    Resources:
    18
    setting a variable every .1 seconds doesn't cause lags
     
  6. RunBa

    RunBa

    Joined:
    Jul 22, 2008
    Messages:
    353
    Resources:
    0
    Resources:
    0
    nop. what case them?
     
  7. Mechanical Man

    Mechanical Man

    Joined:
    Jan 18, 2005
    Messages:
    5,385
    Resources:
    39
    Models:
    30
    Icons:
    3
    Packs:
    1
    Maps:
    4
    Tutorials:
    1
    Resources:
    39
    You can set their regeneration rate to minus <big number> which is active only at day.
     
  8. YoshiRyu

    YoshiRyu

    Joined:
    Jun 26, 2007
    Messages:
    686
    Resources:
    0
    Resources:
    0
    why using a variable to store a value you can ask at any time?

    the following trigger will works the same and will avoid the useless first one :
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Summon Shade
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or (you've forgoten this)
            • (In-game time of day) Greater than or equal to 18.00
            • (In-game time of day) Less than 6.00
        • Then - Actions
          • Unit - Add Invulnerable (Neutral) to (Casting unit)
          • Wait 3.00 seconds
          • Unit - Remove Invulnerable (Neutral) from (Casting unit)
        • Else - Actions
          • Unit - Order (Casting unit) to Stop


    @RunBa : basically, everything cause lags, games just lags when they've got too many things to do
    a "every 0.1s" trigger cause as lags as ten "every 1.0s" triggers
    you make the game lags with a single "every 0.1s" trigger only if this one ask the game to do tons of actions.
     
  9. Rvsoldier

    Rvsoldier

    Joined:
    Oct 18, 2007
    Messages:
    141
    Resources:
    0
    Resources:
    0
    I'm liking mechanical mans idea, its definitely the simplest way to do it and theres no chance in hell to cause lag.
     
  10. exfyre

    exfyre

    Joined:
    Nov 7, 2007
    Messages:
    32
    Resources:
    2
    Models:
    2
    Resources:
    2
    then agin, he doesnt want it to be castable. It is still castable even with their HP regen set to -999999

    One way would be
    • Events
      • Game - The in-game time of day becomes Equal to 6.00
    • Conditions
    • Actions
      • Remove *your summoning ability here* from *your unit here*


    And Add Ability when it becomes night time
     
  11. Numerion

    Numerion

    Joined:
    Jul 3, 2008
    Messages:
    644
    Resources:
    0
    Resources:
    0
    exfyre is right, this trigger is easy and working
     
  12. onix_noob

    onix_noob

    Joined:
    May 30, 2008
    Messages:
    433
    Resources:
    1
    Maps:
    1
    Resources:
    1
    the simple way is like is telling up set the unit life regeneration at -2342 at day and when day come unit will die this is the most easy think
     
  13. Equal

    Equal

    Joined:
    Mar 23, 2007
    Messages:
    306
    Resources:
    1
    Maps:
    1
    Resources:
    1
    We need both, because he wants it to be:
    1. only castable at night so:
    • Events
    • Game - The in-game time of day becomes Equal to 6.00
    • Conditions
    • Actions
    • Remove *your summoning ability here* from *your unit here*

    (And the same to get the ability back at night)

    2.-999 HP regen at day, to make them die at day even when summoned right before 6 in the morning.