Create account / Log in

Mark Unmoved for one side

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Mark Unmoved for one side

Postby Kiwi461 » February 8th, 2014, 7:49 pm

So I'm creating a module and was wondering if this is possible:

I would like to do one of two things ... either Have the 'moved' marker disappear for all models for a particular player when either a button is pressed or when the turn changes. Example:

Player 1 moves some pieces around during the movement phase of his turn.
Player 1 knows who moved (affects how much a unit can shoot) because the moved markers are there.
The turn counter now goes to Player 2 .... at this point if I hit the Mark Unmoved, all the markers are removed.
Player 2 moves some pieces around.
Player 2 shoots ... now some of the pieces that Player 1 didn't move are harder to hit, but with mark unmoved removing all markers, without an additional marker they would all look like they weren't moved.
Starting Turn 2, player 1 resets all of his "Moved pieces" but Player 2 still requires his markers to facilitate player 1's shooting

Now, not hitting the mark unmoved button until the end of the turn would only help player 2, because the 'unmoved' status would still carry over into turn 2.

I hope that makes sense ....
Kiwi461
 
Posts: 13
Joined: January 23rd, 2014, 6:02 pm

Re: Mark Unmoved for one side

Postby reddeblu » February 8th, 2014, 9:26 pm

It might be possible using the Marked When Moved trait. You can assign that trait a keyboard command for both player 1's pieces and player 2's pieces. You can then make two trigger actions which triggers the commands on each piece. This first triggers command would be applied to all pieces that move on the map, which is done in the map properties itself. The trigger should have a Moved!="true" Matching Property so that the piece is only marked as moved once when it moves.The second trigger should have a similar command, also triggering the Marked When Moved traits, but having a Matching Property of Moved=="true".

Now you could make a couple Global Key Commands on the module level, each one using the key command of each players second trigger. Then make a Multi Action Button containing these two Global Key Commands. Set the Matching Properties of each command to check for the player side associated with that command, like the first GKC would see if PlayerSide=="Player 1" in order to send player 1's key command to their second trigger.

Once done when ever any player clicks that button, it should unmark only their pieces. I hope that all makes sense, I'm not sure I was too coherent with the explanation. But I can make an example module if you'd like.

Thinking about it, you could probably ditch the first trigger altogether, I don't actually use Marked When Moved options much at all so I'm unsure. Be sure to prototype what ever it is you do though.
- Model: Custom Build
- Operating System: Windows XP
- CPU: 3GHz
- Memory: 2 GB
- Video Card: NVIDIA GeForce GTS 250
- Vassal version: 3.2.10
- Java: Version 7 Update 51
reddeblu
 
Posts: 112
Joined: March 25th, 2011, 3:24 am

Re: Mark Unmoved for one side

Postby Kiwi461 » February 9th, 2014, 12:29 am

an example module would be great. I haven't messed with multi-action or global key commands AT ALL! Most of what I've learned has been a lot of trial and error, looking at other modules, and reading these forums. I'll try it out and see what I can do in the meantime!
Kiwi461
 
Posts: 13
Joined: January 23rd, 2014, 6:02 pm

Re: Mark Unmoved for one side

Postby Kiwi461 » February 9th, 2014, 12:36 am

Also, the pieces involved aren't associated with a single player I don't think. The game is based on a tabletop miniature game. Players pick a nation to build their armies from, and players could potentially have the same armies thus using the same peices. Does this have an affect? Or will it only matter if Player 2 pulls those pieces?
Kiwi461
 
Posts: 13
Joined: January 23rd, 2014, 6:02 pm

Re: Mark Unmoved for one side

Postby reddeblu » February 9th, 2014, 12:41 am

I get what your saying, and it does complicate things a tad. Thankfully I've just made a module with a similar mechanic, so I'll make an example module for you to use and look at. :)
- Model: Custom Build
- Operating System: Windows XP
- CPU: 3GHz
- Memory: 2 GB
- Video Card: NVIDIA GeForce GTS 250
- Vassal version: 3.2.10
- Java: Version 7 Update 51
reddeblu
 
Posts: 112
Joined: March 25th, 2011, 3:24 am

Re: Mark Unmoved for one side

Postby reddeblu » February 9th, 2014, 1:33 am

Okay here it is, this is as basic as it gets.

Both player 1 and 2 can take pieces from the same place, and the example will recognize who owns which Piece. When the "Unmarked Moved Pieces" button is pressed, only the player who pressed it pieces will be unmarked.

Its a fairly simple system and probably a good place to start in getting into more advanced functions of vassal, hope it proves helpful! :D

