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

Thread: The Script-o-Rama (last updated April 15th 2009)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    The only thing that needs to be modified is the number type, it's float in empire, double in default Lua. At this point the disassembler works.
    To get the decompiler to work on that you'll need to add some missing stuff, especially setlist with variable number of arguments (b == 0) is missing and a cause for many scripts not to decompile.

  2. #2

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    Quote Originally Posted by just View Post
    The only thing that needs to be modified is the number type, it's float in empire, double in default Lua. At this point the disassembler works.
    To get the decompiler to work on that you'll need to add some missing stuff, especially setlist with variable number of arguments (b == 0) is missing and a cause for many scripts not to decompile.
    Alright I will pass that along to him.
    http://www.twcenter.net/forums/showthread.php?t=260572

    Game Scripter @ Reverie World Studios

  3. #3

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    .
    Last edited by just; April 16, 2009 at 09:13 AM.

  4. #4

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    If you want I can give you output with the errors still in them.
    Nearly always when this happens the actual code should be:
    Code:
    function FunctionName (...)
      for i,v in ipairs(arg) do
    There are a lot I can't handle yet, attached are those I can handle.

    btw, functions are written as:

    l_0_0 = function() ... end
    FunctionName = l_0_0

    The variables are named l_?_? for locals. The first question mark indicates the function (0 if not in a function), the second which variable it is for that function.
    Last edited by just; April 16, 2009 at 09:14 AM.

  5. #5

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    alpaca, i should have just done with your scripting environment to start with..... after i substituted your scripts into the game, it tooks about 2 minutes to get a trait added to boston and only boston.

    Thank you so much...

    One question though.... do you have any function stuff i could use to find out if a faction exists in the world?

    The problem is that faction turn start and slot turn start seem to happen at the same time... so having faction turn start set a value doesn't totally work... although it may work for what i want to do since it's going to happen much later int he grand campaign.
    Last edited by Cursisanafou; April 16, 2009 at 11:23 AM.

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

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    Quote Originally Posted by Cursisanafou View Post
    alpaca, i should have just done with your scripting environment to start with..... after i substituted your scripts into the game, it tooks about 2 minutes to get a trait added to boston and only boston.

    Thank you so much...

    One question though.... do you have any function stuff i could use to find out if a faction exists in the world?

    The problem is that faction turn start and slot turn start seem to happen at the same time... so having faction turn start set a value doesn't totally work... although it may work for what i want to do since it's going to happen much later int he grand campaign.
    There's also FactionRoundStart that's probably implemented for just such cases. Glad that you can work with my environment. It'll change often though so make sure you make notes what you put in. Also make sure you edit the region saving and loading if you need to store values (or even better wait for the next version of TI because that changes a lot about the save/load mechanism)

    No thing is everything. Every thing is nothing.

  7. #7

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    Quote Originally Posted by alpaca View Post
    There's also FactionRoundStart that's probably implemented for just such cases. Glad that you can work with my environment. It'll change often though so make sure you make notes what you put in. Also make sure you edit the region saving and loading if you need to store values (or even better wait for the next version of TI because that changes a lot about the save/load mechanism)
    i haven't added a whole lot so far so it's all good.

    Now i'm trying to call CampaignUI within the slot turn start function.. as far as i can tell it doesn't seem to work...

    Have you tried anything with that? I'm pretty sure i was putting it in right..

    Oh well, i'm not totally going for a historically accurate game... although it would be nice to be able to check the year in order to add traits later in the game and such.

    Maybe i have to go by turn number... which wouldn't be bad just a pain in the ass, and if anyone has a mod to change the amount of turns per year would screw it up.

    Basically i got rid of all the minor factions and just have the major faction in the game right now... makes for a bit more interesting AI gameplay.

    At the moment though britain and france don't create troops in america... which basically makes the americas useless.... so what i'm going to do is give a trait to boston to increase the unhappiness in order to force a revolution. Then when the US controls boston i'll remove the trait.

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

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    Quote Originally Posted by Cursisanafou View Post
    i haven't added a whole lot so far so it's all good.

    Now i'm trying to call CampaignUI within the slot turn start function.. as far as i can tell it doesn't seem to work...

    Have you tried anything with that? I'm pretty sure i was putting it in right..

    Oh well, i'm not totally going for a historically accurate game... although it would be nice to be able to check the year in order to add traits later in the game and such.

    Maybe i have to go by turn number... which wouldn't be bad just a pain in the ass, and if anyone has a mod to change the amount of turns per year would screw it up.

    Basically i got rid of all the minor factions and just have the major faction in the game right now... makes for a bit more interesting AI gameplay.

    At the moment though britain and france don't create troops in america... which basically makes the americas useless.... so what i'm going to do is give a trait to boston to increase the unhappiness in order to force a revolution. Then when the US controls boston i'll remove the trait.
    CampaignUI works fine in SlotTurnStart. Can you post the function you're using?

    No thing is everything. Every thing is nothing.

  9. #9
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    is there a way to add a building or an empty slot to a city through script?

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

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    No, I don't think so

    No thing is everything. Every thing is nothing.

  11. #11
    demis14's Avatar Miles
    Join Date
    Apr 2009
    Location
    Nicosia, Cyprus
    Posts
    339

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    no problem, I have found the way to do it from the start!

  12. #12

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    Any advance wih the luac-decomplilation? Imo open them up, would be a boost for the modding possibilities. The Empire.exe is quite small, so there need to be many things in other files and the luac-files seem to me the best place to search in...
    Bladerunner
    Koeniglich Preussische Marine
    Sealords Virtual Fleets

    Sealords Minimod: http://www.twcenter.net/forums/showthread.php?t=274322
    Sealords Total War Mod: http://www.twcenter.net/forums/showthread.php?t=246265

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

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    Yeah I made some progress on porting the decompiler a bit further to 5.1 but you're mistaken about the changes that'll allow you to make. The luac files only contain UI stuff so the best we can hope for with them is creating things like custom messages and decisions, etc. for the player.

    No thing is everything. Every thing is nothing.

  14. #14

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    Is there anyway to script diplomacy?

    That is, script a declaration of war, or force a peace or alliance?

    I'm specifically thinking of the scripting.game_interface:force_diplomacy but the more I look at it, the more it looks like it activates/deactivates the ability to access these options in the diplomacy screen.
    Every day takes figuring out all over again how to live.

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

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    No, force_diplomacy doesn't work for this and there's no other similar command unfortunately

    No thing is everything. Every thing is nothing.

  16. #16

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    Quote Originally Posted by The Vicar View Post
    Is there anyway to script diplomacy?

    That is, script a declaration of war, or force a peace or alliance?

    I'm specifically thinking of the scripting.game_interface:force_diplomacy but the more I look at it, the more it looks like it activates/deactivates the ability to access these options in the diplomacy screen.
    Scanning through the CampaignUI I found this DeclareWarInstant, which might be what you are looking for, I don't know what it accepts though.
    http://www.twcenter.net/forums/showthread.php?t=260572

    Game Scripter @ Reverie World Studios

  17. #17

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    Where exactly can one find all of the lua? In one of the pack files? I see the events lua and have noted a few entries with interest but can't get at the controlling script itself...

  18. #18

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    Quote Originally Posted by Friar Chris View Post
    Where exactly can one find all of the lua? In one of the pack files? I see the events lua and have noted a few entries with interest but can't get at the controlling script itself...
    There are the lua files in the main.patch pack, as well as the scripting.lua in the data/campaigns/main which is the one that handles stuff for the grand campaign.
    http://www.twcenter.net/forums/showthread.php?t=260572

    Game Scripter @ Reverie World Studios

  19. #19

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    Ah I see, thankyou; is it possible to access unit behaviour scripting then? As I see in events, for example, UnitUsingWall, but alas I fear it may be hardcoded?

  20. #20

    Default Re: The Script-o-Rama (last updated April 15th 2009)

    So, scripting for unit behaviour not available then...?

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
  •