Wow, thank you. I will sit down with this this evening and get my head round as much as possible. I've only ever USED other peoples' script cards and never used a scriptcard trigger, so there will be a few things I probably get wrong first time round... But before I do, a quick question just so that I'm absolutely sure; that "change:graphic" ability ONLY goes on the "ScriptCards_Triggers" character, and that character's token does need to sit somewhere (out of sight) on the map? Right? Joshua N. said: So here is the first attempt at a ScriptCard Trigger that will do this: !scriptcard {{
--/|VARIABLES TO SET
--~|array;define;trackedTokens;PlayerTokenID1;PlayerTokenID2
--~|array;define;hunterTokens;HunterTokenID1;HunterTokenID2
--&pixels|70
--&debugOutput|false
--#hidecard|1
--/|TRIGGER_REPLACEMENTS
--/|Check if the page where the graphics changed is the active player page
--/|If not the current player page, then stop processing
--?"[&GraphicNew_pageid]" -ne "[*C:playerpageid]"|[
--?"[&debugOutput]" -eq "true"|>DebugLog;PageID [&GraphicNew_pageid] doesn't match current player page ID: [*C:playerpageid]
-->Done|
--]|
--/|Check if the graphic that moved is a tracked token and if not stop processing
--~TrackedIndex|array;indexof;trackedTokens;[&GraphicNew_id]
--?"[&TrackedIndex]" -eq "ArrayError"|[
--?"[&debugOutput]" -eq "true"|>DebugLog;Moved TokenID [&GraphicNew_id] not found in tracked tokens array
-->Done|
--]|
--&HunterTID|[@hunterTokens([&TrackedIndex])]
--?"[&debugOutput]" -eq "true"|>DebugLog;Moved TokenID [&GraphicNew_id] found in tracked tokens array
--?"[&debugOutput]" -eq "true"|>DebugLog;Moved TokenID [&GraphicNew_id] tracked by [&HunterTID]
--~LM|string;split;,;[*[&GraphicNew_id]:t-lastmove]
--?"[&debugOutput]" -eq "true"|>DebugLog;Found [$LMCount] coordinates in tracked tokens last move
--?[$LMCount] -lt 2|>Error;Invalid lastmove for [&GraphicNew_id]. Got [*[&GraphicNew_id]:t-lastmove]
--~FinalDistance|distance;[&GraphicNew_id];[&HunterTID]
-->DistanceByCoordinates|[&LM2];[&LM1];[*[&HunterTID]:t-top];[*[&HunterTID]:t-left];OriginalDistance
--?"[&debugOutput]" -eq "true"|>DebugLog;Original distance:[$OriginalDistance] Final distance:[$FinalDistance]
--?[$FinalDistance] -lt [$OriginalDistance]|MoveCloser
--:MirrorMovement|
--?"[&debugOutput]" -eq "true"|>DebugLog;Mirroring movement
--%origLeftIndex|1;[$LMCount];2
--&origTopIndex|[= [&origLeftIndex] + 1]
--?[$LMCount] -gt [&origTopIndex]|[
--&destLeftIndex|[= [&origTopIndex] + 1]
--&destTopIndex|[= [&origTopIndex] + 2]
--=LeftMovement|[&LM[&origLeftIndex]] - [&LM[&destLeftIndex]] {NEGATE}
--=TopMovement|[&LM[&origTopIndex]] - [&LM[&destTopIndex]] {NEGATE}
--]|[
--=LeftMovement|[&LM[&origLeftIndex]] - [*[&GraphicNew_id]:t-left] {NEGATE}
--=TopMovement|[&LM[&origTopIndex]] - [*[&GraphicNew_id]:t-top] {NEGATE}
--]|
--=NewHunterLeft|[*[&HunterTID]:t-left] + [$LeftMovement] {FLOOR}
--=NewHunterTop|[*[&HunterTID]:t-top] + [$TopMovement] {FLOOR}
--?"[&debugOutput]" -eq "true"|>DebugLog;Original Hunter Coordinates:[*[&HunterTID]:t-left] [*[&HunterTID]:t-top]
--?"[&debugOutput]" -eq "true"|>DebugLog;New Hunter Coordinates:[$NewHunterLeft.Total] [$NewHunterTop.Total]
--!t:[&HunterTID]|left:[$NewHunterLeft.Total]|top:[$NewHunterTop.Total]
--?[&origTopIndex] -ge [$LMCount]|%!
--%|
--:MoveCloser|
--~NewGap|distance;[&GraphicNew_id];[&HunterTID]
--?[$NewGap] -le 1|Done
--/|Calculate top and left distances and move 1 square closer in whichever distance is greater
--=LeftDistance|[*[&GraphicNew_id]:t-left] - [*[&HunterTID]:t-left] {ABS}
--=TopDistance|[*[&GraphicNew_id]:t-top] - [*[&HunterTID]:t-top] {ABS}
--?"[&debugOutput]" -eq "true"|>DebugLog;Horizontal distance:[$LeftDistance] Vertical distance:[$TopDistance]
--?[$LeftDistance] -gt [$TopDistance]|[
--?"[&debugOutput]" -eq "true"|>DebugLog;Move closer 1 square left/right
--=HorizontalDistance|[*[&GraphicNew_id]:t-left] - [*[&HunterTID]:t-left]
--?[$HorizontalDistance] -gt 0|=NewLeft;[*[&HunterTID]:t-left] + [&pixels]|=NewLeft;[*[&HunterTID]:t-left] - [&pixels]
--?"[&debugOutput]" -eq "true"|>DebugLog;Old left coor:[*[&HunterTID]:t-left] New left coor:[$NewLeft.Total]
--!t:[&HunterTID]|left:[$NewLeft.Total]
--]|[
--?"[&debugOutput]" -eq "true"|>DebugLog;Move closer 1 square up/down
--=VerticalDistance|[*[&GraphicNew_id]:t-top] - [*[&HunterTID]:t-top]
--?[$VerticalDistance] -gt 0|=NewTop;[*[&HunterTID]:t-top] + [&pixels]|=NewTop;[*[&HunterTID]:t-top] - [&pixels]
--?"[&debugOutput]" -eq "true"|>DebugLog;Old top coor:[*[&HunterTID]:t-top] New top coor:[$NewTop.Total]
--!t:[&HunterTID]|top:[$NewTop.Total]
--]|
--:Done|
--X|
--/|Emulates what the distance function in ScriptCards does with 2 tokens
--:DistanceByCoordinates|X1;Y1;X2;Y2;RollVariableForResult
--=x1|[%1%] / [&pixels]
--=y1|[%2%] / [&pixels]
--=x2|[%3%] / [&pixels]
--=y2|[%4%] / [&pixels]
--=XAB|[$x1] - [$x2] {ABS} {FLOOR}
--=YAB|[$y1] - [$y2] {ABS} {FLOOR}
--~[%5%]|math;max;[$XAB];[$YAB]
--<|
--:DebugLog|DebugMessage
--\|SC change_graphic trigger DEBUG: [%1%]
--<|
--:Error|ErrorMessage
--\|ERROR change:graphic trigger: [%1%]
-->Done|
--X|
}} Setup : Requires ScriptCards mod to be installed Requires a character named ScriptCards_Triggers (may require a sandbox restart after creation) Requires the ScriptCards_Triggers character to have an ability named change:graphic Edit the above script to include the token ids for the players' tokens and the token ids for the hunter tokens --~|array;define;trackedTokens;PlayerTokenID1;PlayerTokenID2
--~|array;define;hunterTokens;HunterTokenID1;HunterTokenID2 Just separate each ID with a semi-colon ; and each player token will be tracked by the corresponding hunter token. Hunter1 tracking Player1 and so on. If you want to disable the trigger, rename the ability to something else like OFFchange:graphic and it won't process the events any longer. Current Logic: When setup, the change:graphic event will check if the graphic is on the same page as the current active player ribbon page and if not, then stop processing. If on the active player page, will check if the graphic changed is in the trackedTokens array, if not, will stop processing. If found in the trackedTokens array, will get the corresponding token id in the hunterTokens array. Checks if the tracked token is closer or farther away than it was originally. If farther, then the hunter token will mirror the lastmove property of the tracked token. If the tracked token moved closer, then the hunter will not mirror. Regardless of the mirrored movement result, the hunter token will move 1 square closer unless the hunter token is already within 1 square of the tracked token. The 1 square direction is chosen by which is the greater distance, horizontal or vertical, and then moves 1 square closer. If they are equal distance, the hunter will move 1 square closer vertically. More Info: If you want to see a bunch of cryptic messages in the Mod Sandbox Console, then set debugOutput to true --&debugOutput|true ScriptCards wiki on Triggers I had already been working on a trigger for change:graphic for token movement anyway so a lot of this is similar to what I was working on already. Hopefully it works as you want and these instructions are clear enough. Let me know if you have any questions or feedback.