Results 1 to 30 of 98

Thread: Scripting

Hybrid View

Previous Post Previous Post   Next Post Next Post
  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?

    Hi Did this work

  13. #13

    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"

  14. #14
    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.

  15. #15
    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.

  16. #16
    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'.

  17. #17
    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 ;)

  18. #18
    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

  19. #19
    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

  20. #20

    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.

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