Results 1 to 17 of 17

Thread: How to lock unit from entering an area until event?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    BM309K58SMERCH's Avatar Centenarius
    Join Date
    Feb 2012
    Location
    Gensokyo
    Posts
    879

    Default How to lock unit from entering an area until event?


    I know there has been a thread about it, but I can't seem to find it.
    Is there any way you can teleport/move units, characters, named characters across areas? Something like Empires: TW (but it doesn't have to be on a seperate map as it is impossible).


    EDIT: Nevermind. I found it here: http://www.twcenter.net/forums/showt...light=Teleport
    Below question is now my main question:

    Is it possible to lock entering certain areas of the map, but on land? In vanilla this was determined by oceans, and that only some units can go across after an event. But is it possible to do that same on land, after an event, and for all units?
    Last edited by BM309K58SMERCH; December 30, 2012 at 03:32 AM.

  2. #2
    lolIsuck's Avatar WE HAVE NO CAKE!
    Patrician Citizen Moderator Emeritus

    Join Date
    Dec 2010
    Location
    Heerlen, Limburg
    Posts
    13,660

    Default Re: How to lock unit from entering an area until event?

    I doubt it can be done by mapping, maybe with scripting.

  3. #3
    BM309K58SMERCH's Avatar Centenarius
    Join Date
    Feb 2012
    Location
    Gensokyo
    Posts
    879

    Default Re: How to lock unit from entering an area until event?

    So should I ask my question over there? Or it can be moved?

  4. #4
    lolIsuck's Avatar WE HAVE NO CAKE!
    Patrician Citizen Moderator Emeritus

    Join Date
    Dec 2010
    Location
    Heerlen, Limburg
    Posts
    13,660

    Default Re: How to lock unit from entering an area until event?

    Report your own post, put in the report you want it moved to text editing. That or ask a moderator (or the mighty Gigantus).

  5. #5
    irishron's Avatar Cura Palatii
    Moderator Emeritus

    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

    Default Re: How to lock unit from entering an area until event?

    Done.

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

    Default Re: How to lock unit from entering an area until event?

    It can be done with script but I suspect only for the player. You can prevent certain areas being clicked on, therefore unusable as move-to destinations.

  7. #7
    BM309K58SMERCH's Avatar Centenarius
    Join Date
    Feb 2012
    Location
    Gensokyo
    Posts
    879

    Default Re: How to lock unit from entering an area until event?

    Quote Originally Posted by Withwnar View Post
    You can prevent certain areas being clicked on, therefore unusable as move-to destinations.
    Is that the impassable ground type? But how to remove it after a certain event?
    Like say I freeze the AI of a faction trapped in a "horse shoe" shaped mountain, and the opening is impassable. After a certain event (in time, like the Mongols and the Timurids), the impassable area is now "passable", and you can move through that area. (And the AI is unfreezed)

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

    Default Re: How to lock unit from entering an area until event?

    No, nothing to do with mapping. That can't be changed dynamically within the game.

    It's a script command, either restrict_clickable_area or restrict_clickable_rect. But like I said, I doubt that it will prevent the AI from going there, just the player.

    However, if you have this horseshoe thing and you just need to block the entrance then you could use script to put a ship there (yes, on land) until you're ready to open it. You can use an invisible model texture so all you see is the ship's faction flag. It's a bit of messing around with spawns and respawns (they disappear during turn end) but it should work I think.

  9. #9
    BM309K58SMERCH's Avatar Centenarius
    Join Date
    Feb 2012
    Location
    Gensokyo
    Posts
    879

    Default Re: How to lock unit from entering an area until event?

    So I can (let's say) assign ships on land belonging to a "hidden" faction, and I can place them in a way that looks like a wooden wall? (with changing their model, too..) And after a certain event, the ships just despawn, and the AI of the faction beyond the ship wall gets unfreezed?
    But what is this?
    It's a bit of messing around with spawns and respawns (they disappear during turn end)
    Ships on land despawn after every turn? If that is so, then I will just learn a little more scripting, and I will get that over with. But before that, is my above suggestion valid?

  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: How to lock unit from entering an area until event?

    The advantage of ships on land is obviously that they don't move. Changing the model should not present a problem, it could be a bit more messy if you wanted to remove the flag as well, something to do with the way the banners are attached to the model. Freezing the faction will work and keeping them 'incommunicado' will prevent problems, in principle the way the Aztecs worked in vanilla.
    Withwnar might be mixing up a related problem that we came across when we tested the 'named forts': when setting a character to spawn via the 'PreFactionTurnStart FactionIsLocal' condition you may experience multiple spawnings of the same character.










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

    Default Re: How to lock unit from entering an area until event?

    Quote Originally Posted by Gigantus View Post
    Withwnar might be mixing up a related problem that we came across when we tested the 'named forts': when setting a character to spawn via the 'PreFactionTurnStart FactionIsLocal' condition you may experience multiple spawnings of the same character.
    I wasn't aware of that problem. No, I meant this...

    Quote Originally Posted by BM309K58SMERCH View Post
    Ships on land despawn after every turn?
    When you spawn a ship on land for the local faction it disappears at the end of that turn, so needs respawning each turn. I don't know about ships from other factions, how they behave. My guess is at each faction's turn end the game removes any ships on land from that faction. Just a guess, mind.

  12. #12
    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: How to lock unit from entering an area until event?

    Quote Originally Posted by Withwnar View Post
    When you spawn a ship on land for the local faction it disappears at the end of that turn, so needs respawning each turn. I don't know about ships from other factions, how they behave. My guess is at each faction's turn end the game removes any ships on land from that faction. Just a guess, mind.
    I wasn't aware of that problem, I will have to check that. Does this also apply to preplaced ships via descr_strat?

    Edit: I replaced the ship model for england with the volcano_rock.cas model - and ended up with a flag floating on the sea (the rock model is too small to be seen). Do I smell hard coded again?
    Just for giggles I then used the spy model: that had some weird graphic effects from a certain angle and distance, but the flag again was there. I am starting to think it has to do with the animations (descr_skeletons - strat_navy) and creating a new skeleton entry could be the way out, shouldn't be overly difficult as the model is immobile.

    Edit2: using the vanilla navy model and the diplomat skeleton had it's moments (ship floating in the air and bobbing to the steps), but the flag was back.
    It may come down to the definition in descr_characters (which are hardcoded, eg new ones can not be created) and an automatic allocation of 'mount point' for flags. Supporting evidence underneath:

    descr_character
    Code:
    type            admiral
    
    actions            moving_normal, quick_sail, blockade, disembark, exchange
    wage_base        50
    starting_action_points    80
    
    faction            england
    dictionary        2
    strat_model        no_flag_test
    descr_model_strat
    Code:
    type                no_flag_test
    skeleton            strat_diplomat
    indiv_range            40
    texture                england, models_strat/textures/ambasador_russia.tga
    model_flexi_m            models_strat/northern_ambassador.CAS, max
    shadow_model_flexi        models_strat/shadow_scroll.CAS, max
    Ladies and gentlemen, I give you the diplo navy - a ship model moving and looking like a diplomat with the navy flag embedded

    Last edited by Gigantus; January 01, 2013 at 03:28 AM.










  13. #13
    BM309K58SMERCH's Avatar Centenarius
    Join Date
    Feb 2012
    Location
    Gensokyo
    Posts
    879

    Default Re: How to lock unit from entering an area until event?

    Do you know any thread where the unit's strat banner has been successfully removed or atleast moved away (like hidden under the map)?
    Thank you very much for your help, and Withwnar.
    Last edited by BM309K58SMERCH; January 01, 2013 at 02:30 AM.

  14. #14
    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: How to lock unit from entering an area until event?

    Ships have a single (root) bone which will most likely be the 'anchor' for the flag. I do not know if a model without that root bone can be used, a simple test using a trading resource model (no bones) as the ship model would lay this to rest.
    Otherwise the skeleton's co-ordinates could be moved way below the surface I would assume (making it a custom skeleton).










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

    Default Re: How to lock unit from entering an area until event?

    I haven't tried land-ships from descr_strat, so couldn't say.

    Hah! Yeah, I have tried using trees without luck. Invisible (I assumed), just the banner. I know very little about modeling so I couldn't pursue it. I would love to get the tree working one day though.

  16. #16
    BM309K58SMERCH's Avatar Centenarius
    Join Date
    Feb 2012
    Location
    Gensokyo
    Posts
    879

    Default Re: How to lock unit from entering an area until event?

    It is okay if it is too hard or difficult to remove the unit's strat banners, I can live with it.
    But the ships on land problem sounds scary. I'll have to test it out and frighten myself see it for myself to judge it..

    By the way, I haven't entered the world of scripting yet, but what does it mean when the Faction is Local? Does that mean the faction is controlling the region which the script does it's work? Or the faction is in the vicinity of the location of the script?

  17. #17
    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: How to lock unit from entering an area until event?

    FactionIsLocal = the faction the player controls

    Please check the edit in my previous post regarding the model experiments.










Posting Permissions

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