• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Unit Name

Status
Not open for further replies.
Level 6
Joined
Dec 24, 2012
Messages
187
How can i make a unit name in a wave ?
just like:
wave 1 - Murloc
wave 2 - Abomination
wave 3 - Batrider
and so on.

this trigger won't work
  • Game - Display to (All players) the text: (|c00FCC430Level|r + ( - + ((String(LevelCount)) + ( |c00F27AD0 + (Name of Unit)))))
Here's my full trigger:
Spawning-
  • Spwans initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set GamePlayers = (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User)))
      • Set CreepArray[1] = Fat Guy
      • Set CreepArray[2] = Zombie Doll
      • Set CreepArray[3] = Bat
      • Set CreepArray[4] = Dead Vampire
      • Set CreepArray[5] = Meme (Weakest Boss)
      • Set CreepArray[6] = Armored Soldier
      • Set CreepArray[7] = Pool Searcher
      • Set CreepArray[8] = SnakeBat
      • Set CreepArray[9] = Kitty
      • Set CreepArray[10] = Sexy Big Boobs (Weaker Boss)
      • Set CreepArray[11] = Monkey
      • Set CreepArray[12] = Gorilla
      • Set CreepArray[13] = Bat King
      • Set CreepArray[14] = Werewolf
      • Set CreepArray[15] = Witch Spider (Weak Boss)
      • Set CreepArray[16] = Possessed Motorbike
      • Set CreepArray[17] = Possessed Mechanic Chicken
      • Set CreepArray[18] = Possessed Air Drone
      • Set CreepArray[19] = Possessed Tank
      • Set CreepArray[20] = Think-Care (Average Boss)
      • Set creepCount_LastIndex = 100
      • Visibility - Disable fog of war
      • Visibility - Disable black mask
      • Game - Display to (All players) for 20.00 seconds the text: |cff87ceebHello Pla...
      • Set colourGold = |cffffcc00
      • Set colourPlayers[1] = |c00ff0303
      • Set colourPlayers[2] = |c000042ff
      • Set colourPlayers[3] = |c001ce6b9
      • Set colourPlayers[4] = |c00540081
      • Set colourPlayers[5] = |c00fffc01
      • Set colourPlayers[6] = |c00feba0e
      • Set HostileCreeps = Player 11 (Dark Green)
      • Player - Turn Gives bounty On for HostileCreeps
      • Set LivesCount = 100
Region-
  • Entering Regions
    • Events
      • Unit - A unit enters Enemy Respawn <gen>
      • Unit - A unit enters Break 1 <gen>
      • Unit - A unit enters Break 2 <gen>
      • Unit - A unit enters Break 3 <gen>
      • Unit - A unit enters Break 4 <gen>
      • Unit - A unit enters Break 5 <gen>
      • Unit - A unit enters Break 6 <gen>
      • Unit - A unit enters Break 7 <gen>
      • Unit - A unit enters Break 8 <gen>
      • Unit - A unit enters Break 9 <gen>
      • Unit - A unit enters Break 10 <gen>
      • Unit - A unit enters EnemyEndGame <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to HostileCreeps
    • Actions
      • Unit - Set the custom value of (Triggering unit) to ((Custom value of (Triggering unit)) + 1)
      • Set tmPoint = (Center of RegionArray[(Custom value of (Triggering unit))])
      • Unit - Order (Triggering unit) to Move To tmPoint
      • Custom script: call RemoveLocation( udg_tmPoint )
