whats wrong with this

D

Down

Guest
Bucket.jpg
 
M

Mythic Fr0st

Guest
lol

Hero easy trigger, unit type array size 15

Code:
Set UnitTypeHero[1] = Blademaster
Set UnitTypeHero[2] = Orange Frog
Set UnitTypeHero[3] = gray bat frog cow

Do that for all your heroes

And

Code:
Event - elpased game time is 5 seconds
Conditions
Actions - Add UnitTypeHero[Random Integer between 1 and 3] to Hero Group[number of units in hero group + 1)
 

Rabarber

You can change this now in User CP.
Reaction score
94
Spawning random heroes is easily done by making a large-arrayed unit-type array, and then
Code:
Create Random[Random number between 1 and 20]
 
T

the.Seeker

Guest
Code:
[B]Unit Group - Add (Random unit from (Units of type Paladin)) to HeroGroup[((Number of units in HeroGroup[0]) + 1)]
Unit Group - Add (Random unit from (Units of type Archmage)) to HeroGroup[((Number of units in HeroGroup[0]) + 1)]
[/B]




Unit Group - Add (Random unit from (Units of type Paladin)) to HeroGroup[((Number of units in HeroGroup[0]) + 1)]

This adds a random unit of type Paladin, that is currently present on the map to HeroGroup[1] (0 units in HeroGroup[0] +1 = 1)


Unit Group - Add (Random unit from (Units of type Archmage)) to HeroGroup[((Number of units in HeroGroup[0]) + 1)]


The next line attempts to add a random unit of all archmages currently present on the map to HeroGroup[1] (0 units in HeroGroup[0] +1 = 1)



I don't know what you trying to do honestly. You probably wanted to do something like this (heroUnits is unit array, i is an integer variable):

set i = 0
set heroUnits = (Random unit from (Units of type Paladin))
set i = i + 1
set heroUnits = (Random unit from (Units of type Archmage))
...
set i = i +1
set heroUnits = (Random unit from (Units of type Pitlord))
 
T

the.Seeker

Guest
Ah okay so you're trying to spawn random heroes..

Then do as i suggested but use a unit-type array instead. You can lose the 'i' as well if you want.

set heroArray[0] = Paladin
set heroArray[1] = Archmage
...
set heroArray[22] = Pit Lord



Then to spawn a random hero:

Create 1 heroArray[Random number between 0 and 22] for player at location
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top