Results 1 to 6 of 6

Thread: Hidden zones management - is it availible in scritps?

  1. #1
    Join Date
    Jan 2018
    Location
    Russia
    Posts
    10

    Question Hidden zones management - is it availible in scritps?

    Can't find any way to create or get existing hidden zone instance. Is there a way to do that in scripts?

  2. #2
    Join Date
    Oct 2017
    Location
    Australia
    Posts
    132
    Hi Joker,

    You can go through the save file and get the GUID of an existing Hiddenzone if you need. Search for fogcolor
    Regards
    Abarden

  3. #3
    In the getAllObjects() table look for stuff with a 'Fog' tag.

    Code:
    function onLoad()
        for _,obj in ipairs(getAllObjects()) do
            if obj.tag == 'Fog' then
                -- obj is a hidden zone, do stuff with it
            end
        end
    end

  4. #4
    As far as I know you can not create or destroy hidden zones. Though you can use scripts to place them in bags which is super strange.. and I think a bug.

    I use manipulated hidden zones in some of my mods. Like for example in a card game that has a sidebaord between rounds.. what I do is have a same 0.5,0.5,0.5 cube for the hidden zone hidden inside / under the table. The script can use the hidden zone GUID to move and scale it.. allowing you to place it anywhere and any size. Then shrink it back down. This gives the player the illusion of the zone being created and destroyed. You can also do the same thing for scripting zones.

    So at the same time I move the hiddenzone I also move a scripting zone to encompas the volume of that hidden zone. Now, I can use the scripting zone and all the functions associated with scripting zones but as it is the same volume as the hidden zone, it is kinda turning a hidden zone into a scripting zone.
    My Boardgame uTube chan - Tragic's Table Top
    BGG Guild of BoardGame uTubers - Tube Tables

  5. #5
    Join Date
    Jan 2018
    Location
    Russia
    Posts
    10
    oh, thank you! forgot that save file is simple json, and thanks for pointing, that one cant't add remove zones at will - will use placing under table (same as i done with set of dies when i was scripting "war zone" for enhanced edition of DLC tiny epic kingdoms)

  6. #6
    Join Date
    Jan 2018
    Location
    Russia
    Posts
    10
    I found that you actually can create and destroy hidden zones in script - following example creates two zones and removes one of them

    Code:
    fowWhite = { name = 'White', position = {8.77, 5.83, -15.86}, rotation = {0, 0, 0}, scale = {17.5, 11.5, 11.5}}
    fowRed = { name = 'Red', position = {-12.0, 5.83, -15.86}, rotation = {0, 0, 0}, scale = {17.5, 11.5, 11.5}}
    
    fowObjects = {}
    
    function onload()
        fowObjects[fowWhite.name] = spawnFow(fowWhite)
        fowObjects[fowRed.name] = spawnFow(fowRed)
    
        fowObjects[fowWhite.name].destruct()
    end
    
    function spawnFow(fowParams)
        return spawnObject({
            type = 'FogOfWarTrigger',
            position = fowParams.position,
            rotation = fowParams.rotation,
            scale = fowParams.scale,
            callback = 'setFowOwner',
            params = {player = fowParams.name}
        })
    end
    
    function setFowOwner(object, params)
        object.setValue(params.player)
    end

Similar Threads

  1. Hidden zones / objects
    By Singular Perpous in forum Suggestions
    Replies: 1
    Last Post: 01-20-2017, 01:34 PM
  2. Hidden Zones tool
    By Tiberius in forum General Discussion
    Replies: 2
    Last Post: 07-18-2016, 07:20 AM
  3. Buttons in Hidden Zones not hidden
    By Arcuate in forum Scripting
    Replies: 1
    Last Post: 03-08-2016, 01:52 PM
  4. Persist tag for Hidden Zones
    By kirby2u2 in forum Suggestions
    Replies: 0
    Last Post: 11-03-2015, 12:18 AM
  5. [SOLVED] Hidden Zones
    By Subangelis in forum General Discussion
    Replies: 1
    Last Post: 10-26-2015, 10:40 AM

Tags for this Thread

Posting Permissions

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