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

Worker Build System

Status
Not open for further replies.
Level 13
Joined
Mar 29, 2012
Messages
542
I need a system for my map i working on...

My map is AoS, battle between 2 races : The Human and The Orc. Each race have 3 bases and every base have 1 primary structure (Town Hall).

The system must do this :
- If a structure destroy (exclude primary structure), the system will detect which base that contain the destroyed structure.
- The primary structure in that base will creates (need time or instant) worker(s) and build again the destroyed structure like before.
- If the worker dies, then create again.
- If the structure has builded, then the worker will gone (but not gone instantly, you know what i mean, right ?)

I was hoping that the worker number can be easily to configure...

Credits to people that help me and +Rep....
 
Last edited:
Level 13
Joined
Mar 29, 2012
Messages
542
If you want to leave something, it's up to you, but make sure it's unwalkable, not visible, unselectable and invulnerable.

Oh, yeah i'm sorry, i mean unwalkable ! :)

Quick question/suggestion: if a building is destroyed, units can then walk where it used to be, which makes it difficult for builders to rebuild it. How about leaving an impassable pile of rubble when a building gets destroyed?

I have a question, too :
When we set a location, we must remove it. But before remove it, i want to save it on hashtable. Does it leaks ??
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
impassable means unwalkable, that you cannot walk over it...

rulerofiron99 need to do this because when the building is destroyed, units near the building might move to the spot where the building is standing, thus the worker might not be able to rebuild the building...

EDIT :

When we set a location, we must remove it. But before remove it, i want to save it on hashtable. Does it leaks ??

i'm afraid saving a location into hashtable would cause the world editor to stop working... or is it only me ?
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
I've never tried saving locations to hashtables, but you could do this:

Set location = position of unit
Set x = X of location
Set y = Y of location
Hashtable - save x as 1 of key of unit
Hashtable - save y as 2 of key of unit
Custom script: call RemoveLocation(udg_location)

EDIT: Another idea I just had that will make this system much simpler, what if instead of allowing structures to die, when its about to take fatal damage, we make it invulnerable and disable spawning/etc triggers associated with it, and then dispatch peasants/peons to repair it.
 
Last edited:
Level 13
Joined
Mar 29, 2012
Messages
542
Oh... yeah ;) I've never think that.... :D

Another idea I just had that will make this system much simpler, what if instead of allowing structures to die, when its about to take fatal damage, we make it invulnerable and disable spawning/etc triggers associated with it, and then dispatch peasants/peons to repair it.

You mean make the dying structure to becomes invulnerable ?? If so, how can the enemy destroy the building ??
 
Status
Not open for further replies.
Top