Announcement

Collapse
No announcement yet.

[MOD] Units building Units

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [MOD] Units building Units

    So I looked at the mod "Airbase"


    and though: "What a neat idea" a worker type unit named "Army Engineer" built a structure that allows planes to use it like an airbase

    the way the mod designer acomplished it was

    1) Unit "Army Engineer" can build fort like improvement structure that contains a unit "Air Base"

    2) Unit "Air Base" is in fact a carrier that has movement of "0" and is built in the fort.

    ==============

    Wow so here we have a unit that built a unit!

    ====================

    the way the Unit "Army Engineer" builds "Air Base" is that a worker unit has to build a road on the same square unit army engineer is positioned.

    which is ok since the only improvement you can build outside your cultural boundaries is roads.

    -------------------------------------------

    Since it is not imperative for the function i am proposing to be used outside of the cultural boundaries i wonder if any one here could help with this.

    =========================
    For Example
    ============

    (An Alien Worker) / (A Wizard Aprentice) / (An Army Corps of Engineers Unit) build a (Teleportation Device ) / (Gate)/ (Factory) that spawns ( Protoss / Demons / Tanks ) every few turns

    I started doing this but as i wanted for the "war factory" to have the "ironworks" global map graphics i kinda got stuck there as it refuses to sustitute the models

    so anyone with a light hand and a clear head for this?

  • #2
    I have some ideas for you. First I think that you will probably have to set up a list somewhere that stores the location of each "Gate" or whatever you want to call it.


    Create a list of gate locations already on the map when a savegame gets loaded.
    You can probably do that in the def onLoadGame section of CvEventManager.py

    Then at the beginning of each turn check to see if it is time to create a new unit. If it is, then check if there is still a gate there(It could have been destroyed), if there is then create the unit
    You could probably do the check
    in the def onBeginPlayerTurn section of CvEventManager.py

    Whenever a gate is built, add the location to the list. (I don't know how you could save a list in the save file, so you will have to rebuild it whenever you load a saved game) To find out who gets the new unit you would have to check the owner of the location. If nobody owns it maybe give it to the barbarians.

    An alternative is to have a separate gate type for each player. And store a list for each player. That way the player that built it would always get the unit.

    I could probably help you out with this if you would like some more help.

    For the graphics, use the fort until you find/make something better.
    Last edited by tywiggins; November 22, 2005, 00:08.

    Comment

    Working...
    X