Edit: The forum kinda buggered out on me trying to post this, was kind of strange. o.o
Attachments
Mark Moved Sharing Piece Example.vmod
(28.15 KiB) Downloaded 111 times
- Model: Custom Build
- Operating System: Windows XP
- CPU: 3GHz
- Memory: 2 GB
- Video Card: NVIDIA GeForce GTS 250
- Vassal version: 3.2.10
- Java: Version 7 Update 51
reddeblu
 
Posts: 112
Joined: March 25th, 2011, 3:24 am

Re: Mark Unmoved for one side

Postby Kiwi461 » February 9th, 2014, 2:17 am

Alright, let me attempt to wrap my head around this so I have a better understanding of what you've done:

Player 1 please "Gun Guy" and places it (if I have player trays as Map Windows, does it matter where I place it?) in his Map Window. This triggers the "Piece Sharing" property via the Setup Trigger, this triggers Owned 1, which sets the Dynamic Property to '1' for that guy. Placing "Gun Guy" also triggers setup within the "Movement Marker" trait. This changes placed from no to yes. This triggers "moving", which triggers Marked as Moved. In turn this provides the move marker.

Now, when I press the Undo Mark, it activates the Undo Mark trigger, this in turn activates Undo 1 and Undo 2, so then it looks to see who touched the button and then searches for pieces from that player's Set, as long as it's marked as moved and belongs to player 1 it'll be marked as moved.

So my next question. I have multi prototype definitions to add the mark as moved icon two different pieces. Pieces are different sizes and I wanted the icon to be in relatively the same location. Can I replace the "Marked when Moved" trait in the Movement Marking prototype with the prototype to put the marker where I want?
Kiwi461
 
Posts: 13
Joined: January 23rd, 2014, 6:02 pm

Re: Mark Unmoved for one side

Postby Kiwi461 » February 9th, 2014, 2:17 am

Alright, let me attempt to wrap my head around this so I have a better understanding of what you've done:

Player 1 please "Gun Guy" and places it (if I have player trays as Map Windows, does it matter where I place it?) in his Map Window. This triggers the "Piece Sharing" property via the Setup Trigger, this triggers Owned 1, which sets the Dynamic Property to '1' for that guy. Placing "Gun Guy" also triggers setup within the "Movement Marker" trait. This changes placed from no to yes. This triggers "moving", which triggers Marked as Moved. In turn this provides the move marker.

Now, when I press the Undo Mark, it activates the Undo Mark trigger, this in turn activates Undo 1 and Undo 2, so then it looks to see who touched the button and then searches for pieces from that player's Set, as long as it's marked as moved and belongs to player 1 it'll be marked as moved.

So my next question. I have multi prototype definitions to add the mark as moved icon two different pieces. Pieces are different sizes and I wanted the icon to be in relatively the same location. Can I replace the "Marked when Moved" trait in the Movement Marking prototype with the prototype to put the marker where I want?
Kiwi461
 
Posts: 13
Joined: January 23rd, 2014, 6:02 pm

Re: Mark Unmoved for one side

Postby reddeblu » February 9th, 2014, 2:37 am

You've pretty much got it down pat. :) For someone this new to vassal I'm impressed you figured it out so quickly.

Anyway, about your first question: "If I have player trays as Map Windows, does it matter where I place it?"

No, you can use any map, window, tray, or what not to place and hold the piece. BUT said window should have the Setup command sent to any piece which moves in said window. This can be set in the properties of every window.

As for your second question, you will likely want to make multiple prototype for each size piece you have. Maybe even name them Big Marker, Medium Marker, ect. There are a few ways of doing it, but the simplest is to simply copy the "Movement Marking" prototype and rename it to something more size fitting. Then change the offset location of the Mark when Moved trait in the new prototype, and put said new prototype on the pieces which need it.

That is a basic explanation though, you might be required to make and arrange quite a few prototypes, I kind of went prototype heavy for the heck of it. But it is good to use prototypes almost excessively, to make it easier to add and edit traits and commands across multiple pieces.

What you will probably end up doing is making a Small/Medium/Large prototype out of the "Movement Marking" one, then add to that any other prototypes you need, like Piece Sharing, or other basic stuffs. After that you simply apply the newly sized prototypes onto the appropriate pieces separately and it should work just fine.
- Model: Custom Build
- Operating System: Windows XP
- CPU: 3GHz
- Memory: 2 GB
- Video Card: NVIDIA GeForce GTS 250
- Vassal version: 3.2.10
- Java: Version 7 Update 51
reddeblu
 
Posts: 112
Joined: March 25th, 2011, 3:24 am

