Beiträge von NaoNauno

    In order to create a proper CutsceneEvent for the game, you will need to create a new .lua file in this directory:


    G:\The Guild 2: Renaissance\Scripts\Cutscenes\CutsceneTest.lua

    (In this test, we are going to name the file CutsceneTest.lua)


    Then, in any measure the player has access to, use these calls:


    Code: ms_measure
        CreateCutscene("CutsceneTest", "My_Cutscene")
        CopyAliasToCutscene("", "My_Cutscene", "Sim")
        CutsceneCallScheduled("My_Cutscene", "Start")


    CreateCutscene("CutsceneTest", "My_Cutscene")

    This call declares that a new cutscene is about to be defined.

    • The first parameter of this call must be the name of the new file you created in the folder Cutscenes, without its file extension.
    • The second parameter is a custom label of your choice.


    CopyAliasToCutscene("", "My_Cutscene", "Sim")

    This call allows you to send any Alias to the cutscene event, such as attending Sims or buildings.

    • The first parameter is the Alias of the object you want the cutscene event to remember.
    • The second cutscene should be the second parameter of CreateCutscene()
    • The third parameter should be the new Alias which the cutscene event will remember the object as.

    CutsceneCallScheduled("My_Cutscene", "Start")

    This call is used to run a function within your new Cutscene event file.

    • The first parameter must be the second parameter of CreateCutscene()
    • The second parameter should be the name of a function within your new .lua file in the folder Cutscenes.


    Here is what CutsceneTest.lua could look like:


    Remember CutsceneCallScheduled(...), in our example it calls the function Start() in CutsceneTest.lua. This calls is executed immediately. However, we are using the call CityScheduleCutsceneEvent(...) which requires a bunch of different parameters. This call is important, because it adds the CutsceneEvent to the list of visible Public Appointments in the City Hall of the defined settlement ; and starts whichever function is specified at a given time.


    In the example above, we fetch for the right settlement using the CopiedAlias of the player's Sim, which we then pass to CityScheduleCutsceneEvent(...) ; and we define 10am as the time of the day when the Cutscene Event should begin (as in the function called Begin()) with a 1 hour minimum delay of preparation. The label "TEST" can be any label (preferably as defined in texts.dbt) which appears in the Public Appointments list.


    More advanced scripting can make use of the other parameters of this call, and I would suggest to examine pre-existing .lua files to get inspiration on how to use those.


    Be aware that the cutscene Alias "My_Cutscene" gets replaced by an empty "" once the script goes through your new .lua file (example: EndCutscene("")).

    Although this post is kinda old, I have been redirected here as part of my recent addition to the Reforged team.


    It has come to my attention that the guide does not specify how to name the measure you are creating, and since that is useful information I believe it is worth it to bring back this topic to life for just a single message to explain the simple process to go through in order to name measures when you hover your cursor over them.


    In the example Fajeth gave, the measure in DB/Measures.dbt has the parameter HelloWorld at index 4.


    You want to look into DB/texts.dbt and add a new line. Following once again the initial example of this code, here is a new line you should add to this file:


    17000 "_MEASURE_HelloWorld_NAME" "Send a notification" |


    This line will make it so the string "Send a notification" shows up when you hover your cursor on top of the measure in the action panel, instead of only showing an uncomprehensible text to the regular user.


    The first parameter -here being 17000- does not necessarily need to match the ID you specified in DB/Measures.dbt. However, it does need to be unique!


    If you wish to add a tooltip, add a new line with a new unique ID and replace _NAME with _TOOLTIP. This text will make it so the specified text shows up upon maintaining right click on the measure in the action panel.


    This should be it, if you have any question, feel free to let us know.