Results 1 to 12 of 12

Thread: A idea for a script.. how to do it?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default A idea for a script.. how to do it?

    I've been thinking of a script that could incoperate PSF so that they act sort of like minor settlemetns, aka if you have a charactor ending a turn in the fort, he'll be given a # of money. but how do we do that ? I checked traits and it seems there's nothing that directly give a fix amount of money. so I guess we have to utilize script ?

    Is their a condition monitor that can monitor a charactor ending his turn in a fort? I can't seem to find any right now...

    more over, once i have that considition, how do i do it so that it has a + money per charactor? I'd assume normal console command would only add a fix money no matter how many you have...
    1180, an unprecedented period of peace and prosperity in East Asia, it's technology and wealth is the envy of the world. But soon conflict will engulf the entire region with great consequences and lasting effects for centuries to come, not just for this region, but the entire known world, when one man, one people, unites.....

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: A idea for a script.. how to do it?

    Extremely involving and complex. You cannot test for a character being in a fort. You can only test if ANY character of a faction is on a certain spot or in a certain region (I_CharacterNearTile). Giving the money to a specific faction once the condition gets fulfilled is the easiest part (add_money, [faction] amount)










  3. #3
    KEA's Avatar Senator
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    1,104

    Default Re: A idea for a script.. how to do it?

    You could also place ressources under the forts so that merchants can generate income when sitting in the "minor settlement".

  4. #4
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: A idea for a script.. how to do it?

    Quote Originally Posted by KEA View Post
    You could also place ressources under the forts so that merchants can generate income when sitting in the "minor settlement".
    In that case I wonder if the OnResource condition would work for other character types. Ah, but then they'd make money no matter what resource they stood on.

    Another idea could be to use UngarrisonedFort: give the faction a swag of money and then take some away for each ungarrisoned fort. i.e. Instead of adding money for each garrisoned fort. But for that to work you would need to know how many forts the faction owns, to know how much to add in the first step. Plus "garrisoned" doesn't necessarily mean "general present" of course.

    Gigantus' suggestion is probably the only fail-safe way. A bunch of these...

    Code:
    if I_CharacterTypeNearTile milan named_character 0 101, 171
      add_money milan 500
    end_if
    ...but (as he said) there is no way to know how many generals are in this fort. If there are two then it will still only add 500, not 1000.
    Last edited by Withwnar; April 17, 2012 at 12:04 AM.

  5. #5
    KEA's Avatar Senator
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    1,104

    Default Re: A idea for a script.. how to do it?

    Quote Originally Posted by Withwnar View Post
    In that case I wonder if the OnResource condition would work for other character types.
    Interesting, never tried that out

    Ah, but then they'd make money no matter what resource they stood on.
    This would require IsRegionOneOf; and somewhat limiting the resources to PSFs.

  6. #6

    Default Re: A idea for a script.. how to do it?

    OnResource works also with generals
    Used it for my personal one ring destroy monitor for the TATW mod. Is tested and works:

    Code:
     
    ; Destroy ring
    monitor_event CharacterSelected CharacterIsLocal
    and HasAncType one_ring_type
    and OnResource
    and IsRegionOneOf 92
            e_select_character
            console_command remove_ancillary this one_ring
            set_event_counter one_ring_Faction 22
            terminate_monitor
    end_monitor
    In pseudo code:
    If the character is in the region with that vulcano on the resource I have placed on the map next to that vulvano and the player selects him, take the selected chareacter the ring away if he has it.
    You see the problem: No way to determine what kind of resource. If it is the only one in the region with the fort ...
    Last edited by Aramiteus; April 17, 2012 at 01:34 PM.

  7. #7
    RollingWave's Avatar Praepositus
    Join Date
    Feb 2005
    Location
    Taiwan
    Posts
    5,083

    Default Re: A idea for a script.. how to do it?

    Quote Originally Posted by Withwnar View Post
    In that case I wonder if the OnResource condition would work for other character types. Ah, but then they'd make money no matter what resource they stood on.

    Another idea could be to use UngarrisonedFort: give the faction a swag of money and then take some away for each ungarrisoned fort. i.e. Instead of adding money for each garrisoned fort. But for that to work you would need to know how many forts the faction owns, to know how much to add in the first step. Plus "garrisoned" doesn't necessarily mean "general present" of course.

    Gigantus' suggestion is probably the only fail-safe way. A bunch of these...

    Code:
    if I_CharacterTypeNearTile milan named_character 0 101, 171
      add_money milan 500
    end_if
    ...but (as he said) there is no way to know how many generals are in this fort. If there are two then it will still only add 500, not 1000.
    This is what I want.. though yeah that is going to be alot of work, you need to write as many condition as there is fort.
    1180, an unprecedented period of peace and prosperity in East Asia, it's technology and wealth is the envy of the world. But soon conflict will engulf the entire region with great consequences and lasting effects for centuries to come, not just for this region, but the entire known world, when one man, one people, unites.....

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: A idea for a script.. how to do it?

    So he doesn't have to stand on the resource like the merchants? If so, then I am not surprised that I have never seen that condition being used, usually every region has at least one resource.

    If this is not the case (the character has to stand on the resource) then it comes very handy if you use a resource without trading value (zero - to avoid attracting merchants) placed underneath a fort.










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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: A idea for a script.. how to do it?

    It should have the same effect, which means some care has to be taken not to place other resources on well traveled areas of the region in question.
    Resources used for display and trigger\event purposes only (like that elephant in the desert in TATW) can have an impassable tile on the 'action tile'.
    Last edited by Gigantus; April 18, 2012 at 12:05 AM.










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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: A idea for a script.. how to do it?

    Look at the bright side: you can wrap it all into a single monitor - thereby hardly affecting processor time. GrnEyedDvl's Script Replicator should help there.










Posting Permissions

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