1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. The member Kam is making HIVE coasters. Take a look. For every coaster you buy, Hive gets $1.
    Dismiss Notice
  3. Buy it, use it, break it, fix it, trash it, change it, mail - upgrade it. Join (Optionally) Paired Techtree Contest #11 - Techno Magic now!
    Dismiss Notice
  4. Dismiss Notice
  5. Hero Contest #8 is up and running! This time it's a joint contest between artists and coders. Go here for team matchmaking.
    Dismiss Notice
  6. The ninth Concept Art Contest has launched. Enter now!
    Dismiss Notice
  7. Our first StarCraft contest, The Galaxy Terraining Contest #1 - World Wonders has started. Enter to show off your Galaxy Editor skills and win a custom rank icon among other things.
    Dismiss Notice
  8. Ever wanted to get your sets ready for fast texturing while still having fun? Now it is possible with our newest Mini-Texturing Contest.
    The Skeleton Units need your dire help!
    Dismiss Notice

Creep Respawn (GUI)

Discussion in 'Trigger (GUI) Editor Tutorials' started by SkriK, Apr 14, 2008.

  1. fvtb

    fvtb
    Joined:
    May 30, 2011
    Messages:
    5
    Thanks for this system. It works fine!
     
  2. Nike2000

    Nike2000
    Joined:
    Jul 17, 2011
    Messages:
    1
    Sorry for noob question, but I can't figure out how to make "Custom value of (triggering unit)" Can anyone help me:S?

    edit: I found, thanks for the system<3
     
  3. Bribe

    Bribe

    Code Moderator

    Joined:
    Sep 26, 2009
    Messages:
    7,338
    What do you mean, "make custom value"? You mean how to replace it?
     
  4. badsanta4cs

    badsanta4cs
    Joined:
    Aug 30, 2011
    Messages:
    12
    hi guys..i just done a half of this tutorial and i need some help..explain me please how i make this lines
    ->Conditions
    (Owner of (Triggering unit)) Equal to Neutral Hostile
    (Custom Value of (Triggering unit)) Greater than 0
     
  5. Pharaoh_

    Pharaoh_
    Joined:
    Nov 6, 2008
    Messages:
    8,127
    The first one is a Player comparison (you can also use (Triggering player) Equal to Neutral Hostile) and the second one is an Integer comparison -> Unit - Custom value of unit.
     
  6. LOTUS.VaNiTy

    LOTUS.VaNiTy
    Joined:
    Jan 31, 2011
    Messages:
    6
    But what if 2 or more units dies at the same time will this trigger work?
     
  7. Squall_Leonheart

    Squall_Leonheart
    Joined:
    Oct 2, 2008
    Messages:
    114
    it works well... dont just comment... read the other comments & posts b4 making ur own.... i even have an example made in the previous posts to help ppl who are clueless.... although all credits goes back to the creator.
     
  8. xorkatoss

    xorkatoss
    Joined:
    Jul 12, 2010
    Messages:
    1,416
    i know how to make one myself but im too lazy and i still have lots of others things to do like MUI spells...
    also i searched the spells section and couldn't find anything...
    so can you post the map? pretty pls? :ogre_hurrhurr:

    EDIT:
    nvm i made one up really quick...also you leak a point when you create a unit...
    and i heard that using custom values of units is not good because if another system uses them too then it will bug...

    to clear the point leak when you create the unit you should save X & Y and then load it using hastables...
    see the creep respawn i made to get a clearer idea...

    Creep Respawn System using Hashtables
    • CR Map Initialization
      • Events
        • Map initialization
      • Conditions
      • Actions
        • Hashtable - Create a hashtable
        • Set CreepRespawn_Hashtable = (Last created hashtable)
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Actions)
          • Loop - Actions
            • Set CreepRespawn_Point = (Position of (Picked unit))
            • Hashtable - Save 8.00 as (Key Time) of (Key (Picked unit)) in CreepRespawn_Hashtable
            • Hashtable - Save (X of CreepRespawn_Point) as 1 of (Key (Picked unit)) in CreepRespawn_Hashtable
            • Hashtable - Save (Y of CreepRespawn_Point) as 2 of (Key (Picked unit)) in CreepRespawn_Hashtable
            • Custom script: call RemoveLocation(udg_CreepRespawn_Point)

    • CR Enter Map
      • Events
        • Unit - A unit enters (Playable map area)
      • Conditions
      • Actions
        • Set CreepRespawn_Point = (Position of (Triggering unit))
        • Hashtable - Save 8.00 as (Key Time) of (Key (Triggering unit)) in CreepRespawn_Hashtable
        • Hashtable - Save (X of CreepRespawn_Point) as 1 of (Key (Triggering unit)) in CreepRespawn_Hashtable
        • Hashtable - Save (Y of CreepRespawn_Point) as 2 of (Key (Triggering unit)) in CreepRespawn_Hashtable
        • Custom script: call RemoveLocation(udg_CreepRespawn_Point)

    • CR Respawn
      • Events
        • Unit - A unit Dies
      • Conditions
        • (Owner of (Triggering unit)) Equal to Neutral Hostile
      • Actions
        • Wait (Load (Key Time) of (Key (Triggering unit)) from CreepRespawn_Hashtable) seconds
        • Set CreepRespawn_Point = (Point((Load 1 of (Key (Triggering unit)) from CreepRespawn_Hashtable), (Load 2 of (Key (Triggering unit)) from CreepRespawn_Hashtable)))
        • Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at CreepRespawn_Point facing Default building facing degrees
        • Custom script: call RemoveLocation(udg_CreepRespawn_Point)



    really? how long can it take? i did that creep respawn in less than 10 mins...
     
    Last edited: Sep 5, 2011
  9. LOTUS.VaNiTy

    LOTUS.VaNiTy
    Joined:
    Jan 31, 2011
    Messages:
    6
    Sorry..Im just new..But thanks anyway i understand it^_^
     
  10. WrathOfTheAncients

    WrathOfTheAncients
    Joined:
    Jan 19, 2012
    Messages:
    1
    I don't understand this part:

    Set Temp_Integer = (Temp_Integer + 1)
    "How can i get the '(Temp_Integer +1)' part? I can't find that!!:ogre_rage:"

    Please help me oh my dear friends :goblin_cry: :goblin_cry:
     
  11. Squall_Leonheart

    Squall_Leonheart
    Joined:
    Oct 2, 2008
    Messages:
    114
    it is a custom trigger. u need to make it on ur own. press ctrl + B n u will see a new window. press edit variables, add new variables.

    now label ur variable as wad u like, for this instance: Temp_Integer [this will be ur label/name of the variable u will create] now select the type of variable it belongs to, for temp_integer <--- this already tells u it is an integer, so select integer variable.

    now create a new action, select set new variable options.
    change the set new variable to the one u created.

    u will have:
    • Set Temp_Integer = (something like this)

    change the (something like this) to arithmetic n select ur Temp_Integer + 1

    and u will have this
    • Set Temp_Integer = (select arithmetic from function)


    then you need to change the function value of the arithmetic to Temp_Integer + 1.

    in the end u get this:
    • Set Temp_Integer = (Temp_Integer + 1)
     
  12. BonerBoo

    BonerBoo
    Joined:
    Jun 19, 2011
    Messages:
    24
    Help please, how can i make this trigger to spawn creeps for player 12 (Brown).
    I tried to change, but creeps respawn only 1 time per game.

    Will give +rep.
     
  13. Squall_Leonheart

    Squall_Leonheart
    Joined:
    Oct 2, 2008
    Messages:
    114
    have u set the creep death type?

    i.e: unit decay, raised... or no raise no decay....

    u'll have to be a lot more specific. :)
     
  14. yumiyum

    yumiyum
    Joined:
    Mar 20, 2012
    Messages:
    16
    It works. Thanks SkriK.
     
  15. Adiktuz

    Adiktuz
    Joined:
    Oct 16, 2008
    Messages:
    9,699
    But what if 2 or more units dies at the same time will this trigger work?

    --> yes, wc3 scripts run one-at-a-time...
     
  16. yumiyum

    yumiyum
    Joined:
    Mar 20, 2012
    Messages:
    16
    How to put special effect line into this trigger?

    • Respawn
      • Events
        • Unit - A unit Dies
      • Conditions
        • (Owner of (Triggering unit)) Equal to Neutral Hostile
        • (Custom value of (Triggering unit)) Greater than 0
      • Actions
        • Custom script: local integer i = GetUnitTypeId(GetTriggerUnit())
        • Custom script: local integer ii = GetUnitUserData(GetTriggerUnit())
        • Wait Respawn_Time game-time seconds
        • Custom script: call SetUnitUserData(CreateUnit(Player(12),i,GetLocationX(udg_Creep_Point[ii]),GetLocationY(udg_Creep_Point[ii]),270),ii)
        • Special Effect - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
        • Special Effect - Destroy (Last created special effect)


    I did that way, but nothing happened.
     
  17. Donach

    Donach
    Joined:
    Jan 12, 2011
    Messages:
    68
    Is this system able to handle more that 8xxx (don't know the right number, that variable can store) units dead in single map?
    If not, you have to implement variable reset :).
     
  18. Adiktuz

    Adiktuz
    Joined:
    Oct 16, 2008
    Messages:
    9,699
    you think there will be a map with 8000+ units? It will definitely lag if you have that many... wc3 might even crash...

    Though it might have been better to update this to use hashtables... The respawn itself can handle any number of units, but the locations can only store up to 8190 coz its an array...
     
  19. Donach

    Donach
    Joined:
    Jan 12, 2011
    Messages:
    68
    Well, then I wouldn't recommend using this in maps like ORPG, that can be played for very long time or long TDs.

    I've created upgraded system to this one. If anyone would be wondering how it looks, just PM me.
     
  20. Adiktuz

    Adiktuz
    Joined:
    Oct 16, 2008
    Messages:
    9,699
    As far as I'm concerned, since it doesn't leak, it shouldn't really cause lag after a long game time...

    anyway, its just a tutorial for those who don't know how to make a simple creep respawn...