Results 1 to 19 of 19

Thread: How to create scripted events?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Rafkos's Avatar Senator
    Join Date
    Sep 2013
    Location
    Poland, Dolny Śląsk (Lower Silesia)
    Posts
    1,011

    Default How to create scripted events?

    Hello,
    Is there a way to create a scripted event which will show up at a specific date and contain a message like it was in Medieval 2?
    Cheers

  2. #2

    Default Re: How to create scripted events?

    I up this? Is there a way with the assembly kit? When I try to open the events table it says "18:23:04> Unable to load data for the table [events_view_group_junct] because the data file could not be found".

  3. #3

    Default Re: How to create scripted events?

    Quote Originally Posted by nostradamus1915 View Post
    I up this? Is there a way with the assembly kit? When I try to open the events table it says "18:23:04> Unable to load data for the table [events_view_group_junct] because the data file could not be found".
    I want to add an unit to an army when an event occours (for example it's the year xxxx or an agent joins the army).

  4. #4
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: How to create scripted events?

    There was this in patch 11's changelog:

    "Fixed the "show_message_event()" campaign script function. The function takes an event key from the "message_events" table, an integer X co-ordinate and an integer Y co-ordinate as parameters. Custom events can be added by modders, but must have an event key beginning with "custom_event_", followed by a number (e.g. "custom_event_678")."


    While they claim it was fixed, it doesn't work. Been meaning to ask them about it for a while now..

  5. #5

    Default Re: How to create scripted events?

    Quote Originally Posted by .Mitch. View Post
    There was this in patch 11's changelog:

    "Fixed the "show_message_event()" campaign script function. The function takes an event key from the "message_events" table, an integer X co-ordinate and an integer Y co-ordinate as parameters. Custom events can be added by modders, but must have an event key beginning with "custom_event_", followed by a number (e.g. "custom_event_678")."


    While they claim it was fixed, it doesn't work. Been meaning to ask them about it for a while now..
    It is working. I'm using it to create historical messages for R2TR.
    modificateurs sans frontières

    Developer for Ancient Empires
    (scripter, developed tools for music modding, tools to import custom battle maps into campaign)

    Lead developer of Attila Citizenship Population Mod
    (joint 1st place for Gameplay Mods in 2016 Modding Awards)

    Assisted with RMV2 Converter
    (2nd place for Warscape Engine Resources in 2016 Modding Awards)

  6. #6
    LestaT's Avatar Artifex
    Join Date
    Jun 2005
    Location
    Campus Martius
    Posts
    3,877

    Default Re: How to create scripted events?

    Quote Originally Posted by Causeless View Post
    It is working. I'm using it to create historical messages for R2TR.
    We shoud release official R2TR tools together with the coordinates finder.
    Everything we hear is an opinion, not a fact. Everything we see is a perspective, not the truth. - Marcus Aurelius


  7. #7
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: How to create scripted events?

    Quote Originally Posted by Causeless View Post
    It is working. I'm using it to create historical messages for R2TR.
    I did try it straight away after the patch, so maybe things have changed. I'll give it another go and see. Cheers.

  8. #8

    Default Re: How to create scripted events?

    Quote Originally Posted by ^OvO^ View Post
    We shoud release official R2TR tools together with the coordinates finder.
    I'm certainly not against it! They're still pretty bare-bones tho
    modificateurs sans frontières

    Developer for Ancient Empires
    (scripter, developed tools for music modding, tools to import custom battle maps into campaign)

    Lead developer of Attila Citizenship Population Mod
    (joint 1st place for Gameplay Mods in 2016 Modding Awards)

    Assisted with RMV2 Converter
    (2nd place for Warscape Engine Resources in 2016 Modding Awards)

  9. #9
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: How to create scripted events?

    Just did a quick test, can't get it working for some reason, any ideas Causless? I'm thinking a syntax issue with my call or my X/Y coords aren't allowed?

    show_message_event("custom_event_555", 20, 20)



  10. #10

    Default Re: How to create scripted events?

    For x and y coords, I just did 0, 0, and it didn't move the camera at all. You should be able to grab the coords from a character like your faction leader and have it work, though. No syntax issues I can see.

    Also, you should probably have the actual text in text/db/*_message_event_strings and text/db/*_message_event_text. Although they might work with a blank text and title, I never tried - I put something like "test" in there. You can find the vanilla files in local_en_rome2, so just copy them out to get the table shape and format and remove the vanilla events... at least, that's how I did it, but my understanding of any modding tools is limited

    In text/db/*_message_event_text, the tag is like this: "message_event_strings_title_custom_event_*rom_Barbarian", where * is the custom event number. Of course, you'd repeat this 4 times for each culture. Then the localised string there is the title.

    In text/db/*_message_event_strings, the tag should be along the lines of "message_event_text_text_*", where the * is the "key" text from db/message_event_strings_tables. For example, for your test message up there, the tag would be "message_event_text_text_placeholder". Remember to write the "text" twice! The localised string is the actual text inside the info box.

    I'm not sure why CA did it that lopsided way, but it appears that they did... Ah well. Hope I helped - I had many headaches trying to figure out how it all worked, too!
    modificateurs sans frontières

    Developer for Ancient Empires
    (scripter, developed tools for music modding, tools to import custom battle maps into campaign)

    Lead developer of Attila Citizenship Population Mod
    (joint 1st place for Gameplay Mods in 2016 Modding Awards)

    Assisted with RMV2 Converter
    (2nd place for Warscape Engine Resources in 2016 Modding Awards)

  11. #11

    Default Re: How to create scripted events?

    So guys, if I want to add an event with PFM where I've to "script" it?

  12. #12

    Default Re: How to create scripted events?

    Quote Originally Posted by nostradamus1915 View Post
    So guys, if I want to add an event with PFM where I've to "script" it?
    Yes, it must include scripting, which may be a pain for any non-programmers. I'd suggest that you just try to find someone with lua scripting experience to join your team and help you, or you could search online for any lua tutorials - it's a relatively easy scripting language to begin learning.

    However, I'm planning on releasing a set of tools I've created for R2TR so the actual scripting logic is already included, so you could add these historical messages mainly through database editing. I'll give you a message when it's released, if you want.
    modificateurs sans frontières

    Developer for Ancient Empires
    (scripter, developed tools for music modding, tools to import custom battle maps into campaign)

    Lead developer of Attila Citizenship Population Mod
    (joint 1st place for Gameplay Mods in 2016 Modding Awards)

    Assisted with RMV2 Converter
    (2nd place for Warscape Engine Resources in 2016 Modding Awards)

  13. #13

    Default Re: How to create scripted events?

    Quote Originally Posted by Causeless View Post
    1 - Yes, it must include scripting, which may be a pain for any non-programmers. I'd suggest that you just try to find someone with lua scripting experience to join your team and help you, or you could search online for any lua tutorials - it's a relatively easy scripting language to begin learning.

    2 - However, I'm planning on releasing a set of tools I've created for R2TR so the actual scripting logic is already included, so you could add these historical messages mainly through database editing. I'll give you a message when it's released, if you want.
    1 - I'm actually a programmer, not a very expert one (I'm an university student), but if I study some tutorials I think I can learn to use that language. I just don't undertand where the scripts/functions are called in the game. Moreover, the event table is empty and not editable.
    2 - That's great! I would rly like to notice when you release them

  14. #14
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: How to create scripted events?

    Well still can't get this bloody event working.. haha..

    Fancy uploading a stripped out version of your files Causeless? Just so I can see what one working event is setup like. I've no idea what I'm doing wrong sadly.

  15. #15

    Default Re: How to create scripted events?

    Quote Originally Posted by nostradamus1915 View Post
    1 - I'm actually a programmer, not a very expert one (I'm an university student), but if I study some tutorials I think I can learn to use that language. I just don't undertand where the scripts/functions are called in the game. Moreover, the event table is empty and not editable.
    2 - That's great! I would rly like to notice when you release them
    Lua is an easy language to learn, but Rome 2 is a tricky beast to tame

    Quote Originally Posted by .Mitch. View Post
    Well still can't get this bloody event working.. haha..

    Fancy uploading a stripped out version of your files Causeless? Just so I can see what one working event is setup like. I've no idea what I'm doing wrong sadly.
    Yeah, let me ask the rest of the R2TR team, first. I'll just release all the files I've made so far as a collective "R2TR tools". I don't think I'll be able to write a full explanation or tutorials on how to use it all just yet, but you should be able to analyze it to see how it works. I've tried to keep a clean and consistent code structure, anyways!
    Last edited by Causeless; July 18, 2014 at 12:05 PM.
    modificateurs sans frontières

    Developer for Ancient Empires
    (scripter, developed tools for music modding, tools to import custom battle maps into campaign)

    Lead developer of Attila Citizenship Population Mod
    (joint 1st place for Gameplay Mods in 2016 Modding Awards)

    Assisted with RMV2 Converter
    (2nd place for Warscape Engine Resources in 2016 Modding Awards)

  16. #16
    LestaT's Avatar Artifex
    Join Date
    Jun 2005
    Location
    Campus Martius
    Posts
    3,877

    Default Re: How to create scripted events?

    Quote Originally Posted by Causeless View Post
    Yeah, let me ask the rest of the R2TR team, first. I'll just release all the files I've made so far as a collective "R2TR tools". I don't think I'll be able to write a full explanation or tutorials on how to use it all just yet, but you should be able to analyze it to see how it works. I've tried to keep a clean and consistent code structure, anyways!
    You want to release it separately (coordinates) or together ? I think together is fine.

    I'm uploading it and will give you the link shortly.
    Everything we hear is an opinion, not a fact. Everything we see is a perspective, not the truth. - Marcus Aurelius


  17. #17
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: How to create scripted events?

    By files I just meant a mod pack with a working event so I can see where Iv gone wrong, i.e the few db tables. No need to upload your mods tools if its problematic or whatever.

  18. #18

    Default Re: How to create scripted events?

    There's no problem in it - I've written out the post and I am just getting input from the rest of the team before I post it We were wanting to release the tools in the spirit of helping other mods anyways.
    modificateurs sans frontières

    Developer for Ancient Empires
    (scripter, developed tools for music modding, tools to import custom battle maps into campaign)

    Lead developer of Attila Citizenship Population Mod
    (joint 1st place for Gameplay Mods in 2016 Modding Awards)

    Assisted with RMV2 Converter
    (2nd place for Warscape Engine Resources in 2016 Modding Awards)

  19. #19

    Default Re: How to create scripted events?

    Here's the post: http://www.twcenter.net/forums/showt...2#post13965982

    Please download the non-steam-workshop version, it's a bit newer. With it, a historical event message should occur on the first and the second turn.
    modificateurs sans frontières

    Developer for Ancient Empires
    (scripter, developed tools for music modding, tools to import custom battle maps into campaign)

    Lead developer of Attila Citizenship Population Mod
    (joint 1st place for Gameplay Mods in 2016 Modding Awards)

    Assisted with RMV2 Converter
    (2nd place for Warscape Engine Resources in 2016 Modding Awards)

Posting Permissions

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