Probability function

Discussion in 'Mod Creation Help' started by Duomo1334, Oct 5, 2020.

  1. Duomo1334

    Duomo1334 Chieftain

    Joined:
    Dec 20, 2018
    Messages:
    80
    Is there a LUA-function that allows a certain building to create another building with some probability? For example: Completing the Barracks has a 10% chance of building an Armory. Is there any way to create a similar function?
     
  2. raen

    raen Coat of Arms

    Joined:
    May 12, 2003
    Messages:
    2,461
    Location:
    Portugal
    You have to use event BuildingAddedToMap or something like that, then you have to implement your probabilities function, and finally to build a building in a positive case.
     
  3. Red Key

    Red Key Modder

    Joined:
    Sep 24, 2011
    Messages:
    422
    Gender:
    Male
    Location:
    USA
    raen likes this.

Share This Page