How to: Create a Creep Revival System

Tinki3

Special Member
Reaction score
418
Post your current code. It is most likely a typo.

Keep in mind that when referencing global variables in JASS, or with Custom Script,
you must use the correct syntax, with everything being case sensitive:

'udg_' is always put before any global variable in JASS/CS.
'_' is used instead of spaces in variable names.

So..

Creep X, would become: udg_Creep_X, in JASS/CS.
 
A

Awestruck

Guest
An alternative to saving the unit location as coordinates would be creating a region for each unit and refering to it with an arrey variable in much the same way. This should counter the problem that arises when changing map boundaries.

I suggest, for the second trigger, putting the actions in an if/then/else and adding a condition checking for nearby units. If the condition returns false the unit wont be respawned obviously, that's why you add a "run this trigger" in the else-actions. This way the unit will be respawned almost as soon as no one is nearby to be ambushed by creeps magically apearing out of nowhere.

Just a few optional additions :)
 

The Pigeon

Cool Member
Reaction score
0
That's an impressive looking trigger. Getting creeps to respawn where they first appeared has been a thorn in my side for years (that and I didn't know the purpose of the custom unit value thing). One question though, at the bottom it says "This tutorial also includes a demo map: ". Where's the demo map?

UPDATE: Wait, never mind, I see it. It just doesn't show on the tutorials site.
(http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=55581)

UPDATE: Just thought I'd mention how much I like the fact that the trigger's so LITTLE. My work around would have been as large as a map's worth of triggers.
 

NetherHawk

New Member
Reaction score
26
amazing as always Tinki3, but i have a question. When u revive the units, u put in a wait function of 5 sec, if 2 units die 1 after another, will the wait functions overlapp and only repsawn the unit that died later?
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
Add a point variable array named tempPoint

Code:
Revive Creeps 1 by 1
    Events
        Unit - A unit Dies
    Conditions
        ((Owner of (Triggering unit)) Equal to Neutral Hostile) and (((Triggering unit) is Summoned) Not equal to True)
    Actions
        Wait 5.00 game-time seconds
        Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at ((Center of (Entire map)) offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])) facing (Random angle) degrees
        Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))

Can then be made leakless like this:

Code:
Revive Creeps 1 by 1
    Events
        Unit - A unit Dies
    Conditions
        ((Owner of (Triggering unit)) Equal to Neutral Hostile) and (((Triggering unit) is Summoned) Not equal to True)
    Actions
        Wait 5.00 game-time seconds
        Set tempPoint[1] = (Center of (Entire map))
        Set tempPoint[2] = tempPoint[1] offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))])
        Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at tempPoint[2] facing (Random angle) degrees
        Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
        Custom Script: call RemoveLocation(udg_tempPoint[1])
        Custom Script: call RemoveLocation(udg_tempPoint[2])

Assuming Center of Entire map doesn't leak and you'd want the trigger leakless
 

chewett

New Member
Reaction score
0
An alternative to saving the unit location as coordinates would be creating a region for each unit and refering to it with an arrey variable in much the same way. This should counter the problem that arises when changing map boundaries.

I suggest, for the second trigger, putting the actions in an if/then/else and adding a condition checking for nearby units. If the condition returns false the unit wont be respawned obviously, that's why you add a "run this trigger" in the else-actions. This way the unit will be respawned almost as soon as no one is nearby to be ambushed by creeps magically apearing out of nowhere.

Just a few optional additions :)

but this is exatly what i dont want to do as i dont want 100+ regions just for units

therefore i use point 0 0
 

Tinki3

Special Member
Reaction score
418
> if 2 units die 1 after another, will the wait functions overlapp and only repsawn the unit that died later?

No, as "Triggering unit" is used as reference to the dying unit, thus it is "MUI".
Triggering unit is not overwritten either.

In saying this, you can increase the wait interval to a large(r) number and the dying unit will still "revive".
 
X

ximbabwe0228

Guest
There is a much simpler way to do this for people who suk at variables (moi). Simply create a region where the creeps start. Text in braces {} represents individually-defined values. Text in brackets [] represents the trigger. Text in parentheses () represents underlined blue or red text in the editor.
*events*
-Unit - player owned unit event.
[a unit owned by (neutral hostile) (dies).]
*conditions*
-boolean -
[(event response - dying unit) is (a summoned unit) (equal to) (false).]
*actions*
-Unit - create
[Create (1) (event response - unit type of dying unit) at ({your region}) facing ({whatever}) angle.

I am not trying to degrade you in any way, Tinki3, and I appreciate your contribution.

also if u wanted only 1 res: either a) give it an ankh or b) as 1 last action do
-trigger - turn off
[Turn off (this trigger)].

Also +rep tinki3.
 

chango

New Member
Reaction score
1
Problem with the wait...

Hello,

Thanks for the tutorial i learn a lot of it, but it wont work fine for me :confused:. I have a problem with the wait action, if i put 4 sec or less works fine but if i use 5 sec or more the creep does not respawn.

Yes i have only one creep in my map :D

Here is the code of my trigger:

Code:
ReviveCreep
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        ((Triggering unit) is Summoned) Equal to False
    Actions
        Wait 4.00 game-time seconds
        Set tempPoint[1] = (Center of (Entire map))
        Set tempPoint[2] = (tempPoint[1] offset by (Creep_X[(Custom value of (Triggering unit))], Creep_Y[(Custom value of (Triggering unit))]))
        Unit - Create 1 (Unit-type of (Triggering unit)) for Neutral Hostile at tempPoint[2] facing (Random angle) degrees
        Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
        Custom script:   call RemoveLocation(udg_tempPoint[1])
        Custom script:   call RemoveLocation(udg_tempPoint[2])

Also i have a item in the creep and i don't know how to make it to drop every time.

Any ideas ??

Thanks :D
 

Attachments

  • PrimerMapaChango.w3x
    31.2 KB · Views: 509

Warplord

Cool Member
Reaction score
0
Can I set it to Player 11 (Dark Green) also ?

Because I did ... and it doesn't revive anything .... :(
 
B

bakerpresent

Guest
this was really helpful.. im totally new to the WE and this helped me get to know it a little
i loaded the lost temple map for TFT and used this tutorial to make the creeps respawn. It took me a little while cause i had to search through all the triggers-events-conditions-actions menus.

was cool though thx

- bakerpresents
 
D

Dromm

Guest
expected a name?

Whenever I use this trigger and try to test/save my map it comes up with errors for the two customscript codes and says "Error: Expected a name"

can I get some help please?
 

Ynklig

New Member
Reaction score
0
If I got an items on the creep that dies, will the one that respawn have the same items? Or should it be more triggers for that?

Great tut anyway! :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top