Page 2 of 5 FirstFirst 12345 LastLast
Results 21 to 40 of 93

Thread: TW Script Editor

  1. #21
    AJStoner's Avatar Lord of Entropy
    Join Date
    Dec 2010
    Location
    Currently exiled to Florida
    Posts
    1,746

    Default Re: TW Script Editor

    Alright, so the line:

    andI_SettlementOwner Cork ireland

    should read:

    and I_SettlementOwner Cork = ireland

    and:

    and I_EventCounter gunpowder_discovered 1

    should be:

    and I_EventCounter gunpowder_discovered = 1

    Is that it?



    Ah, one more query: what is the protocol on using "=" as opposed to "==" I have always been confused by this.
    Last edited by AJStoner; July 25, 2011 at 02:58 PM.

    *MEMBER OF THE HOUSE OF HADER* *UNDER THE CRUEL & MERCILESS PATRONAGE OF y2day*

  2. #22
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,760
    Blog Entries
    3

    Default Re: TW Script Editor

    In M2TW I don't think there's a difference. In a real programming language the difference is = represents assignment while == is used for comparison.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  3. #23
    AJStoner's Avatar Lord of Entropy
    Join Date
    Dec 2010
    Location
    Currently exiled to Florida
    Posts
    1,746

    Default Re: TW Script Editor

    Ah! Many thanks, good sir Squid!

    *MEMBER OF THE HOUSE OF HADER* *UNDER THE CRUEL & MERCILESS PATRONAGE OF y2day*

  4. #24
    AJStoner's Avatar Lord of Entropy
    Join Date
    Dec 2010
    Location
    Currently exiled to Florida
    Posts
    1,746

    Default Re: TW Script Editor

    One more annoying question:

    monitor_event CharacterTurnEndInSettlement not IsUnderSiege IsGovernor

    gets the same error but how would it be corrected? The parsing seems obscure here.

    *MEMBER OF THE HOUSE OF HADER* *UNDER THE CRUEL & MERCILESS PATRONAGE OF y2day*

  5. #25
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,760
    Blog Entries
    3

    Default Re: TW Script Editor

    Quote Originally Posted by AJStoner View Post
    One more annoying question:

    monitor_event CharacterTurnEndInSettlement not IsUnderSiege IsGovernor

    gets the same error but how would it be corrected? The parsing seems obscure here.
    Corrected below, every condition needs to be on its own line, you can't just put them all one after another.

    Code:
    monitor_event CharacterTurnEndInSettlement not IsUnderSiege 
    and IsGovernor
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  6. #26
    AJStoner's Avatar Lord of Entropy
    Join Date
    Dec 2010
    Location
    Currently exiled to Florida
    Posts
    1,746

    Default Re: TW Script Editor

    Thank you, Squid. You are a god among cyber-penguins.

    *MEMBER OF THE HOUSE OF HADER* *UNDER THE CRUEL & MERCILESS PATRONAGE OF y2day*

  7. #27
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,068
    Blog Entries
    35

    Default Re: TW Script Editor

    Version 0.5.3.85 still reports the banner change as incorrect.










  8. #28
    boboav's Avatar Decanus
    Join Date
    Sep 2009
    Location
    Italy
    Posts
    532

    Default Re: TW Script Editor

    I'm going to download, nice work!



    Quote Originally Posted by Squid View Post
    In M2TW I don't think there's a difference. In a real programming language the difference is = represents assignment while == is used for comparison.
    Yes, In C lenguage...
    Modder of "Bellum Crucis" and "De Bello Mundi"

  9. #29
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,760
    Blog Entries
    3

    Default Re: TW Script Editor

    Version 0.5.4

    Changes/Fixes from v0.5.3:

    • Not differentiating between console commands and script commands that have the same name
    • Faction line in spawn army blocks not being optional
    • Not reading multiple event groups in add_event blocks
    • In add_event_blocks where unexpected keywords were not being flagged as errors
    • Added emergent_faction as an event type for M2TW syntax highlighting
    • Added this as a constant for M2TW syntax highlighting
    • Not recognizing set_faction_banner blocks
    • Typo in console_command toggle_coastline that was preventing the command from being recognized

    Go to the first post to get the new version.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  10. #30
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,068
    Blog Entries
    35

    Default Re: TW Script Editor

    You're the dude!










  11. #31
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,068
    Blog Entries
    35

    Default Re: TW Script Editor

    A suggestion for the next version - could you create a check for the amount of units in an army spawn? An error here would be zero or more then 20 units.

    I_UnitExists is not covered by the checker (Invalid script command) plus I am getting a warning here: "Condition missing after event, if no condition required, use TrueCondition" - probably caused by the invalid script command error.

    monitor_event FactionTurnEnd FactionIsLocal
    and I_EventCounter chekis = 1
    and not I_UnitExists russia Kislev Chekist bodiguard
    set_event_counter chekis 0
    historic_event chekistd false factions { russia, }
    end_monitor
    Last edited by Gigantus; August 25, 2011 at 09:24 AM.










  12. #32
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,760
    Blog Entries
    3

    Default Re: TW Script Editor

    Must be a kingdoms condition all the ones I've missed have fallen into that category. I thought I changed it so if a invalid condition error occurred it wouldn't complain about no conditions. I'll add a check for number of spawn_army units as well.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  13. #33
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,068
    Blog Entries
    35

    Default Re: TW Script Editor

    Great, looking forward to it!

    I also have across a problem with name recognition with the I_CharacterExists condition:

    if not I_CharacterExists Duva of Kvellig

    This will give the following error: Invalid number of Arguments for condition 'I_CharacterExists' - I presume the usual way is to give the character a label (which is one word) and test for that, hence the error message.










  14. #34
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,760
    Blog Entries
    3

    Default Re: TW Script Editor

    A label would get around the issue, but the actual problem is I don't, yet, read in names to check against so the parsing part of the program has no way of knowing how many of the words after I_CharacterExists actually form a valid name.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  15. #35
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,068
    Blog Entries
    35

    Default Re: TW Script Editor

    I just came across this one:

    monitor_event GeneralAssaultsGeneral ! FactionIsLocal
    and ! TargetFactionIsLocal
    and I_CompareCounter panel_check != 2

    set_counter panel_check 2
    end_monitor

    Both exclamation marks got flagged as invalid, the combination of exclamation mark and equal sign was OK. I thought the exclamation mark meant 'not' (or are these circumstances just not in the checking base yet?)










  16. #36
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,760
    Blog Entries
    3

    Default Re: TW Script Editor

    I'm pretty sure you can't use ! in place of not in a script. At least it isn't used that way in any vanilla scripts.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  17. #37
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,068
    Blog Entries
    35

    Default Re: TW Script Editor

    That would be a nasty surprise for the CoW guys....
    I thought I had seen it's use before. TATW?

    Edit: start of Germanicu5's script in Deus Io Vult (should be the same in TATW, but haven't got it installed)

    monitor_event BattleConflictPhaseCommenced FactionIsLocal
    and I_BattlePlayerArmyIsAttacker
    and ! I_ConflictType Siege
    and ! I_ConflictType SuccessfulAmbush
    and I_BattleEnemyArmyNumberOfAttribute stakes > 0
    and I_BattlePlayerArmyNumberOfUnitCategory cavalry > 0
    and I_BattleEnemyArmyNumberOfUnitCategory cavalry < 1
    Last edited by Gigantus; August 26, 2011 at 10:27 AM.










  18. #38

    Default Re: TW Script Editor

    Quote Originally Posted by Squid View Post
    I'm pretty sure you can't use ! in place of not in a script. At least it isn't used that way in any vanilla scripts.
    It can be used in M2TW i have several scripts that use it, Taiji was the one that told me so about it a year ago. Does it works for RTW also?

  19. #39
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,760
    Blog Entries
    3

    Default Re: TW Script Editor

    Version 0.5.5

    Changes/Fixes from v0.5.4:

    • Fixed ! not being recognized as equivalent to Not
    • Added event I_UnitsExists
    • Added error for when a spawn_army block has more than 20 units

    Go to the first post to get the new version.

    Note: An error for a spawn_army block with no units was already present
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  20. #40
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,068
    Blog Entries
    35

    Default Re: TW Script Editor











Page 2 of 5 FirstFirst 12345 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •