Game Development Community

Peons to build buildings

by Ed Johnson · in RTS Starter Kit · 03/08/2005 (9:36 am) · 21 replies

Has anyone implemented a way to let peons know they're needed to construct a building
(or repair a building, etc).

The 'World Domination' mod stated that was left out to be project specific, but I'm sure someones thrown together something simple.
I was looking through rtsEvents.cs and commands.cs trying to get an idea how the peons take commands.

Thanks!
Page«First 1 2 Next»
#21
10/26/2012 (1:48 pm)
Tom@ I don't have the code example on-hand, but I used the code for when you have a unit selected and right click a destination for them.

And basically the unit would walk to where I clicked and the building would starting being "built" ... and eventually it would become built and switch to the correct animation.

Getting the unit to goto where I clicked was fairly simple, but it was tricky to then have them "back off" a certain distance so the building was not on top of them.

But I recall there was another example somewhere that talked about how to get the units to move out of under the building once its placed. I think it just moved the unit away from the building towards map center, a set distance.

Somewhere in there, I would trigger an animation on the unit and building itself ... so the unit would hammer away and it played a sound effect ... while the building itself would animate through the build stages and eventually become "ready" or whatever.

hope that helps! :)
Page«First 1 2 Next»