# I need some help

**URL:** <https://forum.vassalengine.org/t/i-need-some-help/90230>\
**Category:** Module Design\
**Created:** [June 24, 2026, 4:48pm UTC](https://forum.vassalengine.org/t/i-need-some-help/90230 "2026-06-24T16:48:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![awaxy](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@awaxy](https://forum.vassalengine.org/u/awaxy)\
**Post date:** [June 24, 2026, 4:48pm UTC](https://forum.vassalengine.org/t/i-need-some-help/90230/1 "2026-06-24T16:48:55Z")

</div>

I have a 4x space exploration game, and I have a deck of planets that are in ascending numerical order. Can someone please help me program vassal to number each planet, as they are drawn, fetch a correspondingly numbered unit, and make a menu command to send the the unit back to its homeworld.

I’ve been working on this forever and I’m having so much trouble.

---

<div class="post-metadata">

**Author:** ![akulkis00](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/akulkis00/32/11366_2.png) [@akulkis00](https://forum.vassalengine.org/u/akulkis00)\
**Post date:** [June 29, 2026, 3:24am UTC](https://forum.vassalengine.org/t/i-need-some-help/90230/2 "2026-06-29T03:24:44Z")

</div>

What code have you written so far?

---

<div class="post-metadata">

**Author:** ![cholmcc](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/cholmcc/32/8319_2.png) [@cholmcc](https://forum.vassalengine.org/u/cholmcc)\
**Post date:** [June 29, 2026, 7:04am UTC](https://forum.vassalengine.org/t/i-need-some-help/90230/3 "2026-06-29T07:04:24Z")

</div>

> [@akulkis00](#):
>
> What code have you written so far?

Perhaps, even better, if you could post a link to your module?

> [@awaxy](#):
>
> Can someone please help me program vassal to number each planet, as they are drawn, fetch a correspondingly numbered unit, and make a menu command to send the the unit back to its homeworld.

I think what you need is similar to what I did in [Littoral Commander: Indo-Pacific](https://vassalengine.org/library/projects/Littoral_Commander_Indo-Pacific) (version `2.0.0-beta`). There, when a card is placed in a hand (`Key command when piece ends movement on this map` - see [Map Window](https://vassalengine.org/doc/latest/ReferenceManual/Map.html#top)), a corresponding piece is placed on top of it ( [Place Marker](https://vassalengine.org/doc/latest/ReferenceManual/Marker.html#top)). The piece can then be placed on the map. The cards have counters on them to keep track of “Hit points”. If that goes to zero, then both the card and the piece are removed from play. This is accomplished via [Attachment](https://vassalengine.org/doc/latest/ReferenceManual/Attachment.html#top) trait. The card can send commands to the piece, and vice versa.

Yours,  
_Christian_

---

<div class="post-metadata">

**Author:** ![awaxy](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@awaxy](https://forum.vassalengine.org/u/awaxy)\
**Post date:** [June 30, 2026, 1:04am UTC](https://forum.vassalengine.org/t/i-need-some-help/90230/4 "2026-06-30T01:04:52Z")

</div>

Thanks so much for the reply. I don’t really know what I’m doing here but this is what I’ve been trying. Please help

My planet counter has:

Triggeraction =\>FetchUnit { CurrentZone == “PlayArea” }

Place Marker - FetchUnit

Prototype: PlanetCounter Which includes

Dynamic Property - PlanetNumber == SetNumber ($PlanetCounter$)

TriggerAction PlanetPlaced (CurrentZone == “PlayArea” && OldZone != “MainMap”)

TriggerAction PlanetPlaced =\> SetNumber

Global Key Command - - IncrementGlobal

my marker has

Keycommand FetchUnit

Menu command SendHome

Set Dynamic properties in marker: Homeworld $PlanetNumber$

Send to Location - SendHome (property match PlanetNumber && UnitNumber)

---

<div class="post-metadata">

**Author:** ![cholmcc](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/cholmcc/32/8319_2.png) [@cholmcc](https://forum.vassalengine.org/u/cholmcc)\
**Post date:** [June 30, 2026, 9:16am UTC](https://forum.vassalengine.org/t/i-need-some-help/90230/5 "2026-06-30T09:16:06Z")

</div>

> [@awaxy](#):
>
> My planet counter has: …

I think you need to post a copy of your module to really make sense of what you have and what it is you are trying to do.

Please also outline, in terms of the module, what you want to achieve. Which piece is placed where, and which other piece do you expect to appear, be moved, or similar.

It seems to me, that what you want is

1. You place a `Planet` piece in the zone `PlayArea` _and_ its previous location was _not_ the zone `MainMap`.
2. You then want to assign it a number (where does that number come from? A `Global/Map Property`? How is that number incremented?)
3. When the `Planet` piece is put in the `PlayArea` you want to place - using [Place Marker](https://vassalengine.org/doc/latest/ReferenceManual/Marker.html#top) trait - a `Marker` piece on that planet piece.
4. You want the `Marker` piece to get the number of the planet, just assigned to the `Planet` piece.
5. You want the `Marker` to have a [Send to Location](https://vassalengine.org/doc/latest/ReferenceManual/SendToLocation.html#top) trait that will send it “home” (what ever that means).

For point 2 above, you want to set _Key Command to apply to all units ending movement on this map_ on the [Map Window](https://vassalengine.org/doc/latest/ReferenceManual/Map.html#top) that contains the [Zone](https://vassalengine.org/doc/latest/ReferenceManual/ZonedGrid.html#Zone) `PlayArea`. Let’s say the command is set to the named command `endOnMap`.

Then, you add the following traits to you `Planet` pieces

- [Trigger Action](https://vassalengine.org/doc/latest/ReferenceManual/TriggerAction.html#top)
  - Key: `endOnMap`
  - Property: `{CurrentZone == "PlayArea" && OldZone != "MainMap"}` (check that logic, in particular the `OldZone` comparison - is there a zone called `MainMap`?)
  - Action keys: `[incrementPlanetCounter, grabPlanetCounter, placeMarker]`

- [Set Global Property](https://vassalengine.org/doc/latest/ReferenceManual/SetGlobalProperty.html#top)
  - Name: `PlanetCounter`
  - Commands:
    - Key: `incrementPlanetCounter`
    - Type: `Direct`
    - Expression: `{PlanetCounter+1}`

- [Dynamic Property](https://vassalengine.org/doc/latest/ReferenceManual/DynamicProperty.html#top)
  - Name: `PlanetNumber`
  - Commands:
    - Key: `grabPlanetCounter`
    - Type: `Direct`
    - Expression: `{PlanetCounter}`

- [Place Marker](https://vassalengine.org/doc/latest/ReferenceManual/Marker.html#top)
  - Key: `placeMarker`
  - Select: `Marker` (adjust for actual marker piece path)
  - Set Dynamic Properties in marker
    - Name: `HomePlanet`
    - Expression: `{$PlanetNumber$}` (`$...$` referes to values in source piece)

In your `Marker` piece, define traits

- [Dynamic Property](https://vassalengine.org/doc/latest/ReferenceManual/DynamicProperty.html#top)
  - Name: `HomePlanet` (do _not_ make this `PlanetNumber` - may cause problems for the below _Send to Location_ trait).

- [Send to Location](https://vassalengine.org/doc/latest/ReferenceManual/SendToLocation.html#top)
  - Menu: `Go Home`
  - Destination: `Any counter, selected by properties` or `Nearest counter, selected by properties`
  - Expression: `{PlanetNumber == $HomePlanet$}` (`$...$` referes to values in source piece)

If you want to be able to send commands from the planet to the marker, or vice versa, you can create [Attachment](https://vassalengine.org/doc/latest/ReferenceManual/Attachment.html#top) relation between the two. This is quite powerful, because the pieces are coupled very tightly and can efficiently send commands between them.

Note, in a sense, you do not need the global property `PlanetCounter`. Instead, you can use the planets [`UniqueID`](https://vassalengine.org/doc/latest/ReferenceManual/Properties.html#uniqueId) property, and the placed markers [`ParentID`](https://vassalengine.org/doc/latest/ReferenceManual/Properties.html#parentId) property. And then, in your [Send to Location](https://vassalengine.org/doc/latest/ReferenceManual/SendToLocation.html#top) the expression can simply be  
`{UniqueID=="$ParentID$"}`  
as outlined in the [Place Marker](https://vassalengine.org/doc/latest/ReferenceManual/Marker.html#top) documentation. E.g.,

In your `Planet` pieces

- [Trigger Action](https://vassalengine.org/doc/latest/ReferenceManual/TriggerAction.html#top)
  - Key: `endOnMap`
  - Property: `{CurrentZone == "PlayArea" && OldZone != "MainMap"}` (check that logic, in particular the `OldZone` comparison - is there a zone called `MainMap`?)
  - Action keys: `[placeMarker]`

- [Place Marker](https://vassalengine.org/doc/latest/ReferenceManual/Marker.html#top)
  - Key: `placeMarker`
  - Select: `Marker` (adjust for actual marker piece path)

In your `Marker` piece, define traits

- [Send to Location](https://vassalengine.org/doc/latest/ReferenceManual/SendToLocation.html#top)
  - Menu: `Go Home`
  - Destination: `Any counter, selected by properties` or `Nearest counter, selected by properties`
  - Expression: `{UniqueID == "$ParentID"}` (`$...$` referes to values in source piece)

Pretty simple 😃

Yours,  
_Christian_

---

<div class="post-metadata">

**Author:** ![awaxy](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@awaxy](https://forum.vassalengine.org/u/awaxy)\
**Post date:** [July 1, 2026, 12:12am UTC](https://forum.vassalengine.org/t/i-need-some-help/90230/6 "2026-07-01T00:12:34Z")

</div>

I pruned the file to cut out less relevant parts [https://drive.google.com/file/d/1YGEpolalxFBXQJmX0tIBE3Tp5Gop7d5U/view?usp=drive\_link](https://drive.google.com/file/d/1YGEpolalxFBXQJmX0tIBE3Tp5Gop7d5U/view?usp=drive_link)

My plan was to tag the planet when it is placed on the main map with each newly placed planet ascending order. Then numbers that have a unit associated with it will place that marker with a send to location (their numbered Homeworld). and that marker would have a menu command to send it to it’s homeworld.

There is a MainMap zone with a global property for increment planet counter.

I’m sorry that I’m kind of lost. I really appreciate your help, but I’ll try again.

---

<div class="post-metadata">

**Author:** ![cholmcc](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/cholmcc/32/8319_2.png) [@cholmcc](https://forum.vassalengine.org/u/cholmcc)\
**Post date:** [July 1, 2026, 9:12am UTC](https://forum.vassalengine.org/t/i-need-some-help/90230/7 "2026-07-01T09:12:21Z")

</div>

> [@awaxy](#):
>
> I pruned the file to cut out less relevant parts [https://drive.google.com/file/d/1YGEpolalxFBXQJmX0tIBE3Tp5Gop7d5U/view?usp=drive\_link](https://drive.google.com/file/d/1YGEpolalxFBXQJmX0tIBE3Tp5Gop7d5U/view?usp=drive_link)

You need to share this with others - currently access is denied - see [here](https://support.google.com/drive/answer/2494822?hl=en&co=GENIE.Platform%3DDesktop).

> [@awaxy](#):
>
> My plan was to tag the planet when it is placed on the main map with each newly placed planet ascending order. Then numbers that have a unit associated with it will place that marker with a send to location (their numbered Homeworld). and that marker would have a menu command to send it to it’s homeworld.

Do I understand you use case correctly:

- There are pieces on the map which has a _specific_ home planet, identified by some unique (serial) number.
- You place a planet on the map, and that planet gets a unique (serial) number assigned to it automatically.
- All the pieces that has the same unique home planet identifier are sent to the newly placed planet.

If so, you can use some of the above logic:

You want to set _Key Command to apply to all units ending movement on this map_ on the [Map Window](https://vassalengine.org/doc/latest/ReferenceManual/Map.html#top) that contains the [Zone](https://vassalengine.org/doc/latest/ReferenceManual/ZonedGrid.html#Zone) `PlayArea` . Let’s say the command is set to the named command `endOnMap` .

Then, you add the following traits to you `Planet` pieces

- [Trigger Action](https://vassalengine.org/doc/latest/ReferenceManual/TriggerAction.html#top)
  - Key: `endOnMap`
  - Property: `{CurrentZone == "PlayArea" && OldZone != "MainMap"}` (check that logic, in particular the `OldZone` comparison - is there a zone called `MainMap`?)
  - Action keys: `[incrementPlanetCounter, grabPlanetCounter, callBackHome]`

- [Set Global Property](https://vassalengine.org/doc/latest/ReferenceManual/SetGlobalProperty.html#top)
  - Name: `PlanetCounter`
  - Commands:
    - Key: `incrementPlanetCounter`
    - Type: `Direct`
    - Expression: `{PlanetCounter+1}`

- [Dynamic Property](https://vassalengine.org/doc/latest/ReferenceManual/DynamicProperty.html#top)
  - Name: `PlanetNumber`
  - Commands:
    - Key: `grabPlanetCounter`
    - Type: `Direct`
    - Expression: `{PlanetCounter}`

- [Global Key Command](https://vassalengine.org/doc/latest/ReferenceManual/GlobalKeyCommand.html#top)
  - Key: `callBackHome`
  - Global Key: `goHome`
  - Fast select:
    - By property: `true`
      - Property: `HomePlanet`
      - Value: `$PlanetNumber$`
      - Comparison: `Equal`

    - By Location: `true`
      - Select By: `Specific Map` (May be you want a different location select)
      - Value: `{"Main Map"}` (Check this is the correct name)

  - Restrict range: `false` (you can set this to `true`, but then you should disable the above `By Location`, and you need to think about the appropriate range for the command).

What happens is

1. You place a planet piece on the map.
2. This triggers that the command `endOnMap` is sent to the planet piece
3. Because the planet is in the zone `PlayArea`, the `endOnMap` command executes 3 other commands:
  1. Increment the global planet counter
  2. Grab the current global planet counter as the value for the planets ID (`PlanetNumber`)
  3. Issue the command `goHome` to all pieces on the map that has the property `HomePlanet` and for which the `HomePlanet` value is equal to the planets `PlanetNumber` property value.

In your `Marker` piece, define traits

- [Marker](https://vassalengine.org/doc/latest/ReferenceManual/PropertyMarker.html#top) (or perhaps [Dynamic Property](https://vassalengine.org/doc/latest/ReferenceManual/DynamicProperty.html#top))
  - Name: `HomePlanet` (do _not_ make this `PlanetNumber` - may cause problems for the below _Send to Location_ trait).
  - Value: `...` (the number the of the planet to send to)

- [Send to Location](https://vassalengine.org/doc/latest/ReferenceManual/SendToLocation.html#top)
  - Menu: `Go Home`
  - Key: `goHome`
  - Destination: `Any counter, selected by properties` or `Nearest counter, selected by properties`
  - Expression: `{PlanetNumber == $HomePlanet$}` (`$...$` referes to values in source piece)

Hopefully these ideas can help you along - if not exactly what you need, then perhaps serve as an inspiration.

Also, remember to flag the post, including your own - if applicable, that solve your problem as solution. That really help others find solutions to their challenges. Only you @awaxy, as the OP can do that. Thanks.

Yours,  
_Christian_

---

<div class="post-metadata">

**Author:** ![awaxy](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@awaxy](https://forum.vassalengine.org/u/awaxy)\
**Post date:** [July 1, 2026, 7:23pm UTC](https://forum.vassalengine.org/t/i-need-some-help/90230/8 "2026-07-01T19:23:56Z")

</div>

Ok I tried this, and you explain it really well, but it still doesn’t work in my module.

I know this is a big request, but could you make an example and send it to me?

---

<div class="post-metadata">

**Author:** ![cholmcc](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/cholmcc/32/8319_2.png) [@cholmcc](https://forum.vassalengine.org/u/cholmcc)\
**Post date:** [July 1, 2026, 8:47pm UTC](https://forum.vassalengine.org/t/i-need-some-help/90230/9 "2026-07-01T20:47:51Z")

</div>

> [@awaxy](#):
>
> I know this is a big request, but could you make an example and send it to me?

Better if you share your module and give _precise_ instructions on what a player should do and what you would like to see happen.

Yours,  
_Christian_
