• 🏆 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!

[Solved] different regions need help!

Status
Not open for further replies.
Level 3
Joined
Jan 6, 2021
Messages
24
Hey, im really new to WE but me and a friend is doing a custom TD and there is alot off errors along the way, but this one i can figure out.



So we have for now 2 spawning areas top and left, map is a cube shape.

Left spawn code

spawn1 left
Events
Time - Elapsed game time is 30.00 seconds
Conditions
Actions
Unit - Create 1 Peasant for Player 12 (Brown) at (Center of red left <gen>) facing (Center of red right goal <gen>)


left to middle region

move middle
Events
Unit - A unit enters red left <gen>
Conditions
(Owner of (Entering unit)) Equal to Player 12 (Brown)
Actions
Unit - Order (Entering unit) to Move To (Center of red middle <gen>)


middle to right

move middle to end
Events
Unit - A unit enters red middle <gen>
Conditions
(Owner of (Entering unit)) Equal to Player 12 (Brown)
Actions
Unit - Order (Entering unit) to Move To (Center of red right goal <gen>)


and did the same for top to bottom but now every single spawn goes to the bottom region after hitting middle region. And for the top code i have when unit enters middle move to center of bottom region.
 
Level 21
Joined
Dec 4, 2007
Messages
1,478
Cheers impulse, welcome to the Hive!

I think you should familiarize yourself with unitgroups at this point.
Because the problem lies in ordering every unit owned by player 12, that enters the middle region from all cardinal points to then move to all top, right, bottom, left regions.

For example what can happen:
Units get spawned in the bottom region -> move to the middle region -> move to the bottom region.
Every player 12 unit entering the middle area gets ordered to move to all the outer regions.

To combat this, you would need 4 unitgroups, which keeps track of where your units were spawned and then get directed properly by a boolean (true/false) condition: "is in unit group"
 
Level 3
Joined
Jan 6, 2021
Messages
24
Cheers impulse, welcome to the Hive!

I think you should familiarize yourself with unitgroups at this point.
Because the problem lies in ordering every unit owned by player 12, that enters the middle region from all cardinal points to then move to all top, right, bottom, left regions.

For example what can happen:
Units get spawned in the bottom region -> move to the middle region -> move to the bottom region.
Every player 12 unit entering the middle area gets ordered to move to all the outer regions.

To combat this, you would need 4 unitgroups, which keeps track of where your units were spawned and then get directed properly by a boolean (true/false) condition: "is in unit group"


Thanks!
Yeah im learning by the hour atm.

Well i did solve it, kinda. I had to move the middle regions out abit from the middle point but then i added more spawn regions and more middle regions and then it broke again, now i have all units ending up in one region and that how it has to be for now atleast! :p
 
Level 3
Joined
Jan 6, 2021
Messages
24
Can also use the unit's custom value to help solve this, although that can conflict with some systems.

If using the unit group approach then you must make sure to remove dead units from it otherwise that will count as a leak of sorts.

this sound like alot of more work if you have like 50 waves right?
 
Status
Not open for further replies.
Top