• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Respawn and Max Level

Status
Not open for further replies.
Level 3
Joined
Jun 25, 2008
Messages
65
1.Is there a way to increase the MAX Unit Level above 100 ?
In Gameplay-Constances or whatever it is in English it does not go above 100...

2. I need a complete Respawner for Creeps.
I already have one, but if i set Respawn_Time above 60 Sec it does not work :/

  • StoreAllUnits
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Unitgroup - Pick every Unit in (Playable MapArea owned by Neutral-Hostile) and do
      • Loop - Actions
        • Set Temp_Value to Temp_Value + 1
        • Set the Customvalue of (Picked Unit) to Temp_Value
        • Set Creep_Point[Temp_Value] = (Position of (Picked Unit))
Same for Unit that enter the Map...

  • Respawn
  • Events
    • Unit - A Unit dies
  • Conditions
    • Owner of Triggering Unit is equal to Neutral - Hostile
  • Actions
    • Wait Respawn_Time seconds
    • Unit - Create 1 (Unit-Type of (Triggering Unit)) for Neutral Hostile at (Creep_Point(Custom Value of (Triggering Unit))) facing ...
    • Unit - Set the (Custom Value of (Last Created Unit)) to (Custom Value of (Triggering Unit))
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
  • StoreAllUnits
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Unitgroup - Pick every Unit in (Playable MapArea owned by Neutral-Hostile) and do
      • Loop - Actions
        • Set Temp_Value to Temp_Value + 1
        • Set the Customvalue of (Picked Unit) to Temp_Value
        • Set Creep_Type[Temp_Value] = (Unit typer of (Picked Unit))
        • Set Creep_Point[Temp_Value] = (Position of (Picked Unit))
Creep_Type is a global array of type Unit type.

  • Respawn
  • Events
    • Unit - A Unit dies
  • Conditions
    • Owner of Triggering Unit is equal to Neutral - Hostile
  • Actions
    • Custom script: local integer udg_Temp_Integer
    • Set Temp_Integer = Custom Value of (Last Created Unit)
    • Wait Respawn_Time seconds
    • Unit - Create 1 (Creep_Type[Temp_Integer]) for Neutral Hostile at (Creep_Point(Temp_Integer)) facing 270
    • Unit - Set the (Custom Value of (Last Created Unit)) to (Temp_Integer)
Temp_Integer is a global variable of type integer.
 
Level 6
Joined
Jul 25, 2005
Messages
221
Your first question answered:

First, highlight your WE so that you can see your map, then click on "Advanced" in the WE menu, from there click "Gameplay Constants" then scroll down to the very bottom of that list, don't forget to check the box that says "Use Custom Gameplay Constants", there's the little fella' :) it says "MaxUnitLevel", so just change it from 20 to 100 or whatever number you see fit. Gameplay constants rock.

EDIT:
Oh, sorry didnt finish reading, in any case, yes shift+enter/click will override the preset maximum of that field and let you put all sorts of numbers in them, even negative ones. I think I mentioned this in another post :cute:
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
NeC-ChRiSS said:
In Gameplay-Constances or whatever it is in English it does not go above 100...
You did not answer his question. Read people's posts first.
Answer: Just hold shift when you are double clicking/pressing enter on the field.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
This bug that I used, the local variable trick, only works once per trigger - you can have only one local variable.
 
Level 6
Joined
Jul 25, 2005
Messages
221
A bug? I thought it was because you can only declare locals in the beginning of each trigger just like in JASS,

JASS:
function locals takes nothing returns nothing
//Start declaring locals
local integer i = 'h00A'
local group g = CreateGroup()
local real x = 100
local real y = -100
local unit u = CreateUnit(Player(0), i, x,y,270)
local gamecache gc = udg_"NameOfGameCache" //Created in WE triggers to declare globals
local rect = Rect(-100,-100,100,100)
local location = Location(x,y)
//Finished declaring locals
This can be done in GUI, you just have to have all the locals declared above all other actions for them to work.
If you meant that the local variable can't be transferred from one trigger to another you are certainly correct, once a local is declared it cannot be used in another function. :cute:

EDIT: Aha you've been reading this http://www.hiveworkshop.com/forums/f279/multi-instancible-gui-spell-making-34393/
 
Last edited:
Level 12
Joined
Apr 27, 2008
Messages
1,228
Dude... please ... you have very little idea what you are talking about(well maybe you have a better idea now).
Don't tell me that you are using local variables in gui :D
What, you are using "Custom script: local integer i" ?
And how do you use that variables?
"Custom script: set i=i+1" ?
That would do it for storing something in the variable, but how are going to use it?
Another custom script.
If all your actions a re Custom script, it is no longer GUI.
The bug/trick ( yes it is a bug; look carefully at the trigger I posted) is:
declaring a local variable with the same name as a global one.
Now when you use the global one in your GUI actions, wc3 will actually use the local one.
But as I said, It can be used only once per trigger.
 
Level 6
Joined
Jul 25, 2005
Messages
221
No, Im not using custom scripts in GUI for my commands... that would be incredibly stupid >.<

Im an exercised JASSer (i think :p) and am aware of how locals work.
I think my post is confusing... at least for myself hehe because I cannot find a reason for posting it... i guess it could be, instead of using two lines

local "variabletype" a
set a = value

it is better to combine them

local "variabletype" a = value

but we all know this so why did i post that? :cute:

Just forget me ever posting the darn thing...
 
Status
Not open for further replies.
Top