Page 1 of 2 12 LastLast
Results 1 to 20 of 30

Thread: Titanium - Coding/Scripting Preview

  1. #1
    Andytheplatypus's Avatar Domesticus
    Join Date
    Jan 2010
    Location
    . U.S. - MS, Gulf Coast.
    Posts
    2,384

    Icon4 Titanium - Coding/Scripting Preview

    Coding/Scripting Preview
    Ill try to post some pictures as soon as I get them

    Members:

    Andytheplatypus
    Beermugcarl
    Poisoned Goat

    RollingWave
    w.wallace61


    Scripting:
    Faster Turn Times
    Settlement Sapping
    New Campaign AI
    Improved City Defenses

    New Music

    Re-emergent Factions

  2. #2

    Default Re: Titanium - Coding/Scripting Preview

    what is and how do settlement sapping works?

  3. #3
    Lord of Shadows's Avatar Campidoctor
    Join Date
    May 2013
    Location
    Europe
    Posts
    1,918

    Default Re: Titanium - Coding/Scripting Preview

    Similar to RTW I think.

  4. #4
    Andytheplatypus's Avatar Domesticus
    Join Date
    Jan 2010
    Location
    . U.S. - MS, Gulf Coast.
    Posts
    2,384

    Default Re: Titanium - Coding/Scripting Preview

    Quote Originally Posted by napoleonic View Post
    what is and how do settlement sapping works?
    Poisoned Goat is the one who made that script, he can describe it better then I can.

  5. #5

    Default Re: Titanium - Coding/Scripting Preview

    Hey, sorry for the delay. I wasn't around during the weekend...

    I designed the sapping script with a lot of help from Gigantus. Essentially, it's a script that utilizes a console command to blow a hole in the walls of a besieged settlement, much like what siege engines do. It's different from sapping in RTW (if you remember what that looks like) in that there's only 1 hole in the wall, and that hole may appear anywhere, even on the side that's opposite to your army deployment site.

    Here's a brief description of how the script works:

    Turn 0: Besiege a particular settlement. This script only works on a per-settlement basis, which means that a new script needs to be written for each settlement. It completely lags the game to write 199 scripts, so sapping will only work or certain settlements (Rome, Constantinople etc).

    Turn 1: At the start of the turn, if your army is still besieging the settlement, there is a chance for a popup to appear, asking if you would like to recruit sappers for a sum of money. If you do, then you need wait 1 turn to see the results (they need time to do their work). If you don't, then they won't appear for the rest of that siege (the event is reset when the siege ends).

    Turn 2: If you accepted the sappers, you'll see the results at the start of this turn. 3 things can happen - 1: The sappers blow a hole in the wall. 2: The sappers damage the walls, but fail to make a proper breach. 3: The sappers die trying. Option 2 is somewhat helpful if you have siege equipment that can damage the walls; option 3 is depressing. And yeah, you don't get your money back for sub-optimal outcomes.

    The above description is the script for human players; the AI has its own version of this script that has lower probabilities of triggering, but at zero cost because the AI can't make decisions the same way as a human player would.

    This script is pretty cool, but there are many quirks about it that I can't do anything about:
    1: Even if there's a gaping hole in the wall, you can't attack the besieged settlement unless you built/brought siege equipment or have a spy opening the gates. This same bug is present when you try to attack a settlement with 100% damage to its walls... However, the AI does not encounter this restriction. Fun times...
    2: As I mentioned in the introduction, one script needs to be written for each settlement. The way M2TW reads scripts doesn't allow me to create a "generic" sapping script.
    3: If the popup appears and you save/reload without selecting an option, the outcome is the same as a rejection. Not 100% sure on this, will need to test this out. I'll get back to you later tonight.
    4: The script can go haywire if the same settlement gets besieged multiple times in succession. The good news is that there's no real downside to this; the sapping script will just stop working for a while, and go back to normal once the settlement stops getting besieged.
    5: I can't remember too clearly (been a while since I've messed with the script), but I believe sapping doesn't really work on fortresses/citadels. The console command used only destroys one section of the wall; guess what happens when there's more than 1 layer of walls. I can't run the command multiple times either, because the game only processes a single command.

    I hope this answers your question!

  6. #6

    Default Re: Titanium - Coding/Scripting Preview

    sorry, sound like a worthless effort that burden the game and thus our performance for a rather minimal impact than something that greatly enhanced the gameplay experience... would rather have settlement surrender script, rebellion and faction reappearing scripts.

    again, sorry to be blunt.
    Last edited by napoleonic; August 19, 2013 at 11:21 PM.

  7. #7

    Default Re: Titanium - Coding/Scripting Preview

    Sorry that you think that way =(

    The concept of the script itself is pretty interesting imo, until you figure out the quirks with it, like I've mentioned above. I can edit the percentages used in the script to make it more useful; however it becomes unrealistic and borderline OP. The good part is that the script is relatively compact and won't increase turn length (unless there's 199 copies of this script..), so don't worry about that.

    The good news is that some of the things you mentioned are indeed being worked on for Titanium!

  8. #8
    Indefinitely Banned
    Join Date
    Oct 2012
    Location
    Ludbreg,Croatia
    Posts
    670

    Default Re: Titanium - Coding/Scripting Preview

    if you write one script for all settlements its ok
    maybe plan this script only for crusader targets (Jerusalem,Constantinople,Cairo,.....)

    i think crusader targets are the same as jihad ones,the owner of the settlement differs
    Last edited by King of the Ring; August 20, 2013 at 07:52 AM.

  9. #9
    Senator
    Join Date
    Nov 2011
    Location
    London
    Posts
    1,234

    Default Re: Titanium - Coding/Scripting Preview

    Quote Originally Posted by King of the Ring View Post
    if you write one script for all settlements its ok
    maybe plan this script only for crusader targets (Jerusalem,Constantinople,Cairo,.....)

    i think crusader targets are the same as jihad ones,the owner of the settlement differs
    That's a pretty good idea, having the script work for Crusade/Jihad targets makes sense. Major cities will be affected, but not too many to make the game lag.

    Sounds really cool! Just like using the Jericho cheat on one part of the wall and it costs in game money...

  10. #10

    Default Re: Titanium - Coding/Scripting Preview

    i think this is a very good script,but schould only work for the ai and not for player,as it maybe makes it too easy for player,as ai don't know there is a hole in the wall?and stand on the walls?
    but good for ai as it gives ai more changes for victory when it besiege the player settlement,as in normal game i have never big difficut too defeat ai in siege battle,this script can change this,specially when there are two ai armies the hole in the wall will move the second ai army inside the settlement.


    edit; As I mentioned in the introduction, one script needs to be written for each settlement. The way M2TW reads scripts doesn't allow me to create a "generic" sapping script.

    don't know much but maybe not use name settlement but level settlement,like town,city huge city?
    Last edited by stevietheconquer; August 20, 2013 at 10:18 AM.

  11. #11

    Default Re: Titanium - Coding/Scripting Preview

    I can't create a script that works for all settlements (or settlement types) due to the limitations of the engine =( I'll need to compile a list of targets to sap. Probably not too many, 10-15 at most. I can also tweak the success rates depending on the size of the settlement (eg low success rates for Constantinople).

    @stevie: Thanks for the suggestions. Currently, the "cost" of sapping is the money that's paid upfront, together with the requirement to wait one additional turn. Furthermore, the sappers event won't always appear on the first turn after besieging. They might appear 3, 5 turns later, or not at all. So it won't be like a cheat code to screw the AI over.

    On the other hand, if a player decides to accept the sapping request, it needs to be sufficiently rewarding. For example, if the chance of success is 30%, it's gonna end up being more of an annoyance than a cool in-game feature with a relatively minimal impact, as napoleonic has mentioned. Therefore, I think the best way to make the script appealing is to have a low chance of the sapper event triggering, but a high chance of success.

  12. #12
    Indefinitely Banned
    Join Date
    Oct 2012
    Location
    Ludbreg,Croatia
    Posts
    670

    Default Re: Titanium - Coding/Scripting Preview

    also i would like a script to fix this situation: while playing as Egypt, i got crusaded by the pope
    after they took Jerusalem,the crusade finished and the armies that were on my land started attacking all the neighbouring area

    all my stacks were at the eastern border fighting the mongols and i had to do an emergency recruiting to cope with the situation

  13. #13
    Lord of Shadows's Avatar Campidoctor
    Join Date
    May 2013
    Location
    Europe
    Posts
    1,918

    Default Re: Titanium - Coding/Scripting Preview

    I would like the Pope to not attack anyone (especially Pisa!) and not to join on Crusades.

  14. #14
    Indefinitely Banned
    Join Date
    Oct 2012
    Location
    Ludbreg,Croatia
    Posts
    670

    Default Re: Titanium - Coding/Scripting Preview

    the script goat mentioned could be applied to all huge cities or citadels bt again,he says that it requires a lot of resources and stuff

  15. #15

    Default Re: Titanium - Coding/Scripting Preview

    Quote Originally Posted by King of the Ring View Post
    also i would like a script to fix this situation: while playing as Egypt, i got crusaded by the pope
    after they took Jerusalem,the crusade finished and the armies that were on my land started attacking all the neighbouring area

    all my stacks were at the eastern border fighting the mongols and i had to do an emergency recruiting to cope with the situation
    Might be possible. I have a rough idea of how it can be executed, not sure if the appropriate commands exist =/ Next problem is playtesting it.... it took me forever to playtest a modified version of the AI sapping script. I'm not too eager to playtest another thing that requires waiting for the AI to do stuff, hahaha.


    Quote Originally Posted by Lord of Dread View Post
    I would like the Pope to not attack anyone (especially Pisa!) and not to join on Crusades.
    Easiest way I can think of is to give every single general of the Papal states a hidden trait that removes most or all of their movement points. Their captains can still move around happily though. Scripting them to be passive is way out of my area of expertise (my level of expertise is actually negligible..)


    Quote Originally Posted by King of the Ring View Post
    the script goat mentioned could be applied to all huge cities or citadels bt again,he says that it requires a lot of resources and stuff
    Not really possible because the script needs to specify the name of a settlement at several points to ensure that it triggers on the correct target. Imagine if you lay siege to a huge city and the walls of some other huge city mysteriously blow up =S

  16. #16

    Default Re: Titanium - Coding/Scripting Preview

    Quote Originally Posted by poisoned goat View Post
    Hey, sorry for the delay. I wasn't around during the weekend...

    I designed the sapping script with a lot of help from Gigantus. Essentially, it's a script that utilizes a console command to blow a hole in the walls of a besieged settlement, much like what siege engines do. It's different from sapping in RTW (if you remember what that looks like) in that there's only 1 hole in the wall, and that hole may appear anywhere, even on the side that's opposite to your army deployment site.

    Here's a brief description of how the script works:

    Turn 0: Besiege a particular settlement. This script only works on a per-settlement basis, which means that a new script needs to be written for each settlement. It completely lags the game to write 199 scripts, so sapping will only work or certain settlements (Rome, Constantinople etc).

    Turn 1: At the start of the turn, if your army is still besieging the settlement, there is a chance for a popup to appear, asking if you would like to recruit sappers for a sum of money. If you do, then you need wait 1 turn to see the results (they need time to do their work). If you don't, then they won't appear for the rest of that siege (the event is reset when the siege ends).

    Turn 2: If you accepted the sappers, you'll see the results at the start of this turn. 3 things can happen - 1: The sappers blow a hole in the wall. 2: The sappers damage the walls, but fail to make a proper breach. 3: The sappers die trying. Option 2 is somewhat helpful if you have siege equipment that can damage the walls; option 3 is depressing. And yeah, you don't get your money back for sub-optimal outcomes.

    The above description is the script for human players; the AI has its own version of this script that has lower probabilities of triggering, but at zero cost because the AI can't make decisions the same way as a human player would.

    This script is pretty cool, but there are many quirks about it that I can't do anything about:
    1: Even if there's a gaping hole in the wall, you can't attack the besieged settlement unless you built/brought siege equipment or have a spy opening the gates. This same bug is present when you try to attack a settlement with 100% damage to its walls... However, the AI does not encounter this restriction. Fun times...
    2: As I mentioned in the introduction, one script needs to be written for each settlement. The way M2TW reads scripts doesn't allow me to create a "generic" sapping script.
    3: If the popup appears and you save/reload without selecting an option, the outcome is the same as a rejection. Not 100% sure on this, will need to test this out. I'll get back to you later tonight.
    4: The script can go haywire if the same settlement gets besieged multiple times in succession. The good news is that there's no real downside to this; the sapping script will just stop working for a while, and go back to normal once the settlement stops getting besieged.
    5: I can't remember too clearly (been a while since I've messed with the script), but I believe sapping doesn't really work on fortresses/citadels. The console command used only destroys one section of the wall; guess what happens when there's more than 1 layer of walls. I can't run the command multiple times either, because the game only processes a single command.

    I hope this answers your question!
    is this real ?? this cant be, it's just perfect !thank you so much for your effort !!!

  17. #17

    Default Re: Titanium - Coding/Scripting Preview

    Here's a preview of the sapping script in action:

    The turn after laying siege to a settlement that can be sapped, there's a chance that a popup will appear asking if you want to recruit sappers to assist your siege:
    Spoiler Alert, click show to read: 


    If you accept, then on the next turn, you'll get notified of the outcome. It might utterly fail:
    Spoiler Alert, click show to read: 


    Or they might be successful at doing their thing:
    Spoiler Alert, click show to read: 


    Their results are made known to you once you begin your assault on the city:
    Spoiler Alert, click show to read: 

    The sappers aren't very intelligent, blowing a hole in the side of the wall that my army isn't facing. Or my general is the not-so-intelligent one, deploying on the wrong side of the breach -_-



    I hope this teaser of the sapping script has gained your interest in this submod!

  18. #18
    Senator
    Join Date
    Nov 2011
    Location
    London
    Posts
    1,234

    Default Re: Titanium - Coding/Scripting Preview

    Looks really good, aside from the spelling - "walls of the Rome" and "now your armies and rush forward". Need to take out "the" from the first and add "take" (or similar) to the second!

  19. #19
    Lord of Shadows's Avatar Campidoctor
    Join Date
    May 2013
    Location
    Europe
    Posts
    1,918

    Default Re: Titanium - Coding/Scripting Preview

    Are they always going to sap on the other side of the wall?

  20. #20

    Default Re: Titanium - Coding/Scripting Preview

    I have a question, will the AI use sappers?

Page 1 of 2 12 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
  •