• 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.

Help needed with creating a MOBA-like map

Status
Not open for further replies.
Level 1
Joined
Jul 29, 2014
Messages
2
Hey everyone. Though I've spent many hours on the WC Editor (easily over 100), I consider myself inexperienced since all I've been doing is goofing around, usually by altering stats and creating units. Now I decided to make a very specific style of map, a MOBA-like map.

I need to learn how to do the following (more will probably be added later):

#1: Make a fountain restore both Health and Mana.
#2: Make units spawn at pre-set intervals at a specific building.
#3: Make units automatically attack-move to target location as soon as they spawn.
#4: Make dead heroes respawn automatically at a specified location after a pre-set interval after their death.

Any help will be greatly appreciated.

~ Rigas
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
Hi Pinzu

#1 What do you mean by fountain restore both HP and Mana ? You mean it gives players HP and Mana ? Or it has HP and Mana itself ?
If it restores for units HP and Mana , you should give it two abilities, 'Health Points Regeneration' and 'Mana Points Regeneration' in 'Unit Abilities' in Object editor, u must find it the first one probably, if not , check if the fountain is an Unit first and has abilities, If you want it to be Invulnerable, check (Is Invulnerable) otherwise let it as it is so it's like dota's fountains.
If you want to give it Mana , just change max Mana points, and max health, when the mana max is 0 , it has no mana.

2# You mean like footmen ? Spawn near a building ? Or being trained ? Between each period and other ? Or before upgrading a building?

Anyways if you want it to spawn near building, just start a timer in the beginning o the map ( Elapsed Time is 0.00 sec for example ), when it ends make another trigger with event ' When Countdown timer ends ' or something like that, add actions , if you want it to spawn only when the building exists, make 'if/then/else' trigger, condition is boolean , if the building is alive, or in region, then the action is : (Create 'Footman' at (Your building offset by 100 towards 90 degrees )... Remember this trigger leaks , you must set a point variable for example pointSpawn = Your building point offset by 100 towards 90 degrees, after the 'create unit' trigger , remove the created variable (
  • Custom script : call RemoveLocation(udg_pointSpawn)
)

If you want to train the unit inside building, change 'create unit' trigger with 'Make Building train 'Footman' trigger, you must find it there in the editor for sure.

3# Hmm, you remember previous trigger ? After 'Create footman at pointSpawn' trigger , create a variable called (SpawnedUnit = (LastCreatedUnit), maybe you will need this variable, then create after it another trigger which is :
  • Unit - Issue Order to attack/move to (Your Point)
4# Absolutely easy, you should start a countdown timer after the hero dies, and when the countdown timer ends , you revive the hero in your specified point, this thing needs two triggers, here are they :

  • Events :
    • Unit - A Unit dies
  • Conditions :
    • ((Dying Unit) belongs to player 1) ===> For example
    • ((Dying Unit) is a hero equal to True) <=== This is important
  • Actions :
    • Set ReviveHero = (Dying unit)
    • Countdown timer - Start a countdown timer with One shot timer that ends in 30 seconds
    • Set ReviveTimer = (Last created Countdown timer )
  • Events :
    • Time - ReviveTimer ends
  • Conditions :
  • Actions :
    • Hero - Revive 'ReviveHero' at (Your point)
    • Countdown timer - Destroy ReviveTimer
    • ReviveTimer = No timer
The previous trigger is SUI , not MUI also

I may create for you a Multiplayer and Multiunit trigger...

NOTE : All the previous triggers leak , because Points ( Locations ) always leak , you must always destroy ( Remove ) a point after creating it, and that is done by creating a variable , using it , then removing it, Leaks may cause lags when the hero respawns or has an issue order ...Etc
NOTE 2 : You may also want to create a countdown timer , just add this trigger after creating the timer :
  • Countdown timer - Create Windows Timer for ReviveTimer
  • ReviveTimerWindow = (Last created Timer)
And then destroy it in the second trigger
  • Countdown timer - Destroy (Remove) ReviveTimerTimerWindow countdown timer window ( Or something like this )
I wish these all help you :) And sorry for my terrible English :D.
 
Level 1
Joined
Jul 29, 2014
Messages
2
Hi Pinzu

