How can Vassal itself select a piece? I need to cycle through all units to perform an event

Basically I need to have all the units move simultaneously so I need to be able to select them one at a time trigger a move then select another until all have been moved.

You’re the electric football guy, right? Okay, listen up. I think you are biting off WAY more than you can chew. In fact, you are biting off way more than I can chew, and I’m an experienced Vassal module designer. I don’t think you’ve thought this through and seen all the headaches facing you.

Forget for the moment moving all the players on the field. Put out there one offensive lineman and one defensive lineman, and picture all the outcomes when you turn on the power. Now figure out how you plan to model THAT.

In fact, I suggest for now you forget about a Vassal module for this. Instead, see if you can design a paper and cardboard version of the game, and if you can do that, THEN you might look to Vassal.

I’ve done 15 or so modules, some with sound triggered on movement of items, some with morale that changes based on multiple triggers.

So yes I am totally and completely aware of what I am attempting to do.

First a need a mechanic for selecting the 22 units on the map one at a time without doing it manually. Starting with lineman first and then working through the running backs, line backers, then the wide outs and the DBs along with the QB.

As each unit moves I need to know the XY positions of every other of the 21 units to see if that unit plus his base range is over lapping any other unit, if so then I need to force that unit to move the same direction as the moving unit the same distance, not going to worry about causing spin effects now, maybe later.

Finally I need a way of turning the auto movement off and on with a hot key.

For passing I would record an accuracy rating for the QB who would then send the ball in a direction while everyone was still, his accuracy would combine with a variable generated that would alter the line of movement by a few degrees so that the further away you are from the wide out the less chance the ball has of over flying the unit.

NASA went to the moon on a calculator! Before that they killed 3 men on the pad, blew up many rockets etc. etc.

I know what I am asking for, right now I am asking for a way to select each item in an array of sorts to move each of them. Once I can get past that I will tackle the next, and the next and the next.

So is there a way to select each item in a location one at a time without the player doing it?

It’s certainly possible; just not sure that it’s practical. You can’t really select a single unit at a time and then perform some external action on it, but there’s nothing stopping you from targeting a Global Key Command (GKC) narrowly enough to only trigger a single unit. Basically, you would need a Trigger Action which then triggered a GKC targeting the first unit, then a GKC targeting the 2nd unit, etc.

This really sounds like it would only be practical to implement with some custom Java code, though–it might end up ridiculously slow trying to do it with existing VASSAL traits.

Global Key Command with a Range? That way only those units within range would have to be processed, rather than all 21.

Change-Property trait added to a Global Property that controls automation on/off. The change-property trait can have a Hotkey and the value field should be set to flip between on and off.

I’ve assumed “auto movement” is what you’re building rather than some build in vassal feature.

1 Like

From the scope of what you are trying to achieve, I would definitely recommend using custom Java code if this is within your skillset. Base Vassal is not really designed to support this level of close-coupled automation. Not saying it isn’t possible, but as jrwatts says, there is a strong possibility that you will see performance issues as you start to scale this up. On the plus side, it is a constrained problem with just the 11 units per side, not the hundreds you might find in a wargame, so you have more room to move.