Create account / Log in

Is there a better way to send "next" piece from a sequen...?

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Is there a better way to send "next" piece from a sequen...?

Postby Benkyo » July 12th, 2019, 6:02 am

I have a system and it works, but the response time between command and result is slow. Is there a more elegant solution?

The problem:

12 at-start stacks with one piece each (we'll call them "armies"), arranged in a column (from "top" at Y=100 to "bottom" at Y=1000). I need to be able to call the "topmost" remaining army to any receiving piece (we'll call them "regions") on any map, and return any army from anywhere to the "bottom-most" open space in the column. In other words, I need to duplicate the functionality of a stack without actually using a stack.

How I did it:

12 zones, 12 Global properties, X Global property, Y Global property, Map Global property.

Regions have
a Trigger Action performing keystrokes reset, add, set
reset that sets the 12 Global properties to 0
add that triggers Global Key Command addcount
set that triggers Global Key Command send, set X, Y, & Map Global properties

Armies have
reset that sets the 12 Global properties to 0
add that triggers Global Key Command addcount
addcount Trigger Actions with property matches tied to 12 zones, triggering set each of 12 Global properties to 1 when army is in corresponding zone
send triggers 12 Trigger Actions, which check the 12 Global properties to send an army in the first CurrentZone that is occupied (preceding zones have Global Property 0) to the coordinates indicated by the X, Y, & Map Global properties
a Trigger Action performing keystrokes reset, add, move
move triggers 12 Trigger Actions, which check the 12 Global properties to send the army to the first zone linked to Global Property at 0 (subsequent zones have Global property 1)

There are actually 8 sets of 12 armies that all have the same setup, but differentiated by single letter changes in all the traits/properties/zones.

I realise that this is really an absurdly complex solution that could largely be done away with by simply putting the armies in actual stacks. That is not an option though, so my question is simply, is there a better way to do this without putting each army set in a stack?
Benkyo
 
Posts: 128
Joined: March 13th, 2013, 11:02 pm

Re: Is there a better way to send "next" piece from a sequen

Postby Benkyo » July 16th, 2019, 3:01 am

Here's a more specific question:

If I replaced the 12 Trigger Actions for send with one Trigger Action that checks a Dynamic Property that has a really long and complex boolean command string, would that speed things up noticeably? (same for the 12 Trigger Actions for move)
Benkyo
 
Posts: 128
Joined: March 13th, 2013, 11:02 pm

Re: Is there a better way to send "next" piece from a sequen

Postby Benkyo » July 16th, 2019, 3:28 am

(I mean calculated property)
Benkyo
 
Posts: 128
Joined: March 13th, 2013, 11:02 pm

Re: Is there a better way to send "next" piece from a sequen

Postby Benkyo » July 18th, 2019, 4:30 am

Benkyo wrote:If I replaced the 12 Trigger Actions for send with one Trigger Action that checks a Dynamic Property that has a really long and complex boolean command string, would that speed things up noticeably? (same for the 12 Trigger Actions for move)

Turns out the answer is no.

So, I guess the delay is in resetting the 12 Global Properties to 0 and working through the Trigger Actions to set each one to 1 if an associated zone is occupied. I'm still wondering if there is a user-proof way to track when a piece is dragged from a zone, instead of going through this process each time.
Benkyo
 
Posts: 128
Joined: March 13th, 2013, 11:02 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 0 guests