#1 What do you mean by fountain restore both HP and Mana ? You mean it gives players HP and Mana ? Or it has HP and Mana itself ?
If it restores for units HP and Mana , you should give it two abilities, 'Health Points Regeneration' and 'Mana Points Regeneration' in 'Unit Abilities' in Object editor, u must find it the first one probably, if not , check if the fountain is an Unit first and has abilities, If you want it to be Invulnerable, check (Is Invulnerable) otherwise let it as it is so it's like dota's fountains.
If you want to give it Mana , just change max Mana points, and max health, when the mana max is 0 , it has no mana.

2# You mean like footmen ? Spawn near a building ? Or being trained ? Between each period and other ? Or before upgrading a building?

Anyways if you want it to spawn near building, just start a timer in the beginning o the map ( Elapsed Time is 0.00 sec for example ), when it ends make another trigger with event ' When Countdown timer ends ' or something like that, add actions , if you want it to spawn only when the building exists, make 'if/then/else' trigger, condition is boolean , if the building is alive, or in region, then the action is : (Create 'Footman' at (Your building offset by 100 towards 90 degrees )... Remember this trigger leaks , you must set a point variable for example pointSpawn = Your building point offset by 100 towards 90 degrees, after the 'create unit' trigger , remove the created variable (
  • Custom script : call RemoveLocation(udg_pointSpawn)
)

If you want to train the unit inside building, change 'create unit' trigger with 'Make Building train 'Footman' trigger, you must find it there in the editor for sure.

3# Hmm, you remember previous trigger ? After 'Create footman at pointSpawn' trigger , create a variable called (SpawnedUnit = (LastCreatedUnit), maybe you will need this variable, then create after it another trigger which is :
  • Unit - Issue Order to attack/move to (Your Point)
4# Absolutely easy, you should start a countdown timer after the hero dies, and when the countdown timer ends , you revive the hero in your specified point, this thing needs two triggers, here are they :

  • Events :
    • Unit - A Unit dies
  • Conditions :
    • ((Dying Unit) belongs to player 1) ===> For example
    • ((Dying Unit) is a hero equal to True) <=== This is important
  • Actions :
    • Set ReviveHero = (Dying unit)
    • Countdown timer - Start a countdown timer with One shot timer that ends in 30 seconds
    • Set ReviveTimer = (Last created Countdown timer )
  • Events :
    • Time - ReviveTimer ends
  • Conditions :
  • Actions :
    • Hero - Revive 'ReviveHero' at (Your point)
    • Countdown timer - Destroy ReviveTimer
    • ReviveTimer = No timer
The previous trigger is SUI , not MUI also

I may create for you a Multiplayer and Multiunit trigger...

NOTE : All the previous triggers leak , because Points ( Locations ) always leak , you must always destroy ( Remove ) a point after creating it, and that is done by creating a variable , using it , then removing it, Leaks may cause lags when the hero respawns or has an issue order ...Etc
NOTE 2 : You may also want to create a countdown timer , just add this trigger after creating the timer :
  • Countdown timer - Create Windows Timer for ReviveTimer
  • ReviveTimerWindow = (Last created Timer)
And then destroy it in the second trigger
  • Countdown timer - Destroy (Remove) ReviveTimerTimerWindow countdown timer window ( Or something like this )
I wish these all help you :) And sorry for my terrible English :D.

Thanks for you help, mate. This is extremely helpful to me.

Something else I just discovered I need: regarding #2, can I make it so the units spawn in groups? For example, 8 Footmen will spawn at target building every 30 seconds?

Also, how can I make so that the game ends when a specific unit/building is killed/destroyed?

~ Rigas
 
Last edited:
Level 2
Joined
Jul 28, 2014
Messages
20
Something else I just discovered I need: regarding #2, can I make it so the units spawn in groups? For example, 8 Footmen will spawn at target building every 30 seconds?

~ Rigas

You can do it.:ogre_haosis:There will have a number that write "1" and you hit it,cange it into "8".
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
Thanks for you help, mate. This is extremely helpful to me.

Something else I just discovered I need: regarding #2, can I make it so the units spawn in groups? For example, 8 Footmen will spawn at target building every 30 seconds?

