Results 1 to 12 of 12

Thread: [Guide] ‘restrict_clickable_area’ Command

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default [Guide] ‘restrict_clickable_area’ Command

    Identifier: restrict_clickable_area
    Parameters: [allowed regions(by name or id)]
    Description: Enable/disable(with no parameters) clickable area restriction
    Sample use: restrict_clickable_area York_Province London_Province
    Class: RESTRICT_CLICKABLE_AREA
    Implemented: Yes
    Author: Grig

    For this to work you need to first understand that you will be restricting you playability to a region, i.e. the region you specify is the only region you play in, all other regions are restricted!

    By reading the docudemon explanation one would understand that there is a way to easily enable/disable the clickable area easily – well sorry folks, yet again CA prove they like the more complicated choice when an easier (more obvious) choice such as enable/disable.. So now we understand the description above in not entirely accurate, you are choosing a playable region thus restricting all other regions from play.

    How this will work in reverse (restricting selected regions from play) is the complicated part. What you need to do is specify all regions you want to keep playable - leaving the desired unplayable regions out of the script command. So you will have one line of code with a lot of region identifiers.
    PROBLEM: majority of modders use notepad – for this DO NOT USE NOTEPAD, use notepad++ or a spreadsheet program.
    The reason is notepad supports limited characters per line before the text is ‘wrapped’ to the next line. If the engine reads the next line it will CTD as the line is not recognized as a command option (as it is usually a part of a region i.d.).
    You cannot use notepad simple, you cant even try to add two lines of restrict_clickable_area with half the regions on the first line and the rest on the second line – because the engine will read the first set and then switch to the second set, in play only the second set of regions will be accessible.



    USES:

    I used this script in Divide and Conquer Submod for TATW – to restrict player from entering Mordor regions after Barad Dur is destroyed. And it works as intended. The smallest issue is you cannot simply select the characters that were already in these regions (or the settlements that may be in your control).
    To select them you must go through the Army list scroll (or the settlement List scroll), or filter through to them using the select next/previous buttons.

    The way I scripted a fix for this in DaC is to force the settlements control over to slave faction, nothing much else can be done about the armies in there unless they have a general and we know his name.. so it is up to the player to know how to move him out of the restricted area…

  2. #2
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Guide to ‘restrict_clickable_area’ Command

    Interesting. Surprised this fell to the bottom of Page 2 with no posts, guess the workshop has ceased to cater to cool discoveries or topics and serves more as a simple question airing area; a shame. A good find, some questions:

    When it says 'clickable' area, does that mean you can move the camera over the area, and just not click in it?

    Have you tried the alternate route of restricting it to a small area? If so, have you experimented at all with the restriction commands pertaining to the camera?

  3. #3

    Default Re: Guide to ‘restrict_clickable_area’ Command

    yes you can make the camera move over the regions but noone including ai will be able to move into these regions.. i have been working a lot on the ai this past 3 months in ways that have never been played with before and the best things i have come up with all involve 'clickable' things - like the alliances mod i made..

    there is also a fe other good ones;
    battle_restrict_clickable_area
    Spoiler Alert, click show to read: 


    Identifier: battle_restrict_clickable_area
    Parameters: left, top, right, bottom or no parameters to clear all regions
    Description: Restricts world region in which player can click
    Sample use: battle_restrict_clickable_area 1,2,3,4
    Class: BATTLE_RESTRICT_CLICKABLE_AREA


    restrict_clickable_rect;
    Spoiler Alert, click show to read: 

    Identifier: restrict_clickable_rect
    Parameters: [min_x min_y max_x max_y]
    Description: Adds new rectangle to clickable area restriction, or clears rectangular clickable area restriction if no parameters specified
    Sample use: restrict_clickable_rect 10 15 80 100
    Class: RESTRICT_CLICKABLE_RECT

    so that basically resricts any type of area... like a single settlement...


    and about the camera - i have tried this and the radar restictions BUT they are a bit buggy.. they usuall cause extreme strat map lag and a few times the camera gets stuck and clicking the radar is the only way to get away..

    these are the cammands;
    Spoiler Alert, click show to read: 

    Identifier: restrict_strat_camera
    Parameters: [min_x min_y max_x max_y]
    Description: Enable/disable(with no parameters) start camera restriction
    Sample use: restrict_strat_camera 10 15 80 100
    Class: RESTRICT_STRAT_CAMERA

    Spoiler Alert, click show to read: 

    Identifier: restrict_strat_radar
    Parameters: [true/false]
    Description: Enable/disable start radar restriction
    Sample use: restrict_strat_radar false
    Class: RESTRICT_STRAT_RADAR

  4. #4
    Opifex
    Join Date
    Feb 2005
    Location
    New York, USA
    Posts
    15,154

    Default Re: Guide to ‘restrict_clickable_area’ Command

    Whoa.... you can use this command to replicate the ETW feature where you cannot click on a province that isn't yours, unless you're at war or have a treaty with them!


    "If ye love wealth greater than liberty,
    the tranquility of servitude greater than
    the animating contest for freedom, go
    home from us in peace. We seek not
    your counsel, nor your arms. Crouch
    down and lick the hand that feeds you,
    and may posterity forget that ye were
    our countrymen."
    -Samuel Adams

  5. #5

    Default Re: Guide to ‘restrict_clickable_area’ Command

    yes indeed - thus the reason i researched into M2TW after playing ETW LOLOLOLOL

    once i get the script complete it will be an insanely massive amount of code and i really hope no one claims it before i get it finished because I'll cry..

  6. #6
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Guide to ‘restrict_clickable_area’ Command

    Quote Originally Posted by Archaon View Post
    yes indeed - thus the reason i researched into M2TW after playing ETW LOLOLOLOL

    once i get the script complete it will be an insanely massive amount of code and i really hope no one claims it before i get it finished because I'll cry..
    I don't think anyone could 'claim it', if by that you mean 'beat you to the punch'. After all we all have different maps, so unless we're just talking script structure there would still be a massive amount of changes needed to adapt it to other mods.

  7. #7

    Default Re: Guide to ‘restrict_clickable_area’ Command

    Ok it is quite impossible to make this work for all regions for all factions.
    Here’s why;
    Lets just say the regions themselves would need to be included/excluded by either if one is on the scripted list or if 2 are or if 3 are ect ect then all others are excluded.
    So there are 8,000,000 interactions based on capped 200 regions.

    Then we take into account the script will be turned on/off based on if at war or not. That’s 2 more conditionals

    Then we take into account there are 31 factions that will need the diplomacy test. 62 conditionals

    Then we need to account for if faction1 controls region1, or if faction1 controls region1 and region2. That’s another 8,000,000 interactions, repeat for each 31 factions. 248,000,000

    So far for all regions, all factions, and at war or not;

    [ [2 x 31] x 8,000,000] x 248,000,000 = 123,008,000,000,000,000 EIGHTEEN DIGITS!

    That is how many conditionals are needed NOT LINES OF CODE.

    If this is going to be used in the ETW fashion and scope, it wont be scripted by yours truly.. however it is in my skill and free time to script it for approx 5 settlements absolute maximum..


    EDIT:
    I think I'll make a tutorial based on one settlement/region or area in rect and show how that code will look, then I'll go on to what parts of the code will need to be replicated, and why, but not acutlly supply the code..

    Anyone know a way in VB to replicate a script with these variables???

    Come back to me after I update the OP with the code

  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: Guide to ‘restrict_clickable_area’ Command











  9. #9

    Default Re: Guide to ‘restrict_clickable_area’ Command

    believe it or not i have tried and failed to use that tool - IMO that is only good for your basic money script where only the faction name or amount is modified..
    The tool will need to be modified with a few more options before it will be useful for any moderate complicated scripts...

  10. #10

    Default Re: [Guide] ‘restrict_clickable_area’ Command

    I have come across a problem..
    When you restrict to playable regions, the region list specified needs to include to OCEAN region. BUT I CANNOT find the sea regions internal name!
    I tried;

    Sea
    sea
    the_sea
    The_Sea
    the sea
    The Sea
    “the sea”
    “The Sea”

    None work!

  11. #11
    alhoon's Avatar Comes Rei Militaris
    Join Date
    Apr 2008
    Location
    Chania, Greece
    Posts
    24,233

    Default Re: [Guide] ‘restrict_clickable_area’ Command

    To see if I get this right:

    Not even the AI will be able to use the regions out of the restricted region part? Like you make Rome unclickable and NONE, including the Pope and priests and diplomats and all could move around there?

    Also you have found no way to add/remove regions to the restricted part after you enable it? You have to do it all over again?
    alhoon is not a member of the infamous Hoons: a (fictional) nazi-sympathizer KKK clan. Of course, no Hoon would openly admit affiliation to the uninitiated.
    "Angry Uncle Gordon" describes me well.
    _______________________________________________________
    Beta-tester for Darthmod Empire, the default modification for Empire Total War that does not ask for your money behind patreon.
    Developer of Causa Belli submod for Darthmod, headed by Hammeredalways and a ton of other people.
    Developer of LtC: Random maps submod for Lands to Conquer (that brings a multitude of random maps and other features).

  12. #12

    Default Re: [Guide] ‘restrict_clickable_area’ Command

    The code is far too long to consider..
    So short answer no, not possible to add, remove.

    Capabilities are, set the playable area to all regions minus the one/s you want to be inaccessible.
    If you want the inaccessible areas to change, disable the command altogether, and set the new playable area to all regions minus the one/s you now want to be inaccessible different form the first set.

    This works for me coz I only want to make Mordor (TATW) inaccessible after Sauron is defeated. But again, I cant set the ‘Sea’ region to playable so I am not able to use naval units after the command is executed..
    I should also mention that Naval AI units have no issues moving around the sea when the command executes, But I have seen all AI armies (land strategy units) 100% permanently inactive after they are ‘stuck in’ none playable areas…
    Good thing is they all belong to the slave faction so far..
    And another good thing is I can select mine through the army list scroll and move him into a playable region, but they cannot move into the unplayble areas

    There are a few cons involved when using this command, I don’t deny it, but with more people testing its limits and finding better uses for it we will eventually make a proper use for it!

Posting Permissions

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