Spawning 6 of the wrong unit!

Surferkid993

God surferkid993 = new God(awesome.me);
Reaction score
16
Something is wrong, my game spawns 6 heros when I want it to only spawn 1, and they are the wrong hero. Every time it is the same hero, "Night Warrior".



Please look over this Its not as much as it looks, the long one is almost the same thing over and over so you can just check out the first action!


This is my code:

Shorter version of this is lower down.

SetType
Events
Time - Elapsed game time is 0.01 seconds
Conditions
Actions
Set HerosType[1] = Aquogrunt
Set HerosType[2] = Experiment X605
Set HerosType[3] = King's Spirit
Set HerosType[4] = Lucifer's Guard
Set HerosType[5] = Mud Digger
Set HerosType[6] = Night Archer
Set HerosType[7] = Parasite
Set HerosType[8] = Water Crusher
Set HerosType[9] = Zombie King
Set HerosType[10] = Night Warrior



Then,



Heros
Events
Unit - A unit Begins casting an ability
Conditions
Actions
If ((Ability being cast) Equal to Aquogrunt ) then do (Set Heros[(Player number of (Triggering player))] = 1) else do (Do nothing)
If ((Ability being cast) Equal to Experiment X605 ) then do (Set Heros[(Player number of (Triggering player))] = 2) else do (Do nothing)
If ((Ability being cast) Equal to King's Spirit ) then do (Set Heros[(Player number of (Triggering player))] = 3) else do (Do nothing)
If ((Ability being cast) Equal to Lucifer's Gaurd ) then do (Set Heros[(Player number of (Triggering player))] = 4) else do (Do nothing)
If ((Ability being cast) Equal to Mud Digger ) then do (Set Heros[(Player number of (Triggering player))] = 5) else do (Do nothing)
If ((Ability being cast) Equal to Night Archer ) then do (Set Heros[(Player number of (Triggering player))] = 6) else do (Do nothing)
If ((Ability being cast) Equal to Parasite ) then do (Set Heros[(Player number of (Triggering player))] = 7) else do (Do nothing)
If ((Ability being cast) Equal to Water Crusher ) then do (Set Heros[(Player number of (Triggering player))] = 8) else do (Do nothing)
If ((Ability being cast) Equal to Zombie King ) then do (Set Heros[(Player number of (Triggering player))] = 9) else do (Do nothing)
If ((Ability being cast) Equal to Night Warior ) then do (Set Heros[(Player number of (Triggering player))] = 10) else do (Do nothing)



Then,



Units
Events
Unit - A unit Begins casting an ability
Conditions
(Unit-type of (Triggering unit)) Equal to Scores
Actions
Unit - Create 1 HerosType[Heros[1]] for Player 1 (Red) at (Random point in ForestSmall <gen>) facing Default building facing degrees




Please look over this Its not as much as it looks, the long one is almost the same thing over and over so you can just check out the first action!
 

Rad

...
Reaction score
228
You cant use 'Triggering player' when its a unit thats triggering, try changing them all to 'Owner of (Casting unit)'
 

Surferkid993

God surferkid993 = new God(awesome.me);
Reaction score
16
That didn't change anything thanks anyway. I did however stop it from making 6 heros. I changed the last trigger's event to a elapsed time. I think it was doing that before another trigger.
 

AgentPaper

From the depths, I come.
Reaction score
107
In the last one, change it to finishes casting
 

Surferkid993

God surferkid993 = new God(awesome.me);
Reaction score
16
Update

This problem is still happening but it has been shotened, I narrowed it down to this:



Test
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Aquogrunt
Actions
Unit - Create 1 Aquogrunt for Player 1 (Red) at (Random point in
ForestSmall <gen>) facing Default building facing degrees

----------------------------------------------------------------------

Test2
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Experiment X605
Actions
Unit - Create 1 Experiment X605 for Player 1 (Red) at (Random point in ForestSmall <gen>) facing Default building facing degrees

It will only do the first one, create an aquogrunt even if I cast Experiment. Its like for some reason is skipping the conditions.
 

xPheRe

New Member
Reaction score
43
Did you base all this abilities from the same one?
Maybe that's why it's working this way.

Use a custom tavern that sells your custom heroes instead
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top