Create account / Log in

Assign piece to a side when drawn

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Assign piece to a side when drawn

Postby plloyd1010 » June 20th, 2019, 2:01 am

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
User avatar
plloyd1010
 
Posts: 23
Joined: October 17th, 2013, 4:25 pm

Re: Assign piece to a side when drawn

Postby plloyd1010 » June 21st, 2019, 3:14 am

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.
User avatar
plloyd1010
 
Posts: 23
Joined: October 17th, 2013, 4:25 pm

Re: Assign piece to a side when drawn

Postby kerkael » June 23rd, 2019, 7:50 pm

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.
kerkael
 
Posts: 153
Joined: December 1st, 2017, 3:03 pm

Re: Assign piece to a side when drawn

Postby plloyd1010 » June 23rd, 2019, 9:19 pm

No, that never occurred to me. I'll give it a shot.
User avatar
plloyd1010
 
Posts: 23
Joined: October 17th, 2013, 4:25 pm

Re: Assign piece to a side when drawn

Postby plloyd1010 » June 26th, 2019, 6:01 pm

I've tried working with the $PlayerSide$ variable. Here is where am. The trait list for an exemplary infantry platoon looks like this:
Infantry Platoon traits.png
Infantry Platoon traits.png (32.07 KiB) Viewed 3726 times


The dynamic property to assign it to a side looks like this:
AssignedSide properties.png
AssignedSide properties.png (21.08 KiB) Viewed 3726 times


That OwningSide prototype is just to trigger actions:
OwningSide Proto traits.png
OwningSide Proto traits.png (18.64 KiB) Viewed 3726 times


to be continued...
User avatar
plloyd1010
 
Posts: 23
Joined: October 17th, 2013, 4:25 pm

Re: Assign piece to a side when drawn

Postby plloyd1010 » June 26th, 2019, 6:04 pm

The trigger action trait for assigning a unit drawn to side 1 looks like this:
Trigger Action   - Assign to Side 1 properties.png
Trigger Action - Assign to Side 1 properties.png (17.06 KiB) Viewed 3726 times


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?
User avatar
plloyd1010
 
Posts: 23
Joined: October 17th, 2013, 4:25 pm

Re: Assign piece to a side when drawn

Postby KEslinger » April 23rd, 2020, 6:39 pm

Did you ever figure this out ? I could use this in my module
Thanks!
KEslinger
 
Posts: 25
Joined: August 25th, 2017, 5:59 pm

Re: Assign piece to a side when drawn

Postby Cattlesquat » April 23rd, 2020, 7:37 pm

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
User avatar
Cattlesquat
 
Posts: 895
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA


Return to Module Design

Who is online

Users browsing this forum: No registered users and 4 guests