Page 1 of 4 1234 LastLast
Results 1 to 30 of 98

Thread: Scripting

  1. #1
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default More than 2 turns a year?

    I posted this as a side point in the WoT mod thread, but maybe someone here can answer it:

    If we could change the number of turns in one year that would be awsome. For example, have four seasons to a year instead of two.

    I was thinking of a possible way of doing this. I was looking around the prologue_script.txt file, and I noticed that you can enter cheats. They use the line console_command, and then enter the cheat code.

    For example, they make sure you don't lose ur character by making him invulnerable:

    console_command invulnerable_general "Gaius Julius"

    If we could somehow make this type of script work for other campaigns, then you could write out a very long script which would do this:

    Turn one: do nothing (spring)
    Turn two: change the season back to summer (summer)
    Turn three: change the season back to summer (autumn or fall for the americans)
    Turn four: do nothing. (winter, the date would then automatically advance by one at the end of this turn)

    It would do this in cycle for the whole game period, and there you go, four turns to a year.

    Now I don't know if it would work, but its an idea worth looking into.

  2. #2
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: More than 2 turns a year?

    I take it no-one knows better than me...

  3. #3
    Magister Vitae Senior Member Kraxis's Avatar
    Join Date
    Feb 2002
    Location
    Frederiksberg, Denmark
    Posts
    7,129

    Default Re: More than 2 turns a year?

    Let me ask... You have to do this all the time right? And you sure the characters don't as they shouldn't?
    You may not care about war, but war cares about you!


  4. #4
    Head Hurlers Rule! Member Bacchon's Avatar
    Join Date
    Apr 2004
    Location
    Vancouver, BC
    Posts
    77

    Default Re: More than 2 turns a year?

    That looks like it would work to me... Only problem I could think of was that it'd still advance the year after every two turns, regardless of the season. You'd thus have two years per season cycle according to the game display, unless you could script that to change as well, but that would take a huge amount of work, as you'd probably have to script it to change each and every year manually. I, personally, could live with having two years/season cycle, wouldn't matter to me. Characters would only live through half as many years by the season cycle, though the same as by the clock.

    Excellent idea, though.

    -edit-

    If the years do advance as one year/two seasons and not one year/season cycle, you'd also have to double the number of playable years. Also not a big deal for me, my games never finish after 100BC. 'Course, I never made it into Late Era in MTW. *shrug*
    Last edited by Bacchon; 11-27-2004 at 11:57.
    And I heard, as it were, the noise of thunder,
    One of the four beasts sang, "Come and see,"
    And I saw, and behold, a white horse.

    And I heard a voice in the midst of the four beasts,
    And I looked, and behold, a pale horse,
    And his name it said on him was Death,
    And Hell followed with him.

  5. #5
    |LGA.3rd|General Clausewitz Member Kaiser of Arabia's Avatar
    Join Date
    Mar 2004
    Location
    Munich...I wish...
    Posts
    4,788

    Default Re: More than 2 turns a year?

    Hope there's a way around that, I need it for my AmericanConquestTotalWar mod. It would be long but I need more than an 8 turn Civil War (I was gonna make the turns into months)
    -Capo

    Why do you hate Freedom?
    The US is marching backward to the values of Michael Stivic.

  6. #6
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: More than 2 turns a year?

    Its easy enought to do in the prologue script, but I can't make script files for any other campaign. Am I wasting my time?

  7. #7

    Default Re: More than 2 turns a year?

    I don't think its useless if you can get away from the 'year/age' paradigm. Like if you thought of turns as turns and modified the game likewise. For instance I was thinking instead of born, coming of age and died it could be - "A new officer is commissioned/arrives at (theater of war) and is beginning HQ staff duties" for born, "A new officer receives his command" for coming of age and "Officer retired/dies of natural causes/transferred out of (theater of war)" for dies. I for one would like to see more turns per year and if you got the script working that will give RTW four seasons thats great, maybe you could post it?

    Cheers,
    Clare
    "Ad majoram Dei gloriam"

  8. #8

    Default Re: More than 2 turns a year?

    Have you tried this:

    script
    Prologue_Campaign_Script.txt



    At the bottom of the appropriate desc_strat file? This is going to be difficult without some idea of the script language and format. For more ideas see the scripts in the show_me directory.

  9. #9
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: More than 2 turns a year?

    My god, I can't believe I missed it...

    Thx Tommh, I'll see what I can do...

  10. #10
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: More than 2 turns a year?

    I have a script that works:

    Code:
    	declare_counter PressEndTurn
    
    
    	console_command date -50
    		set_counter	PressEndTurn 101
    
    	while I_CompareCounter PressEndTurn = 101
    	monitor_event ButtonPressed ButtonPressed end_turn
    		set_counter	PressEndTurn 1
    		terminate_monitor
    	end_monitor
    	end_while
    
    
    	while I_CompareCounter PressEndTurn = 1
    	console_command date -50
    	console_command season summer
    		set_counter	PressEndTurn 100
    	end_while
    
    	while I_CompareCounter PressEndTurn = 100
    	monitor_event ButtonPressed ButtonPressed end_turn
    		set_counter	PressEndTurn 2
    		terminate_monitor
    	end_monitor
    	end_while
    
    
    	while I_CompareCounter PressEndTurn = 2
    	console_command date -50
    	console_command season summer
    		set_counter	PressEndTurn 200
    	end_while
    
    	while I_CompareCounter PressEndTurn = 200
    	monitor_event ButtonPressed ButtonPressed end_turn
    		set_counter	PressEndTurn 3
    		terminate_monitor
    	end_monitor
    	end_while
    
    
    	while I_CompareCounter PressEndTurn = 3
    	console_command date -50
    	console_command season winter
    		set_counter	PressEndTurn 300
    	end_while
    
    	while I_CompareCounter PressEndTurn = 300
    	monitor_event ButtonPressed ButtonPressed end_turn
    		set_counter	PressEndTurn 4
    		terminate_monitor
    	end_monitor
    	end_while
    
    
    	while I_CompareCounter PressEndTurn = 4
    	console_command date -51
    	console_command season summer
    		set_counter	PressEndTurn 400
    	end_while
    
    	while I_CompareCounter PressEndTurn = 400
    	monitor_event ButtonPressed ButtonPressed end_turn
    		set_counter	PressEndTurn 5
    		terminate_monitor
    	end_monitor
    	end_while
    
    
    	terminate_script
    This makes the game run from the date -50 and has four seasons for the first turn.

    There are a few bugs. The seasons don't seem to want to change, there is currenly one summer, and three winters. I'll see what I can do.

  11. #11
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: More than 2 turns a year?

    Ok, ignore that previous post, the code was flawed. The flaw was that the year ends some time after the player presses end turn.

    Here is the new and shiny, bugless and concise Script:

    Code:
    	console_command date -50
    
    	while I_TurnNumber = 0
    	end_while
    
    	console_command date -50
    	console_command season summer
    
    	while I_TurnNumber = 1
    	end_while
    
    	console_command date -50
    	console_command season summer
    
    	while I_TurnNumber = 2
    	end_while
    
    	console_command date -50
    	console_command season winter
    
    	while I_TurnNumber = 3
    	end_while
    
    	console_command date -51
    	console_command season summer
    
    	console_command date -51
    	console_command season summer
    
    	while I_TurnNumber = 4
    	end_while
    
    	console_command date -51
    	console_command season summer
    
    	while I_TurnNumber = 5
    	end_while
    
    	console_command date -51
    	console_command season winter
    
    	terminate_script
    This can be repeated as much as you like.
    Hope someone finds this usefull. Please tell me if your using it, I'd like to know how many people use it.

    Now all we need is a way of increasing life spans.

    To the Mods: Is this worthy of the Guides Forum?

  12. #12

    Default Re: More than 2 turns a year?

    I wonder if this will affect character lifespan? It will depend on if the current year counter is used or if it keeps count of turns.

  13. #13
    Wandering Historian Member eadingas's Avatar
    Join Date
    Nov 2004
    Location
    Llanfairpwll- gwyngyll- gogerych- wyrndrobwll- llantysilio- gogogoch
    Posts
    4,714

    Default Re: More than 2 turns a year?

    What happens when the script ends? Does the game end or does it go 'normal' ?
    I'm still not here

  14. #14
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: More than 2 turns a year?

    I used that bit of script from the prologue. Next to it there is a comment that says:

    ;No more scripty bits, just normal game.

    Or something like that. I must admit, I haven't tested the script that far, I just got through about 5 turns, saw it was working, and quit. I assume it just carries on as normal.

    @Tommh, I think it counts turns.

  15. #15
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Default Re: Scripting

    Excellent find, myrddaal! I didn't know this was possible. Perhaps it's a good idea to collect all scripting commands and see if there are more combinations/effects possible.

    Cheers,
    Duke John

  16. #16
    Member Member MR EGG's Avatar
    Join Date
    Jan 2003
    Location
    WOOLACOOBE N,DEVON
    Posts
    126

    Default Re: Scripting

    Hello I've moddified your script extended it to 104 turns.
    Each turn now equalls 1 week and the year changes on the 53rd turn.
    one thing is no body ages at all not even when the year changes.

    thanks myrddaal for your info

    MR EGG

  17. #17
    Altogether quite not there! Member GodsPetMonkey's Avatar
    Join Date
    Aug 2004
    Location
    Australia
    Posts
    839

    Default Re: Scripting

    Great discovery! As we learn more, it’s sure to revolutionise RTW modding. I hope CA helps us a little here, in many games scripting is a very powerful tool.

    But, for changing the number of turns per year, its way too much typing for my liking. So, being the lazy person that I am, I quickly wrote a program to do all the hard work for me!

    Grab it here -
    http://www.totalwar.org/Downloads/Rt.../ScriptGen.zip

    As far as I can tell, it works great.
    Caligula and Hadrian - Unit and Building editors for Rome: Total War.
    Now editing -
    export_descr_unit.txt, export_descr_unit_enums.txt, export_units.txt, descr_model_battle.txt
    export_descr_buildings.txt, export_descr_buildings_enums.txt, export_buildings.txt

  18. #18

    Default Re: Scripting

    Hi Myrddraal,

    Should I put it in the scripts folder or the *campaign_name* folder? Really excited about this!

    You rule!
    Clare
    "Ad majoram Dei gloriam"

  19. #19
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: Scripting

    You should put it in the campaign folder, and make a line at the bottom of the descr_strat.txt like this:

    script
    descr_Script.txt

    Or whatever ur script file is called.

    MR_EGG thats great, as I said I hadn't tested it much and I had assumed that aging would be doubled. I can see this is going to be useful for my Wheel of Time Mod as well...

    @GodsPetMonkey, U got there first! Thats what I was about to do. Thx.
    Last edited by Myrddraal; 12-05-2004 at 14:13.

  20. #20
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: Scripting

    I noticed your script generator generates 2 winters and 2 summers if you put it to 4 turns a year.

    Maybe you could add an extra option:

    Number of these turns to be summers.

    This would be convinent for those who want to do Months, and have the winter months snowy.

  21. #21
    Barcid General Member [cF]HanBaal's Avatar
    Join Date
    Oct 2004
    Location
    Cale, I-shphanim
    Posts
    232

    Default Re: Scripting

    hi Myrddraal! Great job you got here! I always wanted RTW to have 4 turns also

    Three questions:

    1-Reading MR.EGG's post, can we assume the characters' lifespan is related to years and not turns? If not, have you (or anyone else) found a way to make it so?

    2- Reading your script sample, I also assume you managed to make 3 summer seasons and one winter season per year right?

    3- Considering conditions 1 and 2 as achievable, would you mind if we implement this feature into the EuropaBarbarorum mod? All credits due of course
    "I swear so soon as age will permit I will use fire and steel to arrest the destiny of rome" - Hannibal Barca at the age of 9, ca238BC

    "Against those who have incurred the wrath of God" - Genseric, King of the Vandals, ca455CE, replying to his helmsman whither he should steer. His fleets now yearly sailed from his new capital Karthadast. The whole of Africa, Sicily, Sardinia, Corsica and the Balearic Islands quickly fell in his hands. Then he sacked Rome. For 14 days and nights Genseric pillaged the city and returned to Karthadast, carrying much booty and many thousand captives, the empress and her two daughters. The city and the people were spared. Yet, they are the 'vandals'.

  22. #22
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: Scripting

    As far as I know, 1 is true, though I haven't tested it myself.

    2 is true.

    And of course I don't mind. If I didn't wan't people using it, I would never have posted, but I do like people to appreciate, so the credits are welcome ;)

  23. #23

    Default Re: Scripting

    ok, I made each turn represent 1 month but now I cant save and it doesnt autosave either. Also, generals dont age for 6 turns then they age every turn after that then process repeats itself at the start of the year.

  24. #24
    Altogether quite not there! Member GodsPetMonkey's Avatar
    Join Date
    Aug 2004
    Location
    Australia
    Posts
    839

    Default Re: Scripting

    Quote Originally Posted by Myrddraal
    I noticed your script generator generates 2 winters and 2 summers if you put it to 4 turns a year.

    Maybe you could add an extra option:

    Number of these turns to be summers.

    This would be convinent for those who want to do Months, and have the winter months snowy.
    Well, I admit I just knocked it up in like 20 mins, pretty simple to do, but I guess I can work in such a feature, give me a bit of time and I'll get back to you

    EDIT -
    Actually, that was alot easier then I expected, and only took me about 5 minutes to implement and test, grab the new version here;
    http://www.totalwar.org/Downloads/Rt...iptGen_101.zip
    Last edited by GodsPetMonkey; 12-05-2004 at 22:50.
    Caligula and Hadrian - Unit and Building editors for Rome: Total War.
    Now editing -
    export_descr_unit.txt, export_descr_unit_enums.txt, export_units.txt, descr_model_battle.txt
    export_descr_buildings.txt, export_descr_buildings_enums.txt, export_buildings.txt

  25. #25
    Wandering Historian Member eadingas's Avatar
    Join Date
    Nov 2004
    Location
    Llanfairpwll- gwyngyll- gogerych- wyrndrobwll- llantysilio- gogogoch
    Posts
    4,714

    Default Re: Scripting

    You two guys have made whole new worlds open to the modding community
    I'm still not here

  26. #26
    Altogether quite not there! Member GodsPetMonkey's Avatar
    Join Date
    Aug 2004
    Location
    Australia
    Posts
    839

    Default Re: Scripting

    Quote Originally Posted by eadingas
    You two guys have made whole new worlds open to the modding community
    If your talking about me, all credit mist go to Myrddraal, I just wrote a bit of code to do it over and over and over again, anyone with same spare time could have done it.
    Caligula and Hadrian - Unit and Building editors for Rome: Total War.
    Now editing -
    export_descr_unit.txt, export_descr_unit_enums.txt, export_units.txt, descr_model_battle.txt
    export_descr_buildings.txt, export_descr_buildings_enums.txt, export_buildings.txt

  27. #27
    Member Member MR EGG's Avatar
    Join Date
    Jan 2003
    Location
    WOOLACOOBE N,DEVON
    Posts
    126

    Default Re: Scripting

    Hello
    when I tested this I was using the original code and no one aged.
    now with this exellent tool from GodsPetMonkey and Myrddraal's new code thx guys it works great and characters do age. through testing I've found that if all the turns are summer then they age normaly once per year and at different times per character within the year,but if you have a winter turn then all the characters will age by one year and will increase there age every winter turn thereafter.So if you have two winter turns in a row then everybody ages two years.
    cheers MR EGG.
    Last edited by MR EGG; 12-06-2004 at 02:34.

  28. #28
    Barcid General Member [cF]HanBaal's Avatar
    Join Date
    Oct 2004
    Location
    Cale, I-shphanim
    Posts
    232

    Default Re: Scripting

    Quote Originally Posted by MR EGG
    through testing I've found that if all the turns are summer then they age normaly once per year and at different times per character within the year,but if you have a winter turn then all the characters will age by one year and will increase there age every winter turn thereafter.So if you have two winter turns in a row then everybody ages two years.
    Thx a lot for the testing info mate ! The solution (at least for now) is then to have only a winter season per year to make aging work correctly. Again, thx a lot guys, especially to Myrddraal, for making this possible
    "I swear so soon as age will permit I will use fire and steel to arrest the destiny of rome" - Hannibal Barca at the age of 9, ca238BC

    "Against those who have incurred the wrath of God" - Genseric, King of the Vandals, ca455CE, replying to his helmsman whither he should steer. His fleets now yearly sailed from his new capital Karthadast. The whole of Africa, Sicily, Sardinia, Corsica and the Balearic Islands quickly fell in his hands. Then he sacked Rome. For 14 days and nights Genseric pillaged the city and returned to Karthadast, carrying much booty and many thousand captives, the empress and her two daughters. The city and the people were spared. Yet, they are the 'vandals'.

  29. #29
    Altogether quite not there! Member GodsPetMonkey's Avatar
    Join Date
    Aug 2004
    Location
    Australia
    Posts
    839

    Default Re: Scripting

    I'd like to know which nutter bound ageing to it being winter...

    Then again, I dont think they expected us to end up doing this.... at all.
    Caligula and Hadrian - Unit and Building editors for Rome: Total War.
    Now editing -
    export_descr_unit.txt, export_descr_unit_enums.txt, export_units.txt, descr_model_battle.txt
    export_descr_buildings.txt, export_descr_buildings_enums.txt, export_buildings.txt

  30. #30

    Default Re: Scripting

    SO lets try to figure out all the possibilities:

    We can have more turns per year and that means that turn based things can be adjusted relative to time based things:


    Time based:
    Aging, time based - (kind of wierdly)
    Weather time based - (but linked to aging)
    Events - I believe these are time based
    End of game
    seasonal crop income? I think this is seasonal?
    Triggers? - does anyone know of any time based triggers (i.e. based on the current date)

    Turn based:
    Building
    Recruitment & training
    movement rates
    VnV & Ancillary triggers - most are based on a per turn chance of occurance

    So effectivly we now have the capability to change the relative relationship between one column and the other.

    Some remaining issues:

    Agricultural income will increase significantly if you add two extra summers. Needs to be adjusted.
    Adjustment to building and recruitment rates as nessecary.
    Adjustment to VnV & ANcillary triggers (essentially to keep the same occurance rates you would have to halve the points accumulated or the chance of occurance if you double the turns per year)

    Nice catch, good detective work!

Page 1 of 4 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO