Pagina's

Sunday 30 June 2019

Fully-formed barracks

Alright, So I can now build fully formed buildings. Or rather, I can put them in place fully formed. That looks like this:


You select the red worker guy and click on the barracks image. Then it will generate a new barracks (actually fully formed and functional already) and you'll drag it over the ground below the mouse if you move the mouse. Pressing escape aborts this mission, clicking, drops the building in place. Next you can immediately work with it. I'll have to implement some extra stuff, because it's possible to put the thing right between the green guys. The script will notice if you're not pointing to ground, but to something else, but you can still put the thing between the green guys to the right. That'll not be there by the end.

More importantly even, I will not allow any buildings to be put in place as fully built. Have a look at Age of Empires if you don't know what I mean. I want to place some stuff as a starting object. It'll just be stuff, with a broad shape of the ground plan of a barracks. Then workers (or other building guys) will work on it and over time (also depending on how many guys are working), the object is replaced by some just-started barracks, some partly formed one, some almost finished one and an full barracks. Only then does it get alle the things it needs.

Technically, right now, the building placement script just drops the prefab of a barracks. What I'm gonna do is create a Unfinished Building class that has a couple of prefab references. I drop a prefab of that class in the placement script and it'll be able to interact with the workers to change to new prefab. I guess I'll have a mechanics comparable to the gathering of resources. Gathering will have workers take away amounts of wood from the tree. Building will add hitpoints (or something else) to the building. Should be implemented easily.

Anyway, This is what I try to make next week. I'll be in Santorini the two weeks after that.



No comments:

Post a Comment