Results 1 to 30 of 33

Thread: Scripting problems

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Notepad user Member Red Spot's Avatar
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    491

    Default Re: Scripting problems

    Quote Originally Posted by Makanyane
    do you mean in terms of using assault button to view contents of enemy army without actually attacking? (it does add them if you do that but you also get to view them as soon as it displays enemy army) Surely creating units when you open siege scroll has same effect but earlier
    and also occurs if you just re-open it to check if siege engines are built?

    meh, I might switch over to adding default army on start of siege and then top up / spawn if you maintain siege over turn, but I think it needs the terminate monitors in either way (?)
    actually I was, incorrectly, assuming that the siege_button would trigger the battle, but it ofcourse only triggers the deploment scroll(or what it is called)

    I'm not that bothered with extra spawn in such way that a settlement gets filled up, I already spawn 16units based on "global settlement level" wich pretty much fills up the settlement so an additional "viewing" might spawn 3 additional units but just as well none, anyway thats not really bothering me ...
    (I've taking lots of effort to try and get the AI up to a level where they can actually beat me on the campaign-map as well as battle-map without cheating all over the place, currently I get my behind kicked by the AI without cheating(well, AI eventually gets 2XP when training units, but only late in game) the only think I cant "balance out" is the fact that the AI doesnt respond to me paying a visit with ~3 to 5 stacks, 3 more units wont make much of a diff. in the big picture ... note that I play on VH/H in BI 1.6)


    G

  2. #2

    Default Re: Scripting problems

    looked at LotR's script (I'm going to have to apologise to their script writer for cribbing)
    I'm the lotr-tw scripter, and no apologise needed. Please, crib my scripts as much as you want, use freely all what you find useful, and share it here all what you think could be useful to others.
    Also, feel free to pm me if you want that I explain something about some script, or if you have any suggestion.

    As Athilus said: the Underscores in internal names aren't the problem, it's spaces in external names. We chose the middle dot to replace all the spaces from external names.
    Note: that I know, only the condition "SettlementName" uses the external name instead of the internal.

    Red Spot:also GarrisonSettlementRatio < 0.8, does that work??
    Makanyane: I was assuming it was working off the garrison level you see in the happiness rating in settlement view, and so related to population/army ratio
    I can confirm it works and I'm almost sure that Makanyane is right about the meaning.

    But, Makanyane, there where you have placed it in your lastest example it can't work because the event buttonpressed can't export the settlement record.

    monitor_event ButtonPressed ButtonPressed siege_assault_button
    and GarrisonSettlementRatio < 0.8
    monitor_event ScrollOpened seige_scroll
    and ScrollOpened seige_scroll
    I worked a lot in the development of my garrison script and I never though of using these kind of triggers .Thank you for point it out.
    I'll see if I can improve my garrison script with this info.
    Last edited by Bardo; 12-03-2007 at 13:06.

  3. #3
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: Scripting problems

    FATW uses indestructible buildings (marvels and regional buildings) to associate the script to (in addtion to one-word settlement names); not event scripting of course (we have none) but the traits and ancs coding...this was we do not need to worry about having settlements with more than one word in the name. Just a tip, though if you have a specific script on virtually every city then that system may not be robust enough.
    "One of the most sophisticated Total War mods ever developed..."

  4. #4
    Notepad user Member Red Spot's Avatar
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    491

    Default Re: Scripting problems

    you might want to go with Mak's method if you do end up using one, I'm tempting to change my script as well, it causes of lot of "sally out" scenarios ... a bit more than I actually like ...


    G

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

    Default Re: Scripting problems

    Thanks Bardo

    I did in the end use some events with the ScrollOpened seige_scroll event as well (though with terminate_monitor), and some done the way it works in LotR so you get garrison when siege lasts over turn, just to vary things for some cities to make result not as predictable for end user.

    If anyone's trying to use anything similar for M2TW its worth noting that, thankfully that does have an I_SettlementBesieged type condition (you'll need to check syntax) which removes the need for all the army placement checks. The little darlings also corrected the spelling of seige_scroll to siege_scroll, which was nice of them, but got me in trouble with friend who I gave text of RTW version to as an example, he figured out why it wasn't working after about 3 hours testing.
    Not used mods before? Looking for something small and fun?!
    Download the:

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

    Default Re: Scripting problems

    *bumps old thread* - am still trying to sort out possible script induced CTD mentioned in other thread.... in effort to try and simplify things I wondered
    should everything that works as an
    and....
    condition work as an
    if ....
    end_if
    condition?

    have got
    and SettlementBuildingExists > militia_barracks
    which works and detects building present or not correctly but stops event firing if put as
    if SettlementBuildingExists > militia_barracks
    ...
    end_if

    does that show that there is something dodgy about it? Or are there types of things you can't use in 'if'

    EDIT: that also only seems to work if its outside an 'if' as part of basic conditions for event and not as an 'and' inside an if clause. Using SettlementBuildingExists with = has exactly same problem.
    Last edited by Makanyane; 12-18-2007 at 20:33.
    Not used mods before? Looking for something small and fun?!
    Download the:

  7. #7
    Notepad user Member Red Spot's Avatar
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    491

    Default Re: Scripting problems

    In an other scripting-language you'd be absolutelly correct, though in this game as you noticed it doesnt work that way ..

    Rome's scripting-engine doesnt work with variables, so everything that needs a "reference" needs to be in some sort of "export of data" that contains both refrence as any data that you want available to you, or at least the coders once wanted available ..

    In the case of the condition "SettlementBuildingExists" you need the refrence [settlement] and get an "export of data" that is linked to/contains the settlement, the building data, and anything else you have available on the settlement, to get this "export of data" you connect the [setlement] to a command to get the export, in this case likelly the "SettlementTurnStart/End" events.


    G

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