Page 3 of 4 FirstFirst 1234 LastLast
Results 61 to 90 of 98

Thread: Scripting

  1. #61

    Default Re: Scripting

    Hi Myrddraal,

    Just a note to say that you guys rock! Please don't give up on this, it's really going to expand the RTW universe WHEN you crack this :)

    Cheers,
    Clare
    "Ad majoram Dei gloriam"

  2. #62
    Actual Person Member Paul Peru's Avatar
    Join Date
    Sep 2004
    Location
    Yurp
    Posts
    529

    Question Re: Scripting

    Is there a general scripting guide/reference somewhere?
    Sono Pazzi Questi Romani
    Paul Peru: Holier than thy bucket!

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

    Default Re: Scripting

    No, I guess this is just a research thread really. We should eventually get round to making a guide, what do you want to know?

  4. #64

    Default Re: Scripting

    I'm a bit confused... which of the above scripts is like three seasons and then the script ends so the computer can make it winter? I'd like to try that (save on the winter turns or something) with the show me how thingee...

    just wondering,
    Clare
    "Ad majoram Dei gloriam"

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

    Default Re: Scripting

    I don't really know what you mean, the best script is the one in my last post.

    Hopefully tomorrow, I'll have the defininitve script and post that.

  6. #66

    Default Re: Scripting

    Yeah...there are no real guides to scripting, but it's not that hard to learn. Just heaps of commands to find out and know how to use them(which is not that hard once you got the logic). They are all in the exe iirc.

    Oh and Myr, you should check and see if variables can be used in those scripts because that'd save you a lot of time (increase date variables + turns variables) and effort. I'm sorta busy nowadays, so I can't check to see if variables work.

  7. #67
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Scripting

    Sorry if it is a silly question (I am a blissfuly ignorant about scripting ):
    Could it be possible to simulate invasions with scripts?

    An example:
    We place only 19 factions in the map and keep one as "invader horde", let's say goths. We set a date and a place for the invasion, and the composition of the invader army. Thus when the date arrives, an army (coming from nowhere) suddenly appears in one corner of the map.
    Would it be possible?

    Thx.

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

    Default Re: Scripting

    Quote Originally Posted by Monkwarrior
    Sorry if it is a silly question (I am a blissfuly ignorant about scripting ):
    Could it be possible to simulate invasions with scripts?

    An example:
    We place only 19 factions in the map and keep one as "invader horde", let's say goths. We set a date and a place for the invasion, and the composition of the invader army. Thus when the date arrives, an army (coming from nowhere) suddenly appears in one corner of the map.
    Would it be possible?

    Thx.
    This is entirely theoretical, but the answer is yes/no.

    Why yes/no? Well, it’s possible to spawn armies through scripts (its done in the tutorial) and it should be possible to spawn a rebel army no problems, but you may run into issues when it comes to spawning essentially a new faction in the middle of a game, I don't know how well that would go down.
    Actually, I'm not sure if re-appearing factions is in RTW, I remember reading someplace that they can, but I can't say if I really did or my imagination got me all hopeful. If factions can re-appear, then I would guess the game is capable of starting a new faction in the middle of a game (though don't quote me on that).

    Only one way to find out though!
    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

  9. #69
    Member Member Botis's Avatar
    Join Date
    Sep 2002
    Location
    Auckland, New Zealand
    Posts
    26

    Default Re: Scripting

    Monkwarrior

    I like your idea, I'm coming up to a few weeks off for christmas and thought I'd like to make a few changes meself in this time,,, I've been thinking about how to do something like what you suggest and find a way around the factions not returning --- I want revolts from factions and barbarian invasions... on top of the SPQR mod it would make the game more like what I want... anyway...

    One idea I had for barbarians with AI (such that there is) attached - what if you made a "goth" capital in an isolated island region in the west in the atlantic (using the Mr Hide map editor) or something and made that island somehow inviolable, and then scripted some regular invasions to appear in the EAST... you could have them turn up regularly to harrass you... (Wonder what problems that Island might cause...)

    I do wonder if you can make new-units-for-faction, events, random... that would be interesting.

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

    Default Re: Scripting

    Thats entirely possible. No need for an island, you make a new settlement in the middle of a big patch of inpenetrable forest. Then when the date arrives, the script (all using console commands) gives a settlement in the east to that faction (The existing factions men are automatically ousted), give that settlement loads of troops, and there you go, a new faction is born. Of course, the faction could never be officially defeated as there would be no way to kill the people in the woodland province.

    And another problem would be the one I'm trying to tackle, the fact that loading a game stops the script. I've devised a way of launching a show_me automatically at the start of a campaign, but I've no idea what to do about loading.

    In the meantime, the idea for running the show_me script automatically at the start of the campaign worked, but I'm having trouble getting it to start again after a saved game. There are no triggers that I can find which would launch the advisor when you load it.

    But there is other good news, the game actually saves the number of turns which have elapsed, so you can save on any turn, and load on any turn, the script will pick up where you left off.

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

    Default Re: Scripting

    Quote Originally Posted by Myrddraal
    But there is other good news, the game actually saves the number of turns which have elapsed, so you can save on any turn, and load on any turn, the script will pick up where you left off.
    Sorry to beat this dead horse, but thats been the case since I first started working on a show_me script. I'm sure I mentioned it back then too.

    As for getting a script to launch when we load a game, that may have to be something that we pray CA implements in a patch. Scripting could prove to be very powerful, I'm disapointed that they haven't made any effort to help us.
    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

  12. #72
    Actual Person Member Paul Peru's Avatar
    Join Date
    Sep 2004
    Location
    Yurp
    Posts
    529

    Default Re: Scripting

    Quote Originally Posted by Myrddraal
    No, I guess this is just a research thread really. We should eventually get round to making a guide, what do you want to know?
    I don't need to know anything as such, just curious. If there were a doc of all the events, commands etc, I'd have wanted to play around with some scripting. I'm probably too lazy/busy/something to reasearch all that stuff myself, though. Perhaps we could petition/nag/pester CA for some info?

    Quote Originally Posted by Myrddraal
    Of course, the faction could never be officially defeated as there would be no way to kill the people in the woodland province.
    Couldn't you just give the woodland province to the rebels after you've given the "emerging" faction the new province?
    Sono Pazzi Questi Romani
    Paul Peru: Holier than thy bucket!

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

    Default Re: Scripting

    Quote Originally Posted by GodsPetMonkey
    Sorry to beat this dead horse, but thats been the case since I first started working on a show_me script. I'm sure I mentioned it back then too.
    Oops

  14. #74

    Default Re: Scripting

    Quote Originally Posted by Paul Peru
    I don't need to know anything as such, just curious. If there were a doc of all the events, commands etc, I'd have wanted to play around with some scripting. I'm probably too lazy/busy/something to reasearch all that stuff myself, though. Perhaps we could petition/nag/pester CA for some info?
    Well, all the commands are available already. That's how I made the CamHack script. You need to look in the EXE (a cracked exe) and you can find anything or so...scripting commands, console commands, command line arguments, constants and about everything you need. It's all there, it's just that no one has really bothered to compile every important stuff in the exe(well I did a while ago for testing purposes, though I doubt I kept the file).

  15. #75
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Scripting

    Quote Originally Posted by Enrique Orduno
    Well, all the commands are available already. That's how I made the CamHack script. You need to look in the EXE (a cracked exe) and you can find anything or so...scripting commands, console commands, command line arguments, constants and about everything you need.

    Ehhhh, could you please explain all this stuff for ignorants as me? Or at least give an indication of a web page where it is possible to learn something about it.

    (Translation: ¿podrías explicar todo este galimatías para ignorantes completos como yo? O indicar dónde podemos aprender algo acerca de esto.
    Perdón por el paréntesis en español.)

  16. #76

    Exclamation Re: Scripting

    Well, all the commands are available already. That's how I made the CamHack script. You need to look in the EXE (a cracked exe) and you can find anything or so...scripting commands, console commands, command line arguments, constants and about everything you need. It's all there, it's just that no one has really bothered to compile every important stuff in the exe(well I did a while ago for testing purposes, though I doubt I kept the file).


    ALL OF THEM!? Damn! What a gold mine! I would LOVE to get my hands on those! Do you think I could get a copy via email Enrique? This could mean everthing for modders.

  17. #77
    Actual Person Member Paul Peru's Avatar
    Join Date
    Sep 2004
    Location
    Yurp
    Posts
    529

    Default Re: Scripting

    Quote Originally Posted by Enrique Orduno
    Well, all the commands are available already. []You need to look in the EXE (a cracked exe) and you can find anything or so...scripting commands, console commands, command line arguments, constants and about everything you need.
    Goodness!
    But how, exactly, do I crack my EXE? Actually, could I booze it or pot it instead? I try to lay off the crack...
    Here's a thought: Some crackhead extracts the whole bucketfull and posts it somewhere. I could do some formatting and basic commenting on it if that's helpful.
    Sono Pazzi Questi Romani
    Paul Peru: Holier than thy bucket!

  18. #78

    Default Re: Scripting

    .... I have a Cracked Execute file. I see what I can do. I'll get back to you guys later on it.

  19. #79

    Default Re: Scripting

    Sorry for the lack of details...anyway, you need a hex editor and some patience. In the Hex Editor(I use a freeware version of Hex Workshop), run a search for a command that exists(like ScrollOpened) and you'll get other commands...About everything is in the EXE(most games are like that, though in some, it might be in a dll).

  20. #80
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Scripting

    Quote Originally Posted by Enrique Orduno
    Sorry for the lack of details...anyway, you need a hex editor and some patience. In the Hex Editor(I use a freeware version of Hex Workshop), run a search for a command that exists(like ScrollOpened) and you'll get other commands...About everything is in the EXE(most games are like that, though in some, it might be in a dll).
    Bufff! It seems too much complicated for me.
    I am an absolute ignorant in this field.
    I will wait for somebody else to do it.
    Thx.

  21. #81

    Default Re: Scripting

    Hi im new to this site.
    Im curious about this discussion.

    I have a cracked exe >.< too.
    I just finished copying and pasting all the "text" that is in my cracked Rome exe. Its around 500 kb of text! its a bit jumbled up since i directly copy and pasted it from a hex editor....i used Frhed....

    So far it looks like it contains all kinds of commands for battle scripts,campaignes, etc.

    Anyways i can send it to somebody via email or something if ya want. Just pm me.

  22. #82
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Scripting

    Quote Originally Posted by ProgrammerX
    Anyways i can send it to somebody via email or something if ya want. Just pm me.
    I am interested. PM sent.

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

    Default Re: Scripting

    Have you seen this post by Khelvan:

  24. #84
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: Scripting

    Quote Originally Posted by Myrddraal
    Have you seen this post by Khelvan:
    Yes, thanks.
    I wonder if both things, cracked exe and console commands, are the same.
    (sorry if this doubt seems dumm).

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

    Default Re: Scripting

    The second to last post contains many scripting commands, not console commands.

  26. #86

    Default Re: Scripting

    Would it be possible to now get a list of the required changes to implement 4 turns a year, with any show me how limitations etc, or whatever. I have gathered that the saving problem can be solved, but is the problem with loading messing up the years/turns still around?

    If we can save and load, even if show me how must be used to start the script each time we load, without other side effects, could a simple and complete tutorial be put together. I find this thread hard to follow.

    Crassus
    Horum omnium fortissimi sunt Belgae, propterea quod a cultu atque humanitate provinciae longissime absunt, minimeque ad eos mercatores saepe commeant atque ea quae ad effeminandos animos pertinent important, proximique sunt Germanis qui trans Rhenum incolunt, quibuscum continenter bellum gerunt. - Julius Caesar - de Bello Gallic

  27. #87
    Actual Person Member Paul Peru's Avatar
    Join Date
    Sep 2004
    Location
    Yurp
    Posts
    529

    Thumbs up Re: Scripting

    Well, paint me plaid and refer to me as a filthy cataphract camel!
    The CA has bestowed upon us a list of conditions and commands and a so-called scripting_manual!!!
    etc.
    Sono Pazzi Questi Romani
    Paul Peru: Holier than thy bucket!

  28. #88

    Default Re: Scripting

    First I want to tell that the short script below is created from the idea of Myrdraal ( what a name ! ) and The One ( sorry fix u later :D ) who test the Myrdraal's script and told that when set to winter then year will change .

    I want to use if .. end_if rather than monitor_conditions but it don't run correctly , so I guess that the monitor_XXX is run asynchronous and give best result .
    A small bug is when winter come then the year increase ? Please test .
    4 SEASON SCRIPT .
    Quote Originally Posted by Scripting
    script

    declare_counter GameRun
    declare_counter endQuarter
    declare_counter hasSetSeason

    set_counter endQuarter 0
    set_counter GameRun I_TurnNumber ;; don't need it

    ;; when the event FactionTurnEnd is catched then the
    ;; condition FactionIsLocal is TrueCondition will be checked
    monitor_event FactionTurnEnd FactionIsLocal TrueCondition
    inc_counter endQuarter 1
    set_counter GameRun I_TurnNumber

    end_monitor

    ;; if don't come to the winter yet so set season is summer
    ;; Count from 0 to 4 so winter will be 3 .
    ;; we can change the number to anything :D
    monitor_conditions I_CompareCounter endQuarter < 3
    console_command season summer
    end_monitor

    ;; if winter the set season to winter , if don't set it still winter
    ;; but year won't increase , perhap cause of season command . Will
    ;; fix it later
    monitor_conditions I_CompareCounter endQuarter = 3
    console_command season winter
    ;;;set_counter endQuarter 1
    end_monitor
    ;; if counter increased over 3 we must reset counter to 0 in order it
    ;; can be summer
    monitor_conditions I_CompareCounter endQuarter > 3
    campaign_wait 1 ;; need check when remove it work or not
    ;; check command when over 3
    ;; console_command add_money 20000
    set_counter endQuarter 0
    end_monitor

    ;; don't do anything when don't have end turn . Perhap it cause the bug.
    while FactionTurnEnd FalseCondition
    end_while

    end_script
    Please check it and tell me the result .
    Thanks MyDraal , I see scripting in RTW is very competing cause we don't know anything about construction of a script .

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

    Default Re: Scripting

    This may or may not stop the script from working, but you must remember that the FactionTurnEnd is not the same as the Year ending. There is a period in which the other factions have their turn. I would change FactionTurnEnd to FactionTurnStart. Then the season is changed at the beginning of the turn. As it should be.

    The year ends on the transition from winter to summer.

    May I ask who wrote this script? And where is the Scripting manual, me want...

  30. #90

    Talking Re: Scripting

    The difficult in here that I don't know whether RTW support calculus operation in scripting . How about we ask the "Guy" of CA ?
    If it support calculus at lease minus (- ) then the modify will be very easy . I even don't need any extra constants counter , just a temp counter use to check whether it's end year or not . That script can be modify as easy as follow :
    Code:
         monitor_event FactionTurnStart FactionIsLocal TrueCondition
               declare_counter temp
               set_counter temp I_TurnNumber
               while temp > 3           
                   set_counter temp temp - 3   ;; If it work , evrything is VERY EASY
               end_while
               ;; After end the while , temp will be in 1 - 3 range . Sure of it :D
               ;; So we check the condition
               if I_CompareCounter temp = 3
                           ;; winter , do st here
               end_if     
               if if I_CompareCounter temp < 3
                           ;; another seasons , do st here
               end_if     
    
         end_monitor
    It very short and when run "advice thread " after FactionTurnStart , though the game it was be saved or not , timer always work :D
    But please test whether it work or not .

    And another question I want to know that the "advice thread " really run or not ?

Page 3 of 4 FirstFirst 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