Page 4 of 4 FirstFirst 1234
Results 91 to 102 of 102

Thread: A Beginner's Guide to Scripting & Scripting "How To"s

  1. #91

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Here's a new idea: Can I make the rebel general invulnerable? that way, I could easily make the army is destroyed and then move it to a save location.

  2. #92

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    I seem to have a wierd problem with the following code:

    Code:
    declare_counter aedui_age
    set_counter aedui_age 11
    
    ;AI - console_command date -300 (BC)
    monitor_event FactionTurnStart Factiontype gauls
    and not I_LocalFaction gauls
    and I_CompareCounter aedui_age >= 10
    and I_TurnNumber > 1
    	set_counter aedui_age 12
    terminate_monitor
    end_monitor
    
    monitor_event SettlementTurnStart SettlementName Burdigala
    and I_SettlementOwner Burdigala = gauls
    and I_CompareCounter aedui_age = 12
    and not SettlementBuildingExists = agee2
    	console_command set_building_health Burdigala agee 0
    	console_command create_building Burdigala "agee2"
    end_monitor
    When I am using the faction gauls, the building will be created properly in the settlement.
    The problem only occurs when I am not using the faction gauls, whereby the game will always crash when the turn for the AI faction gauls start after clicking the end turn.
    I initially thought that it may not be possible to create buildings for AI factions... but the code below worked, in which the building agee1 is lower in the hierarchy than agee2 in EDB. So I'm not really sure why the code causes the game to crash and not work as expected.

    Code:
    declare_counter aedui_age
    set_counter aedui_age 11
    
    ;AI - console_command date -300 (BC)
    monitor_event FactionTurnStart Factiontype gauls
    and not I_LocalFaction gauls
    and I_CompareCounter aedui_age >= 10
    and I_TurnNumber > 1
    	set_counter aedui_age 11
    terminate_monitor
    end_monitor
    
    monitor_event SettlementTurnStart SettlementName Burdigala
    and I_SettlementOwner Burdigala = gauls
    and I_CompareCounter aedui_age = 11
    and not SettlementBuildingExists = agee1
    	console_command set_building_health Burdigala agee 0
    	console_command create_building Burdigala "agee1"
    end_monitor
    Next, I tried working around the crash by inserting one additional line to building creation code as shown below. The game did not crash like before, but the building agee2 failed to be created. Then I tested it out with agee6 and it worked only for a certain settlement, i.e. rest of the settlements do not have the building agee6 created despite the code being executed.

    Code:
    monitor_event SettlementTurnStart SettlementName Burdigala
    and I_SettlementOwner Burdigala = gauls
    and I_CompareCounter aedui_age = 12
    and not SettlementBuildingExists = agee2
    	console_command set_building_health Burdigala agee 0
    	console_command create_building Burdigala "agee1"
    	console_command create_building Burdigala "agee2"
    end_monitor
    The building levels are as follows:
    building agee
    {
    levels agee1 agee2 agee3 agee4 agee5 agee6 agee7 agee8
    {
    ...
    Last edited by lim_lucky; 12-31-2009 at 23:26.

  3. #93

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Quote Originally Posted by lim_lucky View Post
    Next, I tried working around the crash by inserting one additional line to building creation code as shown below. The game did not crash like before, but the building agee2 failed to be created. Then I tested it out with agee6 and it worked only for a certain settlement, i.e. rest of the settlements do not have the building agee6 created despite the code being executed.
    ...
    The additional line did not prevent the crashes, instead, it seems like that the game crashed only for some factions. Does someone have any advice? I have tried using factions { all, } in EDB but game still crashed.

  4. #94
    Finder of Little Oddities Senior Member Makanyane's Avatar
    Join Date
    Jan 2006
    Posts
    2,220

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    have you tried it without the

    console_command set_building_health Burdigala agee 0

    line? that doesn't actually destroy the building just damages it 100%
    when you add new building from script it gives settlement both buildings, despite fact they are in same tree. So maybe AI's attempt to repair old building at same time as getting new building is what is causing problem?

    Do you have enough spare building trees to split them up to prevent weirdness in the same tree?

    If its not that and its only related to certain factions / cultures check for missing EB texts for certain factions, or if its related to Carthaginian new building problem.
    Not used mods before? Looking for something small and fun?!
    Download the:

  5. #95

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Quote Originally Posted by Makanyane View Post
    have you tried it without the
    console_command set_building_health Burdigala agee 0

    line? that doesn't actually destroy the building just damages it 100%.

    when you add new building from script it gives settlement both buildings, despite fact they are in same tree. So maybe AI's attempt to repair old building at same time as getting new building is what is causing problem?
    I doubt this is the problem. The reason for setting the health to 0 is not to confuse the players - for easy identification to destroy old building. And the script works fine with it because I see the building gets damaged 100%. The problem comes with the building agee2 not being created, whereas agee6 works fine but only for one settlement.
    Of course I did check that the console_command is being executed, but the building is simply not built.

    Quote Originally Posted by Makanyane View Post
    If its not that and its only related to certain factions / cultures check for missing EB texts for certain factions, or if its related to Carthaginian new building problem.
    Its not the Carthaginian new building problem because I have already commented it out (;) in the DESCR_UI_BUILDINGS.txt.

    As for the missing EB texts, I believe it may be the reason which cause it to crash. But I'm testing the script using another barbarian faction to avoid the crash problem.

    Quote Originally Posted by Makanyane View Post
    Do you have enough spare building trees to split them up to prevent weirdness in the same tree?
    Thank you very much for the advice.
    I think I may have to abandon my script for setting the AI reforms/age and try presetting them using the starting campaign script. I plan to maximize the use of all 64 building trees, so I doubt I will split up the current building tree unless I'm really out of ideas for buildings.
    Last edited by lim_lucky; 01-08-2010 at 08:58. Reason: edit

  6. #96

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    What I've to do for use script during battle?
    For example: I want always disable guard mode during battle.

    I know there is a decudemon command that switch off guard mode..
    For activate script I can use that "help key scroll" (? in F1)..

    But, how implemented it correctly?
    Proud Roman General




  7. #97

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Am,guys,I have a little question:how to make a script,which able/disable recruting units by building foundrys,palaces etc. ?

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

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Hi Mike, this has nothing to do with scripting. If you want to edit buildings easily, I would suggest these editors:
    https://forums.totalwar.org/vb/showt...la-amp-Hadrian

  9. #99

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Oh,someone is live here I know how to edit buildings.I want make reforms like Marium by script.I want make some units recrutible after buildind, lets say, four foundrys...

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

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Yeah, the RTW modding forums are a lot quieter these days, but if you want an answer to a question, your best bet is to ask in the Modding Questions forum. This forum is technically for tutorials only. I'm afraid I'm not sure how to do what you want (it's been a while since I played/modded Rome myself), but I would suggest re-posting your question as a new thread in the Modding Questions sub-forum.

  11. #101

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    OK,thanks.

  12. #102

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    This is terrible but, I can't seem to make the initial tutorial on the first post, its odd using show_err i get no errors and i reckon i've followed the instructions to the letter (having gone over them like 100 times) i'm running vista if that makes a difference and its a clean 1.5 install

Page 4 of 4 FirstFirst 1234

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