Also, how can I make so that the game ends when a specific unit/building is killed/destroyed?

~ Rigas


Yes you can do that easily

Well in the beginning the spawning trigger should be disactivated thus when the game starts and modes be chosen , no unit should be spawned, so after a specific event ( for example choosing mode ) , the trigger becomes on , so you should uncheck that 'Initially off' (Right click the trigger and uncheck it )

After that, you make a trigger named 'Start spawning' for example, that trigger will turn on the spawning trigger with a specific event. After that you should make your spawning trigger, which has the event (Time -Periodic Event) and the actions are ( Create 8 Footmen at (Your Point)

So the first trigger would be like this :
  • Turn On Spawning
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Trigger - Turn on Spawning <gen> <== This makes our second trigger on after a specific event which is a specific elapsed time of game
The second trigger which is NOT initially on (unchecked) :
  • Spawning
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Set BuildingPoint = (Position of Arcane Sanctum 0000 <gen>)
      • Set DummyPoint = (BuildingPoint offset by 256.00 towards 90.00 degrees)
      • Unit - Create 8 Footman for Player 1 (Red) at DummyPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_BuildingPoint)
      • Custom script: call RemoveLocation(udg_DummyPoint)

Now we go to (Game ends when a building ends)

This is so easy, our ending must have an event , which is (A building is destroyed) or (A Unit is killed)

And our actions are either (End Round) or (End game)

So The trigger would be like this :

  • End Game
    • Events
      • Unit - Arcane Sanctum 0000 <gen> Dies
    • Conditions
    • Actions
      • Game - Defeat Player 1 (Red) with the message: Your base is destro...
The trigger above is to end game, you can end round, you can remove 'Game - Defeat...' and replace it with (Trigger - Run 'Your new round trigger' ) easily to repeat the round..
You can also use the event (Unit - General unit dies) and not (Unit - Specific unit dies) but you will need to create a condition to select which unit dies. Or you can make in actions (If/Then/Else) triggers so many times so you can set all the dying bases triggers in one trigger ( For example if red base is destroyed or blue's is destroyed, they are all set in one trigger so no need to repeat ) and you will still need to set conditions ;)

Easy huh ? XD

There are multiple ways for everything

Any question I am here

Good luck
:grin:
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Making a what? You mean an AoS like DotA Allstars right? I wish people stopped making up nonsense names for something called an AoS.

#1: Make a fountain restore both Health and Mana.
Give it the abilities of both wells (they were used in the campaign and various melee maps)? If you make it target only friendly it should not heal enemies.

#2: Make units spawn at pre-set intervals at a specific building.
Simple triggering. Use either a periodic event or timer. Either hard code the spawn points with specific actions or feed all spawn information into arrays that you loop through. Location leaks were raised above, be careful not to allow any as they can degrade session performance over time.

#3: Make units automatically attack-move to target location as soon as they spawn.
Slightly more complicated triggering. You need to define each lane and assign units to those lanes. This means each lane is given a series of movement locations (the path) and a group to hold all spawns in that lane. Each point on the path is given a region based entry event that orders the entering spawns to the next point in sequence. Unit custom value could be used to manage which is the next movement point by using it to represent an index in an array of locations. Obviously the opposing lane will traverse the points backwards (no need for duplicate entries!). Periodically (like every 5-10 seconds) you need to check all spawns in the lane for any that are idle (units can lose orders under certain circumstances) and then order them to their current next movement point (defined by their custom value). Removed units (as a result of dying and then decaying fully) are not automatically removed from the group so either have an on-death trigger do so (problems if they get revived!) or you need to periodically purge the group of removed units (iterating it via a swap group method does this since removed units appear as null and you simply do not add null to the swap group). An idle unit might have a current order of stop, I am not sure.

#4: Make dead heroes respawn automatically at a specified location after a pre-set interval after their death.
You will either need a timer per each dead hero for this, or you can use an array of counters that decrement every second. The counter approach is easiest as you just add a unit to an unordered structure list (parallel arrays) and then every second decrement the counters by 1 (updating a multiboard maybe? like DotA Allstars?). When the counters reach 0 remove the unit (which is a member of the structure).
 
Status
Not open for further replies.
Top