Version 0.7 - Graphical output, wavefront shape/color variations, filter updates, output options ( github link ) Finally getting this update out for testing! There's a lot of documentation, so be patient :) 1) Supports circular and square wavefronts. Square wavefronts will count diagonals as 1 unit when determining range (though distance for output is currently still pythagorean theorem). 2) Can take slices of these wavefronts to make "cones" by adding optional coneDirection and coneAngle parameters (in degrees). Additionally, a tokenID can be substituted for the coneDirection, which will calculate the angle between the source and target token to determine direction. The "5e" wavefront is special in that it will always be approx 53.14degrees (cones in 5e have a width equal to the length) --wavetype| <circle/square/5e <optional coneDirection/tokenID coneAngle> //default=circle. range determined by pythagorean theorem //square. Diagonals squares count as one unit //5e. will produce a cone of ~53.14 deg. The width of cone is equal to the cone length. //coneDirection - the angle of the center of the cone (clockwise positive, 0deg is straight up). If a tokenID is entered, the angle between the source and target token will be used //coneAngle - the angle of the cone in degrees Examples: --wavetype|square --wavetype|circle --wavetype|5e //a ~53.14 degree cone straight up (default coneDirection is 0 degrees). 5e cones have FLAT faces (i.e. they are triangles) --wavetype|circle, 90, 60 //pie-shaped (rounded) cone with center angle of 90degrees and a cone width of 60 degrees --wavetype|square, @{target|Click Directional Token|token_id}, 75 //a 75-degree slice of a square. The center of the "cone" is at the angle between the selected and target tokens (note1: if @{target...} is used, you will also need to use the --selectedid|@{selected|token_id} command! This is because of an api limitation in which selected tokens are "forgotten" when target tokens are also included) (note2: square "cones" can produce some odd shapes. They are included here only for thoroughness) 3) Filter behavior updates. This syntax seems like a lot at first glance, but it's fairly straightforward in practice. See examples that follow. --tokfilter| <property>:<optional matchType><filterText1<optional #color> , filterText2 <optional #color>, ..., -exclude text> --charfilter| <attribute>:<optional matchType><filterText1 <optional #color> , filterText2 <optional #color> ,... -excludeText> //optional matchTypes: //"@" - exact match //">" - greater than (numeric only) //"<" - less than (numeric only)
//"*" - any value (i.e. does the attribute exist?) - no filterText is used in this case a) MatchType Keywords. Exact ("@"), comparative (">" or "<"), and wildcard (*) filters have been added. Comparative filters only work for numeric values. If matchType keywords are omitted, the default behavior remains "is the text included anywhere in the attribute value". If a wildcard character is used, the attribute just needs to exist (so any value will "match"). This should only be used with character sheet attributes, as all tokens will always have all token attributes. examples: --charFilter|hp:>0 //all tokens representing characters whose hp attribute is a number greater than 0 --tokFilter|bar1_value:>0 //same as above but for token bar value (does not need to represent character) --tokFilter|gmnotes:@doofus // token gmnotes must match "doofus" exactly. So, "I'm a doofus" will not match --tokFilter|gmnotes:doofus#009900 //default behavior. token gmnotes must contain "doofus". So, "I'm a doofus" will match . "doofus" tokens will be pinged with a green color. --charFilter|npc_type|* //if the character sheet contains the npc_type attribute with any value , it will match the filter. b) "ignore only" filters allowed. Previously, there had to be a positive match made in order to display any results. Now, if only "ignore" filters are used, the script will return all tokens that don't match the filter criteria. example: --charFilter|npc_type:-undead, -fiend //All tokens representing character sheets whose npc_type attribute does not contain "undead" or fiend" will match 4) Output options. Can now output a table (default), and/or graphical output, and you can have the table in a more compact form (abbreviations and single line) to ease the real estate burden in chat. --output| < graph, table, compact > //Default=table. Can include one or all of these elements. Compact attempts to put the table output on a single line Examples: --output|table, compact //no graphical output, table in compact form --output|graph //grapical output, no table output --output|graph, table, compact //graphical output, table is in compact form 5) Optional Graphical output. Would you like to see an actual radar screen in chat? You're in luck! If graphOptions is omitted, graph will be a plain gradient background. Can add any/all of grid, concentric circles, or a reticle pattern options. Note: circles/rings are interchangeable aliases. The size of the pings in the graphical output are always circular. In the case of tokens with unequal height/width, the average dimension will be represented in the graph. --graphoptions| < grid/circles/rings/reticle > //Default is a plain background. Can add graphical elements to display. Circles/Rings are interchangeable aliases examples: --graphOptions|grid --graphOptions|grid, circles --graphOptions|circles, reticle ***Known bug:*** if the center of the source token does not fall in the center of a square on the map (e.g. a 2x2 or 2x4 token), the grid in the graph will not line up properly. Hope to fix this in future versions. For the meantime, I would recommend not including the grid in the graphical output for these cases. 6) optional groupBy. By default (groupBy = true), using charFilter or tokFilter will group the results by the filter value. Setting to false will remove the grouping categories from the table output examples: --groupby|false --groupby|true //or line omitted 6) Custom wavefront color. You can now define the color of the animated wavefront by using standard html color notation #RRGGBBaa, where RGB are hexidecimal digits (0-F) and aa is the opacity. If aa is omitted, then the wavefront will be at 100% opacity. --wavecolor|#RRGGBBaa examples: --wavecolor|#006600 //dark green --wavecolor|#00ffff //cyan --wavecolor|#aa009955 //light purple (55% opacity) Full Examples with animated gifs: (note my gif conversion s/w doesn't replicate color gradients well. This is just an artifact and does not represent actual appearance) Example 1) 5e Divine Sense with circular and square waveforms. Note that the square waveform will satisfy the 5e range mechanics of "all creatures within 60ft" with diagonal squares only counting as 5ft. When run with a range of 60ft and circular waveform, the Fiend in the corner is missed. With square, it is in range. !radar {{
--range|12u
--wavetype|circle //or --wavetype|square (2nd waveform in the animated gif)
--wavespacing|35
--wavedelay|50
--wavelife|200
--pinglife|3000
--layers|gm, token
--charfilter|npc_type: celestial#yellow, fiend#red, undead#blue
--LoS|yes
--title|Divine Sense
--units|u
--output|graph, table
--graphoptions|grid, circles
}} Example 2) Various cone options. The following queries for the wavetype and coneWidth, and uses a target token to determine the coneDirection. Note the --selectedID was added to allow the target & selected ids to be passed to the api script. Also, note that when the 5e wavetype was selected, the coneWidth of 75 was ignored as all 5e cones have a width of ~53.14degrees. !radar {{
--title|Cone Example
--selectedid|@{selected|token_id}
--range|6u
--wavespacing|35
--wavedelay|50
--wavelife|500
--pinglife|5000
--layers|token, gm
--LoS|no
--units|m
--wavetype|?{Wave Type?|Circle,circle|Square, square|5e, 5e}, @{target|Click Target Token|token_id}, ?{Cone Width?|75}
--output|graph, table
--graphOptions|circles, reticle
}} Example 3). Using a "ConeTarget" token instead of a creature token to determine angle. In this example, I am using the SpawnDefaultToken script to create a token with a token name of "ConeTarget". Then I move the target into position before firing the radar script. This allows the center line of the cones to be placed between creature tokens, or for cases where there are no visible creature tokens (e.g. they are all in the gm layer or just aren't there to be clicked). The script will ignore any token whose name is "ConeTarget" ! The Spawn syntax (created a token action ability on the source character) !Spawn {{
--name|ConeTarget
--offset|1,0
--tokenName|ConeTarget
}} The Radar script for an Alien rpg M314 motion tracker. EDIT - User Godsbane pointed out that if you are using the actual Alien RPG character sheet, you should use the "health" attribute instead of "hp". (I was simulating using the 5e OGL sheet based on a description from another user.) Another option would be to replace the --charFilter with a --tokFilter and check against one of the bar values. They posted a variant example here . !radar {{
--title|M314 Motion Tracker
--selectedid|@{selected|token_id}
--range|100m
--charfilter|hp: >0
--groupby|false
--wavespacing|70
--wavedelay|10
--wavelife|200
--pinglife|5000
--layers|token, gm
--LoS|no
--units|m
--wavetype|circle, @{target|Click Source Token|token_id}, 180
--output|graph, table, compact
--graphOptions|circles, reticle
}} Example 4) A "less clicky" version of example 3. By using some trickery we can reduce the number of clicks required for the above example. In this case, we swap the selected and target token ids , allowing us to keep the ConeTarget token selected to fire off the motion tracker. The radar macro is created as a token action ability on the ConeTarget character sheet . See bolded lines below. !radar {{
--title|M314 Motion Tracker
--selectedid|@{target|Click Source Token|token_id}
--range|100m
--charfilter|hp: >0
--groupby|false
--wavespacing|70
--wavedelay|10
--wavelife|200
--pinglife|5000
--layers|token, gm
--LoS|no
--units|m
--wavetype|circle, @{selected|token_id}, 180
--output|graph, table, compact
--graphOptions|circles, reticle
}}