Assign piece to a side when drawn

Is there a way to assign a piece to a side when that piece is drawn? I’ve tried the Restrict Access trait, leaving the sides list blank, and the “Also Belongs too…” and “Prevent non-owning…” boxes checked.

I have Side 1, Side 2 and Solitaire. Is there something in the algorithm that doesn’t like spaces, or something like that? Some string handling thing? I am running out of ideas.

Peter

Is there perhaps a way to set a prototype in an equation? If so I may be able to solve the problem with a calculated property.

Did you try to use $PlayerSide$ as a variable in the Restrict Access List.
That would be weird, as each player would become the owner of the piece.
Instead, if you use a calculated expression or a random variable to define the owner from $PlayerSide$ once and for all, you fix it and make the piece belong to them only.

No, that never occurred to me. I’ll give it a shot.

I’ve tried working with the $PlayerSide$ variable. Here is where am. The trait list for an exemplary infantry platoon looks like this:
[attachment=2]Infantry Platoon traits.png[/attachment]

The dynamic property to assign it to a side looks like this:
[attachment=1]AssignedSide properties.png[/attachment]

That OwningSide prototype is just to trigger actions:
[attachment=0]OwningSide Proto traits.png[/attachment]

to be continued…

The trigger action trait for assigning a unit drawn to side 1 looks like this:
[attachment=0]Trigger Action - Assign to Side 1 properties.png[/attachment]

I don’t seem to be getting the action to trigger. If it is the Side isn’t being assigned. Does anyone have ideas as to why?

Did you ever figure this out ? I could use this in my module
Thanks!

Keep in mind that most pieces in wargames (like the piece shown in the example above) won’t need to be “owned” by one player or the other in the same way that cards in a hand are – since although only one player will “decide where to move them”, either player can actually drag the piece around (and needs to be able to).

So in order to create a piece that can be assigned to either side, or even flipped back and forth between sides, you can simply create a Dynamic Property of the piece that is “Side”, and at the appropriate time assign it to be one of your sides (e.g. “Allies”/“Axis”, or whatever). And then you could have a Layer property which shows different graphics depending on which Side is assigned (in the Layer definition check the box for “Follows Expression Value”, and in the expression box click the little expression builder button and put something like this: If(Side==“Allies”,1,2) so then it would use Layer 1 if an Allied unit and 2 if an Axis. You could of course do more sides and more layers, etc.

Alternatively, you could have a piece simply “Replace With Other” itself when it is assigned a side, placing a new marker on the board representing a piece of the designated side. And you could even have THAT piece able to later switch sides by "Replace With Other"ing itself to a different piece. The Paths of Glory module has an example of this kind of piece – the Trench markers are allowed to be “captured” if they are at Level 2 – so e.g. a Central Powers trench at level 2 can be captured, and replaces itself with an Allied Powers Level 1 trench. I think the prototypes are called something obvious like “Trench_CP” and “Trench_AP” if you want to take a look.

Brian