Re: Mark Unmoved for one side

Postby Kiwi461 » February 9th, 2014, 4:10 am

Will it mess anything up moving the piece from one map window to the next? From the Player's 'tray' to the 'table'?
Kiwi461
 
Posts: 13
Joined: January 23rd, 2014, 6:02 pm

Re: Mark Unmoved for one side

Postby reddeblu » February 9th, 2014, 4:37 am

Not that I can think of, actually if the tray is just a holding place, then you DONT want to give it the Setup command. That command should only be on maps that are being played on, not holding pieces.

There may be some things that linger if you move pieces from and to the table a lot, but extra commands can be added to "reset" a piece if it is returned to the tray or discarded for what ever reason.

Edit: And I keep getting a strange error page when I try to post on the forums, is anyone else by chance?
- Model: Custom Build
- Operating System: Windows XP
- CPU: 3GHz
- Memory: 2 GB
- Video Card: NVIDIA GeForce GTS 250
- Vassal version: 3.2.10
- Java: Version 7 Update 51
reddeblu
 
Posts: 112
Joined: March 25th, 2011, 3:24 am

Re: Mark Unmoved for one side

Postby Kiwi461 » February 9th, 2014, 4:59 am

thanks for help reddblu. If I run in to any problems implementing it into my module, i'll be coming back to ask for sure.

I'm getting the error as well, but seems that my posts are still going through.
Kiwi461
 
Posts: 13
Joined: January 23rd, 2014, 6:02 pm

Re: Mark Unmoved for one side

Postby reddeblu » February 9th, 2014, 5:07 am

No problem, It's been slow around here so I'm glad to have something to preoccupy me for a bit.
- Model: Custom Build
- Operating System: Windows XP
- CPU: 3GHz
- Memory: 2 GB
- Video Card: NVIDIA GeForce GTS 250
- Vassal version: 3.2.10
- Java: Version 7 Update 51
reddeblu
 
Posts: 112
Joined: March 25th, 2011, 3:24 am

Re: Mark Unmoved for one side

Postby Kiwi461 » February 9th, 2014, 4:35 pm

Okay, so I have a Piece Sharing prototype and it matches the one from your example. The only difference is I've increased the players from 2-4 but all the Trigger Actions look the same. I then created a prototype for the Mark Moved, the only differences between mine and your example being that I increased the number of Triggers to account for more players, and the Marked as Moved trait matches what I need for the size of the unit base. I placed the Piece Sharing prototype into the Mark Moved prototype. I don't have a "Normal Stuff" prototype in that bundle, as that's already a prototype I have attached to the unit.

I tried both pulling straight to the player tray, then to the table and straight to the table. Moving the unit does bring up the moved icon where I want it, however when I push the "Unmarked moved" button, nothing happens. I switched back and forth between Player 1 and Player 2, again ... nothing. I've also pulled the "Piece Sharing" prototype out of the Mark Moved and just put both the Mark Moved and Piece Sharing prototype as traits on the unit itself. Still nothing, I've also tried a restart of Vassal because I've read some things don't really 'take' until you've saved and restarted.

Finally, does it matter if the "Unmarked Moved" button is not in the Map Window for the 'Table'? It shows up in the window where the chat box and all that stuff is. I thought perhaps that may be a factor but haven't tried it yet.

What else should I be looking to check? I feel like, see moved marker is showing up ... it's not properly labeling the pieces as belonging to a specific player ... I don't know. I'm certainly not a programmer.
Kiwi461
 
Posts: 13
Joined: January 23rd, 2014, 6:02 pm

Re: Mark Unmoved for one side

Postby reddeblu » February 9th, 2014, 9:06 pm

Did you add Triggers in the Movement Marking prototype for players 3 and 4? As well in the Undo Mark trigger you will need two extra keystrokes for players 3 and 4.

As well, did you change the Dynamic Property Owner in Piece Sharing to set a 3rd and 4th player?

If you want I can take a look at it if you upload it here. If all else fails I suggest checking to make sure every key command, every property, every everything is spelt exactly the way it should be! When making the module I had a hard time getting it working, because I accidentally typed the Owner property as Owned. :lol:
- Model: Custom Build
- Operating System: Windows XP
- CPU: 3GHz
- Memory: 2 GB
- Video Card: NVIDIA GeForce GTS 250
- Vassal version: 3.2.10
- Java: Version 7 Update 51
reddeblu
 
Posts: 112
Joined: March 25th, 2011, 3:24 am

Next

Return to Module Design

Who is online

Users browsing this forum: No registered users and 1 guest