1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

GameEvents - when are they fired?

Discussion in 'CivBE - General Modding Discussion' started by Syrkres, Mar 30, 2016.

  1. Syrkres

    Syrkres Chieftain

    Joined:
    Mar 3, 2016
    Messages:
    95
    Location:
    Mass
    Ok, trying to understand how functions/GameEvents work.
    I see when you write a function you need to add it to GameEvents.

    is there a listing of
    1. What all the game events are? i.e. PlayerDoTurn
    2. how do you know when (or in what order) a game event fires (executes)?
    3. How do you know what parameters get passed in? Or how does the System know what parameters it needs to pass in?

    If there is documentation, I found some on civ5, but wasn't too sure if it's what I should be reading?

    Thanks
     
  2. Syrkres

    Syrkres Chieftain

    Joined:
    Mar 3, 2016
    Messages:
    95
    Location:
    Mass
    Ok after testing things

    In Lua files when you create a function, it looks like you use GameEvents.<SOMEfunctionName>.Add(<MYfunctionName>) to add the MyFunctioName.

    But where is the set of functions already part of GameEvents that you are supposed to add to (i.e. GameEvents.CityCreated.Add()?)

    Thanks
     
  3. Starrynite120

    Starrynite120 Chieftain

    Joined:
    Jul 15, 2015
    Messages:
    472
    Most of the ones from CiV work, that's what I use.
     
  4. Syrkres

    Syrkres Chieftain

    Joined:
    Mar 3, 2016
    Messages:
    95
    Location:
    Mass
    Thanks SN, was able to code my first "self" lua script using the Civ5 WIKI
     
  5. Starrynite120

    Starrynite120 Chieftain

    Joined:
    Jul 15, 2015
    Messages:
    472
    Yeah I've found it a pretty handy tool. Lets you know the possibilities.
     

Share This Page

Ebates: Get Paid to Shop