Implementation of a "Construction Unit" for RTS mod
Posted: Sun Aug 19, 2018 2:31 pm
I am planning to implement a mobile construction unit (based off a simple Unit prototype) which has a script-controlled ability to place buildings, perhaps something similar to how the nanobots mod spawns temporary construction bots to place ghosts down.
The general flow of the functionality i'm aiming for is as follows:
- a player selects a construction unit with selection tool item, [this part is done]
- then selects a building icon from a sidebar GUI and this puts a ghost in the player's hand. [working on gui and background logic for this currently] [what api calls allow me to set the player's cursor to be a ghost of a building?]
-Player places ghost building/s, and the construction unit spawns something like the nanobots to fly out and place the buildings if they are in range. if out of range, construction unit moves to be within range.
as each ghost is placed, added to the unit's own unique build queue list..
- unit goes through a list of ghosts until all are built or the orders cancelled. will probably follow Nexela's nanobots code for most of this part. items are spawned assuming there are some available in the force's global construction stockpile inventory.
Does this sound possible/technically reasonable to implement in your opinions?
The other way is that the construction unit simply acts as a mobile hub for nano-bot style operation in a more general sense - any ghost nearby (blueprint or player placed) which the unit has construction item for (some global stockpile..) will get built. player just moves the construction unit into the area of ghosts, or places the buildings around the unit while it's just chilling in the area. This is probably simpler and more "factorio-ish" than the earlier classic RTS method.
Anyone have any other bright ideas on a lean and brilliant implementation within the mod framework for this kind of unit and feature?
The general flow of the functionality i'm aiming for is as follows:
- a player selects a construction unit with selection tool item, [this part is done]
- then selects a building icon from a sidebar GUI and this puts a ghost in the player's hand. [working on gui and background logic for this currently] [what api calls allow me to set the player's cursor to be a ghost of a building?]
-Player places ghost building/s, and the construction unit spawns something like the nanobots to fly out and place the buildings if they are in range. if out of range, construction unit moves to be within range.
as each ghost is placed, added to the unit's own unique build queue list..
- unit goes through a list of ghosts until all are built or the orders cancelled. will probably follow Nexela's nanobots code for most of this part. items are spawned assuming there are some available in the force's global construction stockpile inventory.
Does this sound possible/technically reasonable to implement in your opinions?
The other way is that the construction unit simply acts as a mobile hub for nano-bot style operation in a more general sense - any ghost nearby (blueprint or player placed) which the unit has construction item for (some global stockpile..) will get built. player just moves the construction unit into the area of ghosts, or places the buildings around the unit while it's just chilling in the area. This is probably simpler and more "factorio-ish" than the earlier classic RTS method.
Anyone have any other bright ideas on a lean and brilliant implementation within the mod framework for this kind of unit and feature?