Create account / Log in

Correct syntax to assign current grid location value to a GP

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Correct syntax to assign current grid location value to a GP

Postby Djangtchoub » April 16th, 2021, 10:11 am

Hello everyone !
I'm trying to send units in another unit location so I need to assign the current location of the unit to a global property.
but in the set Global Property trait, I cannot find the correct syntax to do that
set value directly, I try : $currentLocation$, $gridLocation$
But that does not work.
Djangtchoub
 
Posts: 29
Joined: April 26th, 2019, 7:32 am
Location: BRIVE - FRANCE

Re: Correct syntax to assign current grid location value to

Postby jrwatts » April 16th, 2021, 10:39 am

In what way does it not work? I think $currentLocation$ should be correct...are you trying to store the location from a zone containing a square or hex grid? If so, you may need to change the Location Format field in the Zone's properties to $gridLocation$, instead of the default of $name$.
jrwatts
 
Posts: 304
Joined: April 29th, 2020, 10:30 pm

Re: Correct syntax to assign current grid location value to

Postby Djangtchoub » April 16th, 2021, 11:55 am

Thank you for your answer : when i try a report action trait to see what happened, I have the sentence:
"Unit is in gridLocation" or whatever syntax I use ("Unit is in currentLocation") even though I set the Property as numeric.

For the grid, the location format field is already gridLocation, for some specific Hexes I've changed the field zone to "$gridLocation$ ($name$)
Djangtchoub
 
Posts: 29
Joined: April 26th, 2019, 7:32 am
Location: BRIVE - FRANCE

Re: Correct syntax to assign current grid location value to

Postby Djangtchoub » April 16th, 2021, 11:57 am

Everything works if I set a Global Property zone for the Hex with the value of the grid
Since, I can only disband TF in anchorage, I can do this, I just have around 40 Hexes to define
Djangtchoub
 
Posts: 29
Joined: April 26th, 2019, 7:32 am
Location: BRIVE - FRANCE

Re: Correct syntax to assign current grid location value to

Postby barbanera » April 16th, 2021, 8:59 pm

Try $LocationName$
barbanera
 
Posts: 502
Joined: January 12th, 2012, 2:27 pm

Re: Correct syntax to assign current grid location value to

Postby Djangtchoub » April 18th, 2021, 8:41 am

It works incompletly because for numbers under 1000, the first 0 is deleted and my unit cannot be sent there.
For numbers above 1000 it works well.

My solution is :
- a Global Property Zone named : HexLocation
- a Global Property named: TFLocation / numeric
- a trait for my Task Force counter : Set Global property that sets the TFLocation to HexLocation with the syntax : "$HexLocation$"
Djangtchoub
 
Posts: 29
Joined: April 26th, 2019, 7:32 am
Location: BRIVE - FRANCE


Return to Module Design

Who is online

Users browsing this forum: No registered users and 7 guests