Page 3 of 4 FirstFirst 1234 LastLast
Results 41 to 60 of 80

Thread: Replacing the grand campaign

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    l33tl4m3r's Avatar A Frakkin' Toaster
    Join Date
    Mar 2009
    Location
    Soldier of Fortune
    Posts
    6,330

    Default Re: Replacing the grand campaign

    Quote Originally Posted by Lazy Knight View Post
    somebody from the IS dev forum reports this as well. He still has an old startpos though. I guess you have been using a new one?
    You are correct -- the new one had been working, even after I made some more changes to it, then this.
    [House of Caesars|Under the Patronage of Carl von Döbeln]

  2. #2
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Replacing the grand campaign

    This happens when your startpos is corrupted I think

    No thing is everything. Every thing is nothing.

  3. #3

    Default Re: Replacing the grand campaign

    nope. A file that is otherwise working in main folder does not work in imperial_splendour folder.


  4. #4

    Default Re: Replacing the grand campaign

    Quote Originally Posted by Lazy Knight View Post
    nope. A file that is otherwise working in main folder does not work in imperial_splendour folder.
    True . That's why I think that the file "grand_campaign.luac" needs to be updated to be compatible with the new patch.

  5. #5
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Replacing the grand campaign

    I'll give it a look when I have time

    No thing is everything. Every thing is nothing.

  6. #6
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Replacing the grand campaign

    First post updated. The grand_campaign_script was indeed changed slightly. Hope it works for you now.

    No thing is everything. Every thing is nothing.

  7. #7

    Default Re: Replacing the grand campaign

    It works now. Thanks, alpaca!

  8. #8
    hip63's Avatar Give me some BASS!
    Patrician Artifex

    Join Date
    Nov 2007
    Location
    groovy galaxy
    Posts
    3,723

    Default Re: Replacing the grand campaign

    Step 4 seems to be in error, it stated to extract the rigidmodels/campaignroads/main folder from the ui.pack file but I did not find it there, I found it in the models.pack or am I incorrect?

    hip63

  9. #9
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Replacing the grand campaign

    Quote Originally Posted by hip63 View Post
    Step 4 seems to be in error, it stated to extract the rigidmodels/campaignroads/main folder from the ui.pack file but I did not find it there, I found it in the models.pack or am I incorrect?

    hip63
    Yeah. I was working on the UI when I wrote it so it must have slipped in

    Thanks for the heads up.

    No thing is everything. Every thing is nothing.

  10. #10
    hip63's Avatar Give me some BASS!
    Patrician Artifex

    Join Date
    Nov 2007
    Location
    groovy galaxy
    Posts
    3,723

    Default Re: Replacing the grand campaign

    Is there anyway this can be done for episode content? I'm trying to help ToonTotalWar put together The American Revolution Mod in a modolder format, but some the mod is based on episodic startpos files. Is it possible to something similar to this for so episodic stratpos files do not have to be overwritten? I'm working with both Episode 3 and Episode 4 startpos files. Any help would be greatly appreciated.

    hip63

  11. #11
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Replacing the grand campaign

    Quote Originally Posted by hip63 View Post
    Is there anyway this can be done for episode content? I'm trying to help ToonTotalWar put together The American Revolution Mod in a modolder format, but some the mod is based on episodic startpos files. Is it possible to something similar to this for so episodic stratpos files do not have to be overwritten? I'm working with both Episode 3 and Episode 4 startpos files. Any help would be greatly appreciated.

    hip63
    In principle, yes, but you'll need to work it through yourself. It's not going to be quite an easy fix. The easiest (somewhat messy, but meh) method is to insert code into the StartCampaign function to alter the Key of the selected campaign, for example by prepending a prefix, and changing the folder names accordingly. You will also have to compile the file with luac 5.1 afterwards

    Code:
    local utils = require("Utilities")
    local options_manager = utils.Require("OptionsManager")
    local this = (UIComponent(Address))
    local prefs_manager = nil
    local campaign_details = {}
    local selected_campaign, current_prefs = nil, nil
    InitDifficultySlider = function(l_1_0, l_1_1)
      l_1_0:SetProperty("maxValue", 3)
      l_1_0:LuaCall("Reset")
      l_1_0:LuaCall("ValueSet", l_1_1)
      l_1_0:SetProperty("Notify", Address)
      UIComponent(l_1_0:Find("handle")):SetTooltipText(DifficultyLevelString(l_1_1), true)
    end
    
    DifficultyLevelString = function(l_2_0)
      l_2_0 = utils.Clamp(l_2_0, 0, 3)
      return FrontEnd.LocalisationString("difficulty_level_" .. tostring(l_2_0 + 1))
    end
    
    OnEnter = function()
      local first_valid = nil
      campaign_details = FrontEnd.EnumerateCampaigns(true)
      for i,v in ipairs(campaign_details) do
        v.Component = UIComponent(this:Find("chapter_" .. i, false))
        if v == nil or v.Unlocked == false then
          v.Component:SetState("inactive")
        elseif first_valid == nil then
          first_valid = i
        end
      end
      if first_valid ~= nil then
        SelectCampaign(first_valid)
      end
      prefs_manager = options_manager.CreateManager(FrontEnd)
      options_manager.InitialisePrefsSetter(this, "game", InitialisePrefs)
      InitDifficultySlider(UIComponent(this:Find("cmp_diff_slider")), current_prefs.campaign_difficulty)
      InitDifficultySlider(UIComponent(this:Find("btl_diff_slider")), current_prefs.battle_difficulty)
      UIComponent(this:Find("dy_faction_difficulty")):SetVisible(false)
    end
    
    InitialisePrefs = function(l_4_0)
      current_prefs = l_4_0
    end
    
    Notify = function(l_5_0, l_5_1)
      local cmp_diff_slider = this:Find("cmp_diff_slider")
      local btl_diff_slider = this:Find("btl_diff_slider")
      if l_5_0 == cmp_diff_slider or l_5_0 == this:Find("btl_diff_slider") then
        FrontEnd.TriggerSliderUpdateEvent(UIComponent(l_5_0):Id())
        UIComponent(UIComponent(l_5_0):Find("handle")):SetTooltipText(DifficultyLevelString(l_5_1), true)
        if l_5_0 == cmp_diff_slider then
          current_prefs.campaign_difficulty = l_5_1
        elseif l_5_0 == btl_diff_slider then
          current_prefs.battle_difficulty = l_5_1
        end
        prefs_manager:SetGameOptions(current_prefs)
      end
    end
    
    SelectCampaign = function(l_6_0)
      if selected_campaign ~= nil then
        campaign_details[selected_campaign].Component:SetState("normal")
      end
      selected_campaign = l_6_0
      campaign_details[selected_campaign].Component:SetState("selected")
      local tv = UIComponent(this:Find("Textview"))
      tv:LuaCall("SetText", campaign_details[l_6_0].Description)
      local title = UIComponent(this:Find("dy_chapter"))
      title:SetStateText(campaign_details[l_6_0].Name)
    end
    
    StartCampaign = function()
      FrontEnd.StartCampaign(campaign_details[selected_campaign].Key)
    end

    No thing is everything. Every thing is nothing.

  12. #12
    hip63's Avatar Give me some BASS!
    Patrician Artifex

    Join Date
    Nov 2007
    Location
    groovy galaxy
    Posts
    3,723

    Default Re: Replacing the grand campaign

    so this needs to be done to the scripting.lua in my new map folder (same folder where my custom startpos file is)?

    Is the some documentation somewhere for Luac?When I run it, I just get a command prompt, I never used it before, so throughly confused ATM

    EDIT: Just noticed, is Lua 5.1 the samething as Luac 5.1? When i search, all I find are links for Lua 5.1, not Luac 5.1

    After poking around some more, the code you show, goes into the grand_campaign.luac file?

    damn, this is SO far above my head...

    hip63
    Last edited by hip63; September 30, 2009 at 06:51 AM.

  13. #13
    hip63's Avatar Give me some BASS!
    Patrician Artifex

    Join Date
    Nov 2007
    Location
    groovy galaxy
    Posts
    3,723

    Default Re: Replacing the grand campaign

    Ok found the luac buried in the lua program folder, still unsure how to use it

  14. #14
    hip63's Avatar Give me some BASS!
    Patrician Artifex

    Join Date
    Nov 2007
    Location
    groovy galaxy
    Posts
    3,723

    Default Re: Replacing the grand campaign

    OK, ready for more stupid questions?

    I'm guesssing you are talking about edting the grand_campaign.luac that is is include in the custom_campaign.rar

    If so, then I guess it has to be decompiled first? if so how? with what? When I try to open it will tha lua apps, it tells me bad header in precompiled chunk (whatever that means).

    I also have no idea which part of the code you posted above needs to be altered to reflect the folder with the custom startpos file.

    If you haven't figured it out, I'm about as noob as one can be at this. I still absolutely no idea on how to achive the end result I need.

    I never done anything remotely like this, so please don't assume I know anything, assume I know nothing.

    3 seconds just throwing in the towel here...

    hip63

  15. #15
    hip63's Avatar Give me some BASS!
    Patrician Artifex

    Join Date
    Nov 2007
    Location
    groovy galaxy
    Posts
    3,723

    Default Re: Replacing the grand campaign

    really hate spamming this post but here goes. (puts towel away for time being)

    I found an app, Luadec for Lua 5.1 and I'm trying to decompile the grand_campaign.luac file but I keep getting an error stating "bad header in precompiled chunk"

    hip63

  16. #16
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Replacing the grand campaign

    Quote Originally Posted by hip63 View Post
    really hate spamming this post but here goes. (puts towel away for time being)

    I found an app, Luadec for Lua 5.1 and I'm trying to decompile the grand_campaign.luac file but I keep getting an error stating "bad header in precompiled chunk"

    hip63
    Yeah that decompiler doesn't really handle everything properly, yet. If you send me a PM with your email address I can give you my current version but it also still creates errors in almost every file which you presumably won't be able to fix if you don't have a lot of scripting experience and are good at puzzles. Grand_campaign.lua isn't really needed to modify RTI anyways, this is the one I use for APE:TI

    Code:
    -- Decompiled using luadec 2.0 UNICODE by sztupy (http://winmo.sztupy.hu)
    -- Command line was: grand_campaign.luac
    
    local utilities = require("Utilities")
    local this = UIComponent(Address)
    local main_panel = UIComponent(this:Find("main_panel"))
    local selected_campaign = "apeti_main"
    OnEnter = function()
      FrontEnd.OpenMapDataFile(selected_campaign)
      main_panel:LuaCall("Initialise", selected_campaign)
    end
    
    OnExit = function()
      main_panel:LuaCall("SaveOptions")
      FrontEnd.CloseMapDataFile()
    end
    
    StartCampaign = function()
      OnExit()
      FrontEnd.StartCampaign(selected_campaign, main_panel:LuaCall("FactionAndVCType"))
    end

    No thing is everything. Every thing is nothing.

  17. #17
    hip63's Avatar Give me some BASS!
    Patrician Artifex

    Join Date
    Nov 2007
    Location
    groovy galaxy
    Posts
    3,723

    Default Re: Replacing the grand campaign

    Thanks for the assistance. I really want to try to do this.

    Yes I figured out pretty quick that the issue is the fact is episode content, so it's not calling the grand_campaign.luac, it would be calling some other reference for episodic content and I'm guessing that what I need to alter.

    what file should I be looking at to get the game to look at my folder instead of the episode_5 or main_2 folders?

    Oh and I'll PM you an address

    hip63

  18. #18
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: Replacing the grand campaign

    Quote Originally Posted by hip63 View Post
    Thanks for the assistance. I really want to try to do this.

    Yes I figured out pretty quick that the issue is the fact is episode content, so it's not calling the grand_campaign.luac, it would be calling some other reference for episodic content and I'm guessing that what I need to alter.

    what file should I be looking at to get the game to look at my folder instead of the episode_5 or main_2 folders?

    Oh and I'll PM you an address

    hip63
    Sorry, I didn't see you quadruple-posted earlier. I wrote the name of the file I quoted and that's what you have to replace. You do need to compile it first with luac 5.1

    I'm not going to provide a step by step tutorial, firstly because I don't want to and secondly because I don't know exactly what you have to do.

    No thing is everything. Every thing is nothing.

  19. #19

    Default Re: Replacing the grand campaign

    Will we be ever able to put a startpos.esf in a mod.pack?

  20. #20
    l33tl4m3r's Avatar A Frakkin' Toaster
    Join Date
    Mar 2009
    Location
    Soldier of Fortune
    Posts
    6,330

    Default Re: Replacing the grand campaign

    Quote Originally Posted by A1_Unit View Post
    Will we be ever able to put a startpos.esf in a mod.pack?
    Just as soon as they let us use localisation fragments in mod packs, I bet.
    [House of Caesars|Under the Patronage of Carl von Döbeln]

Page 3 of 4 FirstFirst 1234 LastLast

Posting Permissions

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