Number of Units:
  • Spawning Area
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set CreepsSpawnCount[1] = 10
      • Set CreepsSpawnCount[2] = 10
      • Set CreepsSpawnCount[3] = 10
      • Set CreepsSpawnCount[4] = 10
      • Set CreepsSpawnCount[5] = 1
      • Set CreepsSpawnCount[6] = 10
      • Set CreepsSpawnCount[7] = 10
      • Set CreepsSpawnCount[8] = 10
      • Set CreepsSpawnCount[9] = 10
      • Set CreepsSpawnCount[10] = 1
      • Set CreepsSpawnCount[11] = 10
      • Set CreepsSpawnCount[12] = 10
      • Set CreepsSpawnCount[13] = 10
      • Set CreepsSpawnCount[14] = 10
      • Set CreepsSpawnCount[15] = 1
      • Set CreepsSpawnCount[16] = 10
      • Set CreepsSpawnCount[17] = 10
      • Set CreepsSpawnCount[18] = 10
      • Set CreepsSpawnCount[19] = 10
      • Set CreepsSpawnCount[20] = 1
      • Set CreepsSpawnCount[21] = 10
      • Set CreepsSpawnCount[22] = 10
      • Set CreepsSpawnCount[23] = 10
      • Set CreepsSpawnCount[24] = 10
      • Set CreepsSpawnCount[25] = 1
      • Set CreepsSpawnCount[26] = 10
      • Set CreepsSpawnCount[27] = 10
      • Set CreepsSpawnCount[28] = 10
      • Set CreepsSpawnCount[29] = 10
      • Set CreepsSpawnCount[30] = 1
      • Set CreepsSpawnCount[31] = 20
      • Set CreepsSpawnCount[32] = 20
      • Set CreepsSpawnCount[33] = 20
      • Set CreepsSpawnCount[34] = 20
      • Set CreepsSpawnCount[35] = 2
      • Set CreepsSpawnCount[36] = 20
      • Set CreepsSpawnCount[37] = 20
      • Set CreepsSpawnCount[38] = 20
      • Set CreepsSpawnCount[39] = 20
      • Set CreepsSpawnCount[40] = 1
      • Set CreepsSpawnCount[41] = 20
      • Set CreepsSpawnCount[42] = 20
      • Set CreepsSpawnCount[43] = 20
      • Set CreepsSpawnCount[44] = 20
      • Set CreepsSpawnCount[45] = 1
      • Set CreepsSpawnCount[46] = 20
      • Set CreepsSpawnCount[47] = 20
      • Set CreepsSpawnCount[48] = 20
      • Set CreepsSpawnCount[49] = 20
      • Set CreepsSpawnCount[50] = 1
can you make the trigger just like this that worked ?
  • Game - Display to (All players) the text: (|c00FCC430Level|r + ( - + ((String(LevelCount)) + ( |c00F27AD0 + (Name of Unit)))))
:ogre_frown:
 
Level 6
Joined
Dec 24, 2012
Messages
187
What's the value of "Unit"?

Maybe you want something like this

  • Set CurrentWave = 5
  • Custom script: set udg_String = GetObjectName(CreepArray[udg_CurrentWave])
  • Game - Display to (All players) the text: (|c00FCC430Level|r + ( - + ((String(LevelCount)) + ( |c00F27AD0 + String))))
The unit is owned by player 12(Brown) or HostileCreeps
i'm making a TD map..
the value of that is the enemy unit's name.
that variable is just an example.
can you help me with this?

EDITED:
I Bet, no one can solve this -_-
there are many threads about this but no one can answer..
 
Last edited:

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
The unit is owned by player 12(Brown) or HostileCreeps
i'm making a TD map..
the value of that is the enemy unit's name.
that variable is just an example.
can you help me with this?

EDITED:
I Bet, no one can solve this -_-
there are many threads about this but no one can answer..

Surprised no one has solved this yet.

  • Game - Display to (All players) the text: ((Level + (String(WaveCount))) + ( - + (String(WaveCreep))))
Assuming you've properly set the integer variable WaveCount (converted from integer to string) to the level of the wave, and set the WaveCreep unit-type variable (converted from unit-type to string) to the unit-type of the respective creep of the wave.

Other than those two 'Conversion - ...' functions, all you need to use is 'Concatenate Strings' which is used to put 2 strings or more together (depending on how much the function is used.)

Hope I've (finally?) helped!

EDIT: If you want to use the unit's name and not it's unit-type name (which I'm assuming are the same, but just in case), use the function 'Unit - Unit Name' instead of 'Conversion - Convert Unit-Type to String'. Then you can use your unit variable.
 
Level 6
Joined
Dec 24, 2012
Messages
187
Surprised no one has solved this yet.

  • Game - Display to (All players) the text: ((Level + (String(WaveCount))) + ( - + (String(WaveCreep))))
Assuming you've properly set the integer variable WaveCount (converted from integer to string) to the level of the wave, and set the WaveCreep unit-type variable (converted from unit-type to string) to the unit-type of the respective creep of the wave.

Other than those two 'Conversion - ...' functions, all you need to use is 'Concatenate Strings' which is used to put 2 strings or more together (depending on how much the function is used.)


Hope I've (finally?) helped!

EDIT: If you want to use the unit's name and not it's unit-type name (which I'm assuming are the same, but just in case), use the function 'Unit - Unit Name' instead of 'Conversion - Convert Unit-Type to String'. Then you can use your unit variable.

can you make me the full trigger ?
the variable isn't functioning..

i tried to add this action on this trigger:

  • UnitEnterediNvulnerable
    • Events
      • Unit - A unit enters Enemy Respawn <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to HostileCreeps
    • Actions
      • Game - Display to (All players) the text: (|c00FCC430Level|r + ( - + (Name of (Entering unit))))
      • Unit - Make (Entering unit) Invulnerable
  • UnitEnterediNvulnerable Copy
    • Events
      • Unit - A unit leaves Enemy Respawn <gen>
    • Conditions
      • (Owner of (Leaving unit)) Equal to HostileCreeps
    • Actions
      • Unit - Make (Leaving unit) Vulnerable
but this is what happened:
224689-albums6025-picture79048.jpg
 
Last edited:

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
Your first trigger will run every time a unit enters the Enemy Respawn region. That's why it spams. You can use 'Trigger - Turn Off this trigger' when the it activates, followed by a wait action and then 'Trigger - Turn On this trigger' when enough time has passed. (This is all on the same trigger.)

As for not having the level tag, you forgot to put in a string conversion of the level integer on the message... which i'm assuming you have a variable for? You could do this for example - Have an integer variable be added 1 every time your first trigger runs, and use the function 'Conversion - convert integer to string'. Use your integer variable then on the message.

Though I'd recommend using a variable for the wave's unit-types too, would be easier and cleaner.
 
Level 6
Joined
Dec 24, 2012
Messages
187
Your first trigger will run every time a unit enters the Enemy Respawn region. That's why it spams. You can use 'Trigger - Turn Off this trigger' when the it activates, followed by a wait action and then 'Trigger - Turn On this trigger' when enough time has passed. (This is all on the same trigger.)

As for not having the level tag, you forgot to put in a string conversion of the level integer on the message... which i'm assuming you have a variable for? You could do this for example - Have an integer variable be added 1 every time your first trigger runs, and use the function 'Conversion - convert integer to string'. Use your integer variable then on the message.

Though I'd recommend using a variable for the wave's unit-types too, would be easier and cleaner.

  • Spawning Region Men
    • Events
      • Time - iTsCreepTime expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy TheCreepBrokenWindow
      • Game - Display to (All players) the text: (|c00FCC430Level|r + ( - + ((String(LevelCount)) + ( |c00F27AD0 + (Name of (Entering unit))))))
      • For each (Integer A) from 1 to CreepsSpawnCount[LevelCount], do (Actions)
        • Loop - Actions
          • Wait 0.50 seconds
          • Player Group - Pick every player in GamePlayers and do (Actions)
            • Loop - Actions
              • Set tmPoint = ((Picked player) start location)
              • Unit - Create 2 CreepArray[LevelCount] for HostileCreeps at tmPoint facing 2.00 degrees
              • Custom script: call RemoveLocation( udg_tmPoint )

this trigger is fine, but i don't know how make a connection between the actions..
i tried to make a variable unit-type for wave name but i don't know how it will work..
can you make a trigger example, so that i can follow what and change my mistakes?
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
I'm not sure what you're trying to do exactly with that trigger, but I'll point out the things I can see you did wrong and hopefully that helps:

1 - (Name of (Entering Unit)) won't correspond to anything if you don't use a 'Unit Enters region' event. Store the unit-type into a variable, like this:

  • Untitled Trigger 001
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Set WaveUnitType[WaveLevel] = Footman
That's just an unrefined example though, so you can see what I mean. I'm assuming you set the WaveLevel before, in another trigger.

After that, you can use (as I said before) 'Conversion - Convert unit-type to string' in place of (Name of (Entering Unit)).

2 - It should be 'call RemoveLocation(udg_YOURVARIABLEHERE) , without spaces between the variable name and the parenthesis.

3 - You shouldn't use waits as that is inaccurate, and if the game is paused (because of players lagging out or someone manually pausing) while a wave is spawning, the waits will keep going and all the enemies will spawn at the same time when the game resumes.

You could turn on another trigger when your countdown timer expires, for example, and have it run every 1 second or so doing exactly what you want to - that would be a sound solution.

Don't forget to store an integer variable, and increase it every time a mob spawns - when it reaches the limit of spawns (AKA the value you desire on the integer variable), have the trigger be turned off. You can use an 'If/Then/Else' branch at the beggining of the periodic trigger.


~ That's all I see for now, I only gave it a quick look, and there might be more trouble beneath your other triggers, just tell me exactly what's going wrong and I'll help.
 
Level 6
Joined
Dec 24, 2012
Messages
187
I'm not sure what you're trying to do exactly with that trigger, but I'll point out the things I can see you did wrong and hopefully that helps:

1 - (Name of (Entering Unit)) won't correspond to anything if you don't use a 'Unit Enters region' event. Store the unit-type into a variable, like this:

  • Untitled Trigger 001
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Set WaveUnitType[WaveLevel] = Footman
That's just an unrefined example though, so you can see what I mean. I'm assuming you set the WaveLevel before, in another trigger.

After that, you can use (as I said before) 'Conversion - Convert unit-type to string' in place of (Name of (Entering Unit)).

2 - It should be 'call RemoveLocation(udg_YOURVARIABLEHERE) , without spaces between the variable name and the parenthesis.

3 - You shouldn't use waits as that is inaccurate, and if the game is paused (because of players lagging out or someone manually pausing) while a wave is spawning, the waits will keep going and all the enemies will spawn at the same time when the game resumes.

You could turn on another trigger when your countdown timer expires, for example, and have it run every 1 second or so doing exactly what you want to - that would be a sound solution.

Don't forget to store an integer variable, and increase it every time a mob spawns - when it reaches the limit of spawns (AKA the value you desire on the integer variable), have the trigger be turned off. You can use an 'If/Then/Else' branch at the beggining of the periodic trigger.


~ That's all I see for now, I only gave it a quick look, and there might be more trouble beneath your other triggers, just tell me exactly what's going wrong and I'll help.






i solved it now! using this trigger,
is this a leak ? (The Trigger Below) :ogre_icwydt:

  • Spawning Region Men
    • Events
      • Time - iTsCreepTime expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy TheCreepBrokenWindow
      • Trigger - Turn on Entered Name <gen>
      • For each (Integer A) from 1 to CreepsSpawnCount[LevelCount], do (Actions)
        • Loop - Actions
          • Wait 0.50 seconds
          • Player Group - Pick every player in GamePlayers and do (Actions)
            • Loop - Actions
              • Set tmPoint = ((Picked player) start location)
              • Unit - Create 1 CreepArray[LevelCount] for HostileCreeps at tmPoint facing 2.00 degrees
              • Custom script: call RemoveLocation( udg_tmPoint )

  • Entered Name
    • Events
      • Unit - A unit enters Enemy Respawn <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to HostileCreeps
    • Actions
      • Game - Display to (All players) the text: (|c00FCC430Level|r + ( - + ((String(LevelCount)) + ( |c00F27AD0 + (Name of (Entering unit))))))
      • Wait 0.01 seconds
      • Trigger - Turn off (This trigger)
by the way, thanks for the help effort, +REP to you for that.. ^_^
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
No worries!

EDIT: Nevermind the rest, as corrected by super good!
 
Last edited:

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,192
I think this might cause a desynchronization between clients of different localizations as the unit name might return a different string (not sure, maybe it returns English string always). Just use a hard-coded string array with index being wave number.

This is correct:

call RemoveLocation(udg_variable)

This is incorrect:

call RemoveLocation( udg_variable )
Both are fine. The spaces do not mater the JASS parsers?
 

yip

yip

Level 3
Joined
Jan 15, 2014
Messages
69
I think this might cause a desynchronization between clients of different localizations as the unit name might return a different string (not sure, maybe it returns English string always). Just use a hard-coded string array with index being wave number.


Both are fine. The spaces do not mater the JASS parsers?

Then I stand corrected. I remembered having trouble with something similar in the past related to spaces, I guess that wasn't it. Sorry!

Oh I know nothing about jass by the way :X
My knowledge of coding is null. Guess I should check my facts first :L

Thanks!
 
Status
Not open for further replies.
Top