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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  4. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  5. 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.

Night Time invisibility

Discussion in 'Triggers & Scripts' started by Em!, Feb 27, 2009.

  1. Em!

    Em!

    Joined:
    Jan 9, 2004
    Messages:
    539
    Resources:
    26
    Models:
    24
    Maps:
    2
    Resources:
    26
    Night Invisibility
    Events
    Game - The in-game time of day becomes Equal to 18.00
    Conditions
    Actions
    Unit Group - Pick every unit in (Units of type Peon) and do (Actions)
    Loop - Actions
    Unit - Add Night Invisibility to (Picked unit)

    and then the second trigger is to remove the ability when The in-game time of day becomes Equal to 6.00

    I need the spell to last through the night so that trained units that missed the time frame will also become invisible *I don´t know how to do that :(*, also i know this spell will most likely leak so any ideas that might prevent that would be appreciated :cute:
     
  2. Restor

    Restor

    Joined:
    Mar 26, 2005
    Messages:
    728
    Resources:
    0
    Resources:
    0
    ehm

    E:Unit - A unit Finishes training a unit

    C:Type of Trained unit is XY OR type of trained unit is YX....

    If then else
    If time is between 18 and 6, give invisibility
     
  3. Em!

    Em!

    Joined:
    Jan 9, 2004
    Messages:
    539
    Resources:
    26
    Models:
    24
    Maps:
    2
    Resources:
    26
    Conflicts with the battalion triggers, can´t use trained unit...
    The battalion trigger function like thus when a captain of the battalion is trained additional units are spawned by his side.

    Maybe i should have mentioned that before :s

    - Gah, i just realized that with it like this its impossible to help me without viewing the map and the battalion trigger functions. veeh, i´ll have to figure this out by myself but you did give me an idea and thanks for that lol
     
  4. Rmx

    Rmx

    Joined:
    Aug 27, 2007
    Messages:
    1,088
    Resources:
    18
    Icons:
    3
    Spells:
    15
    Resources:
    18
    Well u can use.........

    Time every 4 seconds of Game time .......

    Condition - if Time of day is between ? and ? equal to true

    Action - Set PeonGroup = Units of type peon

    Unitgroup - pick every unit in PeonGroup and do action.
    Give invis to PEON
    Call DestoryGroup(udg_PeonGroup)

    Done this sould help !
     
  5. Restor

    Restor

    Joined:
    Mar 26, 2005
    Messages:
    728
    Resources:
    0
    Resources:
    0


    I still dont get where is the conflict.
     
  6. Em!

    Em!

    Joined:
    Jan 9, 2004
    Messages:
    539
    Resources:
    26
    Models:
    24
    Maps:
    2
    Resources:
    26
    Ahh have to ask a probably a stupid question but where can i find con*if time of day is between*

    i only found (In-game time of day) Greater than or equal to in real comparison

    Edit:The additional spawned unit are not trained, there created via trigger and follow the trained unit around mimicking its exacts orders but i need them to aquire the ability aswel.
     
  7. Lord_BoNes

    Lord_BoNes

    Joined:
    Sep 5, 2007
    Messages:
    264
    Resources:
    0
    Resources:
    0
    Would always giving the unit the ability, and using SetPlayerAbilityAvailable() work? Just a thought.

    EDIT: To do "time of day is in-between", you have to use an and with "time of day is greater than" & "time of day is less than", that's the only way I've ever found to do it.
     
  8. Restor

    Restor

    Joined:
    Mar 26, 2005
    Messages:
    728
    Resources:
    0
    Resources:
    0
    thats two conditions combinated of course

    ((In-game time of day) Greater than or equal to 18.00) or ((In-game time of day) Less than or equal to 6.00)




    And for the second thing, thats not conflict.


    You can give invisibility to units created via triggers also.

    Depening on your triger, give there the line "Unit - Add Night Invisibility to (Last created unit)" or whatever, i would have to see the concrete trigger
     
  9. Em!

    Em!

    Joined:
    Jan 9, 2004
    Messages:
    539
    Resources:
    26
    Models:
    24
    Maps:
    2
    Resources:
    26
    I apologize for my noob like behavior but triggers are just not my thing lol,

    tis is what i got so far

    (In-game time of day) Less than or equal to 6.00
    Unit Group - Pick every unit in (Units of type Peon) and do (Actions)
    Loop - Actions
    Unit - Remove Night Invisibility from (Picked unit)
    Custom script: Call DestoryGroup(udg_PeonGroup)

    is the custom script in the correct place?
     
  10. M4stah

    M4stah

    Joined:
    Feb 16, 2009
    Messages:
    711
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    These triggers SHOULD do the trick.

    • Night invisibility
      • Events
        • Game - The in-game time of day becomes Equal to 18.00
      • Conditions
        • (In-game time of day) Greater than or equal to 18.00
        • (In-game time of day) Less than or equal to 6.00
      • Actions
        • Unit Group - Pick every unit in (Units of type Peon) and do (Unit - Add Invisibility to (Picked unit))


    • Trained units
      • Events
        • Unit - A unit Finishes training a unit
      • Conditions
        • (Unit-type of (Trained unit)) Equal to Peon
      • Actions
        • Trigger - Run Night invisibility <gen> (checking conditions)


    • Night invisibility off
      • Events
        • Game - The in-game time of day becomes Equal to 6.01
      • Conditions
      • Actions
        • Unit Group - Pick every unit in (Units of type Peon) and do (Unit - Remove Invisibility from (Picked unit))
     
  11. Em!

    Em!

    Joined:
    Jan 9, 2004
    Messages:
    539
    Resources:
    26
    Models:
    24
    Maps:
    2
    Resources:
    26
    Yah it works, after a few adjustments i managed to make it work, thanks a lot you guys :p