Construction events

Troll-Brain

You can change this now in User CP.
Reaction score
85
I'm working for a library which provide custom construction events.

Why ?
Because we don't have a native GetBuilder(), and the way how a structure is build only depends the race of the builder, so therefore if i want GetBuilder() working for all races i need custom events, and a custom GetStructure() also.

I don't need help in how to do it, it's almost done, i just need to add undead and structures built with an ability.

But i need your opinions for these things :

For all races :
The native CANCEL event doesn't fire when the structure is killed/removed during the construction, should it be the case for custom events ?

For human workers :

Several workers can build the same structure, also it's the only race which can stop the construction to continue it later, without destroying the structure.
Instead of returning a group, the START event fire each time a worker start to build, and there is a boolean to know if it's the begin of the build or not.
Same for FINISH event.

I like it like that but would you prefer that the event fire only one time and return a group of worker instead?

I've also added a event for human workers "STOP" when a worker stop the construction to do something else.

For undead workers and structure built with an ability :

Sure it must return the worker on a START event, but i don't really know if it should also return the worker on a FINISH event, since the worker is in fact already doing something else.
 

Jesus4Lyf

Good Idea™
Reaction score
397
I've also added a event for human workers "STOP" when a worker stop the construction to do something else.
That's cool. I think it should be possible to get all workers currently building a building at any point, perhaps (for human). For undead, I'd return the building. Let's say you want to make an undead hero who summons stats using their gold, which they should defend while they summon... :D
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Ok for the undead part, seems the same for abilities so.

I think it should be possible to get all workers currently building a building at any point, perhaps (for human)

Hmm i love how construct event fire each time an human worker start to build, but i have the feeling that i will be the only one who like it :S
I guess then the START event will fire only when the structure enters the map, i still could add a new event for human workers "CONTINUE".
But then it will create a group, the user will must destroy it.
Hmm, or i could use a stack, or whatever, seems better.

What about other points ?
 

Hatebreeder

So many apples
Reaction score
381
A while ago, I made something like this.

I indexed Workers and the building types (well, since I wanted to make a random building). So, whenever I had the building placed somewhere, I canceled the moment it started to build, picked a random building ID, which I index OnInit, created an Invisible Dummy Worker that built that building for me and set a boolean array to check for "IsBuildingBuilding", so I can keep track of of if the building is still building (confusing words, meh).
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
A while ago, I made something like this.

I indexed Workers and the building types (well, since I wanted to make a random building). So, whenever I had the building placed somewhere, I canceled the moment it started to build, picked a random building ID, which I index OnInit, created an Invisible Dummy Worker that built that building for me and set a boolean array to check for "IsBuildingBuilding", so I can keep track of of if the building is still building (confusing words, meh).

Huh, mine simply use script and no dummy stuff at all.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Feedbacks are always fine, but i definitely won't use any kind of dummy stuff if it's not necessary.
And it's not necessary :)

For the CANCEL thing i've the feeling it must fire on structure death/removing, and i will code the event like that.

OFF-TOPIC :

Don't try to remove a structure under construction if his worker is not human or undead, or done by a spell.
Else the worker will be completely stucked and invulnerable, also hidden, but you can show it.
Using a morph ability doesn't seems to help, only kill him and revive him (his corpse isn't targetable in any way).
Then the worker can move but pretty much like shift orders, hard to explain.
Also he is definitely invulnerable.
I've checked if he got any invulnerable ability (from 'A000' to 'xxxx') but it doesn't seems so.

If you have time maybe you can play with this bug to make triggering shift orders but i don't believe in it.
Plus, the invulnerable thing is lame.

So one more reason i guess to kill an unit before removing it.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Last question.

For structure built by human workers, would you prefer a group or a stack ?
Personally i would prefer a group, but that's me.

EDIT : Hmm, not i suppose it's fine to know how many workers are currently on the structure, and increment an integer variable in a ForGroup call is overskilled.
 
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