- Joined
- Aug 4, 2019
- Messages
- 4
Hey guys, I'm having a really frustrating problem here, I've been trying to make a respawn system for my map for the past few days and no matter what I do I can't get flying units to work.
I tried many different ways, my first respawn system was like this:
I later figured out how to use hashtables and came up with this new respawn system.
I double checked the unit, its owned by right player (Neutral Hostile) its the same the ground units in every way except that its flying. So I started to think maybe it just can't use the same position of ground units so I tried another way...
At this point I'm getting really frustrated, I tried just making a simple chat command to spawn a Gryphon Rider at my position and that works fine so its not the create unit action that's bugged, so the hashtable must not be saving the position of flying units for some reason, I tried changing pick units owned by player to pick all units in entire map and that still does the same thing, it works for ground units but not for flying units, I tried seeing if there was a Z value or elevation or something but the create unit action doesn't use those values, it only uses a point and facing so I don't know what the problem is, nothing I do will get flying units to respawn...
Please help. I've been a lurker here for years but I finally had to make an account to get help for this problem, any help would be much appreciated.
I tried many different ways, my first respawn system was like this:
-
Respawn System 1
-
Events
-
Unit - A unit owned by Neutral Hostile Dies
-
Unit - A unit owned by Neutral Passive Dies
-
-
Conditions
-
Actions
-
Wait 5.00 seconds
-
Unit - Create 1 (Unit-type of (Triggering unit)) for (Triggering player) at (Position of (Triggering unit)) facing (Facing of (Triggering unit)) degrees
-
-
I later figured out how to use hashtables and came up with this new respawn system.
-
Map Initialization
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- Setup Respawn System --------
-
Hashtable - Create a hashtable
-
Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Hashtable - Save Handle Of(Position of (Picked unit)) as 0 of (Key (Picked unit)) in (Last created hashtable))
-
Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Hashtable - Save (Facing of (Picked unit)) as 1 of (Key (Picked unit)) in (Last created hashtable))
-
Unit Group - Pick every unit in (Units owned by Neutral Passive) and do (Hashtable - Save Handle Of(Position of (Picked unit)) as 0 of (Key (Picked unit)) in (Last created hashtable))
-
Unit Group - Pick every unit in (Units owned by Neutral Passive) and do (Hashtable - Save (Facing of (Picked unit)) as 1 of (Key (Picked unit)) in (Last created hashtable))[/code]
-
-
-
[code]Respawn System 2
-
Events
-
Unit - A unit owned by Neutral Hostile Dies
-
Unit - A unit owned by Neutral Passive Dies
-
-
Conditions
-
Actions
-
Wait 5.00 seconds
-
Unit - Create 1 (Unit-type of (Triggering unit)) for (Triggering player) at (Load 0 of (Key (Triggering unit)) in (Last created hashtable)) facing (Load 1 of (Key (Triggering unit)) from (Last created hashtable)) degrees
-
-------- Need to save the position again or they won't respawn again. --------
-
Hashtable - Save Handle Of(Position of (Last created unit)) as 0 of (Key (Last created unit)) in (Last created hashtable)
-
Hashtable - Save (Facing of (Last created unit)) as 1 of (Key (Last created unit)) in (Last created hashtable)
-
-
I double checked the unit, its owned by right player (Neutral Hostile) its the same the ground units in every way except that its flying. So I started to think maybe it just can't use the same position of ground units so I tried another way...
-
Map Initialization
-
Events
-
Map initialization
-
-
Conditions
-
Actions
-
-------- New way of saving positions. --------
-
Hashtable - Create a hashtable
-
Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Hashtable - Save (X of (Position of (Picked unit))) as 0 of (Key (Picked unit)) in (Last created hashtable))
-
Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Hashtable - Save (Y of (Position of (Picked unit))) as 1 of (Key (Picked unit)) in (Last created hashtable))
-
Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Hashtable - Save (Facing of (Picked unit)) as 2 of (Key (Picked unit)) in (Last created hashtable))
-
Unit Group - Pick every unit in (Units owned by Neutral Passive) and do (Hashtable - Save (X of (Position of (Picked unit))) as 0 of (Key (Picked unit)) in (Last created hashtable))
-
Unit Group - Pick every unit in (Units owned by Neutral Passive) and do (Hashtable - Save (Y of (Position of (Picked unit))) as 1 of (Key (Picked unit)) in (Last created hashtable))
-
Unit Group - Pick every unit in (Units owned by Neutral Passive) and do (Hashtable - Save (Facing of (Picked unit)) as 2 of (Key (Picked unit)) in (Last created hashtable))
-
-
-
Respawn System 3
-
Events
-
Unit - A unit owned by Neutral Hostile Dies
-
Unit - A unit owned by Neutral Passive Dies
-
-
Conditions
-
Actions
-
Wait 5.00 seconds
-
Unit - Create 1 (Unit-type of (Triggering unit)) for (Triggering player) at (Point((Load 0 of (Key (Triggering unit)) from (Last created hashtable)), (Load 1 of (Key (Triggering unit)) from (Last created hashtable)))) facing (Load 2 of (Key (Triggering unit)) from (Last created hashtable)) degrees
-
-------- Need to save the position again or they won't respawn again. --------
-
Hashtable - Save (X of (Position of (Last created unit))) as 0 of (Key (Last created unit)) in (Last created hashtable)
-
Hashtable - Save (Y of (Position of (Last created unit))) as 1 of (Key (Last created unit)) in (Last created hashtable)
-
Hashtable - Save (Facing of (Last created unit)) as 2 of (Key (Last created unit)) in (Last created hashtable)
-
-
At this point I'm getting really frustrated, I tried just making a simple chat command to spawn a Gryphon Rider at my position and that works fine so its not the create unit action that's bugged, so the hashtable must not be saving the position of flying units for some reason, I tried changing pick units owned by player to pick all units in entire map and that still does the same thing, it works for ground units but not for flying units, I tried seeing if there was a Z value or elevation or something but the create unit action doesn't use those values, it only uses a point and facing so I don't know what the problem is, nothing I do will get flying units to respawn...
Please help. I've been a lurker here for years but I finally had to make an account to get help for this problem, any help would be much appreciated.
Last edited: