Results 1 to 22 of 22

Thread: Scripts triggered via advice, "like" show_me

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 Scripts triggered via advice, "like" show_me

    Currently my version of RTW is unplayable so I cant test this atm and incase I'd forget I just (already) post it over here ...

    What I'm after are "player made feature's", what I mean with that is that by using the advice ability of RTW we can implement all sorts of (scripted) features (not unknown but unknown to me and imo not much explored according to available info about it)

    ===============

    What I'm currently after are several features wich trigger an advice wich in turn triggers a show_me type script, for instance
    -change the well-known garrison-script so it doesnt need a "warning tag" (once used keep it using or dont use it at all!!)
    -create re-emerging factions according to my specs and not hardcoded routines (with or without BI, though hording helps a lot!)

    the basic logic is simply in that is actually is a simplified version of similiar type script run as show_me script, the hard part is that "afaik" there is no way you can have the script remember things, what I mean is how can I make sure a garrison is spawned now but not the next turn if the script will run only that turn and than quit??
    There are ways of preventing stuff, like creating a new unit (just in label) and use it as spawn-unit for the script and than check up on how many of unit type X are in the garrison, instead of using counters to prevent over-spawn, but those are lacking.

    So basicly this is with the hope someone else already has the info, else as a placeholder for when my game is up and running. (its running but not as a decent test-base)


    G

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

    Default Re: Scripts triggered via advice, "like" show_me

    as example, this garrison script I would like to be run as a show_me script but by a "silent" bit of advice, seeing that the problem is that you cant have a script load on gameload or detect if a script is running I was thinking about having it run each turn, basicly transfer the monitors to descr_advice and have that trigger proper scripts
    (say have a monitor check up on AI's treasury than call a script to give some cash if needed, or even the favored 4-turns a year script can be adapted to this so it doesnt need the player "to remember ....")

    example-script;
    Code:
    monitor_event FactionTurnEnd FactionIsLocal
    
    	if I_CompareCounter XCityX_Besieged > 0
    	and I_SettlementOwner XCityX = romans_julii
    		set_counter XCityX_Besieged 0
    	end_if
    
    	if I_CompareCounter XCityX_Besieged = 0
    	and not I_SettlementOwner XCityX = romans_julii
    		if I_CharacterTypeNearTile romans_julii family, 8 XxX,YyY
    			set_counter XCityX_Besieged 1
    		end_if
    		if I_CharacterTypeNearTile romans_julii general, 6 XxX,YyY
    			set_counter XCityX_Besieged 1
    		end_if
    		if I_CompareCounter XCityX_Besieged = 1
    		and not I_FactionNearTile romans_julii 2 XxX,YyY
    			console_command create_unit XCityX "spawn legion" 2
    			console_command create_unit XCityX "spawn archer" 1
    			set_counter XCityX_Besieged 0
    		end_if
    
    		if I_CompareCounter XCityX_Besieged = 1
    			console_command create_unit XCityX "spawn legion" 5
    			console_command create_unit XCityX "spawn archer" 3
    		end_if
    	end_if
    
    	if I_CompareCounter XCityX_Besieged = 2
    		set_counter XCityX_Besieged 0
    	end_if
    
    	if I_CompareCounter XCityX_Besieged = 1
    	and not I_CharacterTypeNearTile romans_julii family, 2 XxX,YyY
    	and not I_CharacterTypeNearTile romans_julii general, 2 XxX,YyY
    		set_counter XCityX_Besieged 2
    	end_if
    
    end_monitor
    basing the trigger on a faction means each script can be written for a specific faction, like the example is written for the Julii
    It will check up on generals and family members nearby, but also when possibly under siege, spawning some extra men if you get close and a full reinforcement once if its possibly you're sieging the settlement
    Than once you leave it takes at least 2 turns before a full reinforcement can take place ..

    The issue I have (in concept) with making this trigger by advice is the lack of being able to set some sort of "City_ Besieged" flag to prevent over-spawn "for sure" ..


    G

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

    Default Re: Scripts triggered via advice, "like" show_me

    I've been tempering with the advice file for a day now (export_descr_advice)
    and have come to be believe that there is no way to get some "silent advice"

    seems I had missunderstood a few things, in that I assumed I could trigger a script without the need to press a button, "seems" I'm wrong there ...

    It was a nice idea ....


    G

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

    Default Re: Scripts triggered via advice, "like" show_me

    Yeah sorry Red Spot, it's not possible to trigger advice without pressing the button. Unless you already have a script running, in which case you'd need to press a button to get that one working etc.

    That doesn't mean you can't use them to implement user made features (like different seasons and turns per year )

    There are workaround methods for 'remembering' stuff though.

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

    Default Re: Scripts triggered via advice, "like" show_me

    Thanks for replying Myddraal, I apreciate it ;)

    btw do you know if there are ways to get the player promted with something (advisor?) whenever they load a savegame, I did find the "GameReloaded" command but couldnt get it to work (at least not the way I assumed it worked)



    G
    Last edited by Red Spot; 10-16-2007 at 03:52.

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

    Default Re: Scripts triggered via advice, "like" show_me

    If you link the trigger which activates the advisor for the script to a UI button/buttons the player is likely to press then you can make the advisor pop up which should work as a reminder.
    Only thing I played much that is scripted is Arthurian TW, they did it with multiple triggers so more or less anything you selected in the campaign map made the advisor pop up with the start script prompt.
    eg:
    ;------------------------------------------

    Trigger ATW_Campaign_Trigger1
    WhenToTest ButtonPressed

    Condition ButtonPressed faction_button

    AdviceThread ATW_Campaign_Thread 1
    and also same thing for
    Condition ButtonPressed construction_button
    Condition ButtonPressed recruitment_button
    WhenToTest SettlementSelected
    which covers most things you're likely to select during your turn, and the advisor keeps coming up with those buttons / selections until you actually start the script.
    Not used mods before? Looking for something small and fun?!
    Download the:

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