Results 1 to 1 of 1

Thread: Scripting and Chapters

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Daruwind's Avatar Citizen
    Join Date
    Oct 2013
    Location
    Prague
    Posts
    2,899

    Default Scripting and Chapters

    Hi guys, i was trying to write a small function which is checking player´s chapter and add small income bonus. Now the part about income is no problem but I was unable to correct red text to be right. Any idea?

    local function ScriptMoney(context)
    if context.string == "rom_rome" and player_faction == "rom_rome" and scripting.game_interface:model():turn_number() == 1 and scripting.game_interface:campaign_mission():model():model() == "objective_rome_1_primary"
    then scripting.game_interface:treasury_mod("rom_rome", 10000);
    elseif context.string == "rom_rome"
    then scripting.game_interface:treasury_mod("rom_rome", 1000);
    end
    end

    scripting.AddEventCallBack("FactionTurnStart", ScriptMoney)



    Objective_rome_1_primary is key from mission.txt file..it is first chapter for rome faction in Grant Campaign.

    Any similary i was able to find is from scripting.lua file

    -- TIME TRIGGERS
    --

    local function OnTimeTrigger(context)
    -- INTRO MISSIONS, ONLY IN SP
    -- WE EITHER GIVE THEM AFTER THE INTRO CAMERA PANS, OR IF THE INTRO CAMERA PAN WAS NOT TRIGGERED FOR SOME REASON
    if (context.string == "rom_intro_mission_rome") or ((context.string == "check_intro_runs") and (intro_advice_shown == false) and (player_faction == "rom_rome")) then
    scripting.game_interface:trigger_custom_mission("rom_rome", "objective_rome_1_primary")
    out.ting("DEBUG: Intro advice shown:"..tostring(intro_advice_shown))


    And of course lua functions i was able to find...

    CAMPAIGN_MISSION_SCRIPT_INTERFACE table: 58C8DC90

    model function: 58C8DE30

    new function: 58C62E90
    Last edited by Daruwind; February 23, 2015 at 01:15 PM.
    DMR: (R2) (Attila) (ToB) (Wh1/2) (3K) (Troy)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •