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

Pylon building system

Status
Not open for further replies.
Level 4
Joined
Jan 2, 2016
Messages
66
How would I go about replicating the Protoss building system, requiring Pylons for the buildings to work?

To make the buildings become unpowered when there is no Pylon nearby, I think I could have the Pylons give off an aura, and use a trigger to "turn off" buildings that aren't in the aura. Unless there is a better way to do this?

Requiring the Pylon in order to build a new structure; I don't know where to start.
 
Level 4
Joined
Jan 2, 2016
Messages
66
I think that seems like a rather good solution indeed.

Sorry to say, but I think it's impossible for a building to become 'red' on demand.

So I could only do the powering system. I suppose I could work with that. I'm not making a Starcraft map, just borrowing the building system so it doesn't need to be an exact copy.
 
Level 5
Joined
Nov 21, 2014
Messages
151
Sorry to say, but I think it's impossible for a building to become 'red' on demand.

set vertex coloring 255 0 0 to make something red

  • Animation - Change YourUnit's vertex coloring to (100.00%, 0.00%, 0.00%) with 0.00% transparency
 
Requiring the Pylon in order to build a new structure; I don't know where to start.
Filter point orders of building types, so you know when a worker gets the order to build.
For example, if the peasant's order equals 'hbar', he has the order to build barracks. (rawcode from objedt editor)

I would suggest to use hashtables for help, so you fairly easy can bind a requirement to each building type if needed.

So.. and when you captured the type of order, and check for it's requirement from hashtable, you can make a check if the required building is in range of the location of the order.
If not, you can print a warning and stop the current order.
 

Ardenian

A

Ardenian

That's another type of red.
I mean red as in "can't build here" when you try to build.

This would be very complicated, indeed. One would have to completely trigger these
checking tiles and use trackables to keep track of your current mouse position,
updating the build requirement tiles.

About simulating the energy field, you could add very small indicators, model ones
or special effects, that permanently show the range of a pylon.

Checking if a building is within a pylon energy field should be rather easy.
You can simply check if there is a pylon within the range of a pylon energy field.
 
Level 5
Joined
Nov 21, 2014
Messages
151
This would be very complicated, indeed. One would have to completely trigger these
checking tiles and use trackables to keep track of your current mouse position,
updating the build requirement tiles.

About simulating the energy field, you could add very small indicators, model ones
or special effects, that permanently show the range of a pylon.

Checking if a building is within a pylon energy field should be rather easy.
You can simply check if there is a pylon within the range of a pylon energy field.

He means that when you try to build it, it's red (as in obstructing terrain)
 
Level 4
Joined
Jan 2, 2016
Messages
66
About simulating the energy field, you could add very small indicators, model ones
or special effects, that permanently show the range of a pylon.

I was thinking I might scale up the model for Brilliance Aura and have it show around the Pylon all the time. It's a lot more subtle than the solid blue glow you get in StarCraft.
 

Ardenian

A

Ardenian

He means that when you try to build it, it's red (as in obstructing terrain)
Yes, that's what I mean, too.
I was thinking I might scale up the model for Brilliance Aura and have it show around the Pylon all the time. It's a lot more subtle than the solid blue glow you get in StarCraft.
That's a good idea! I like it.
 
Level 4
Joined
Jan 2, 2016
Messages
66
Since it would be very difficult to restrict the player to building near a Pylon, is there a way to freeze, and later resume, the progress of a building under construction? Like, when there are no Pylons within range, the building stops, and then when a Pylon is placed nearby, the building resumes?
 

Ardenian

A

Ardenian

If you base it on the Undead auto-build,
then you can pick every unit around a destroyed pylon and check if they are still supplied.
If they are not supplied anymore, you might have to index them in a custom variable
ands periodically set their building progress to the current building progress.
I cannot confirm this works though.

EDIT: Could one just pause the unit ?
 
Level 12
Joined
Nov 3, 2013
Messages
989
This might seem stupid but you could create builder units without models that have the human repair and locust abilities whenever the "real" builders place down a building. This way you could simply issue them to stop repairing when the power is gone.

Although it's convoluted it shouldn't be hard to do.

The issue then would be that you'd have trouble with the repair cost and every time the "real" builders should repair the buildings you'd have to use these dummy builders instead.
 
Level 13
Joined
Oct 16, 2010
Messages
731
Not sure if this would work or be viable... But could you create a dummy with Freezing Breath (Frost Wrym ability) that deals no damage and attacks the structure when it's built. If the duration is 0 then it's infinite and would have a buff. Periodically check buildings with the buff, if they have the aura's buff remove Freezing Breath buff.

Not sure how you would then freeze buildings when a pylon is destroyed...
 
Level 12
Joined
Nov 3, 2013
Messages
989
Not sure if this would work or be viable... But could you create a dummy with Freezing Breath (Frost Wrym ability) that deals no damage and attacks the structure when it's built. If the duration is 0 then it's infinite and would have a buff. Periodically check buildings with the buff, if they have the aura's buff remove Freezing Breath buff.

Not sure how you would then freeze buildings when a pylon is destroyed...

This is a pretty good idea actually. And you won't need to make periodic checks either.

When you build and finish construction you check for pylon within range.

When pylon is built or destroyed you check for buildings within range.

So for an example, if you have a pylon that is destroyed then you check if there's any buildings within it's power range. If they do and there's no other pylon powering them (Found out by either using aura and checking for buff or picking all pylons within range of each building is greater than 0.) then have a dummy unit with this custom frost breath attack the building once.
 
Status
Not open for further replies.
Top