|
|
Group key by itself should work in parameters and expressions
Issue Type: |
Status: |
Priority: |
Date Submitted: |
Votes: |
Enhancement |
More Info Required |
High |
Mon 4th Aug 2014 |
2 votes
|
|
Found in version: |
Last Updated: |
Completed in version: |
Date Completed: |
Track Changes: |
5.0.31.4 |
Tue 29th Dec 2015 |
|
|
Log In |
|
saabie | | Mon 4th Aug 2014 17:00 |
The key "Group1" by itself can't work in text because there is no way to tell that it is a function.
But when used as a parameter for an execute task action it should return a list of the objects, characters or locations that are in that group.
Group1 should return Object4|Object6|Object397 so that it can be used as a parameter when an action executes a task with an %object% reference, causing the task to be run for each object in the group.
It would be nice if it also worked in expressions.
WORKAROUND
If you create a mandatory item property called "All", then you can use "Group1.All(enabled)" as the parameter.
|
|
Campbell | | Thu 28th Aug 2014 21:13 |
Are you sure you used the correct group key, and the group had members? This seems to work fine for me. |
|
saabie | | Tue 21st Oct 2014 03:38 |
An example TAF file has been posted at http://forum.adrift.co/viewtopic.php?f=14&t=10982
|
|
ElliotM | | Wed 16th Dec 2015 19:36 |
I tried this out using Saabie's file in verions 5.0.34.1 and copy/pasted the results below to show how they are being treated differently.
-----------------------------------
View Monitor Action: Execute task '#check %location%' ( Cameras )
> view monitors
I check the three closed-circuit monitors.
Monitor B, C and D show empty rooms.
View Screens Action: Execute task '#check %location%' ( Cameras.All1(true) )
> view screens
I check the three closed-circuit monitors.
Monitor B and D show empty rooms.
The monitor for room C is just showing snow.
If you add all the rooms to group 'Broken cameras', the output for view monitor is unchanged.
----------------------------------
I'm not sure what the default behavior for a groupkey by itself should be. For groups it might make sense for it to resolve to a list of their members, but that would change the expectation for other keys as well. What should be printed if the key for a location, character, or object were by itself? I don't believe those do anything on their own without the dot operator, otherwise that would make things problematic for keys that matched words the author used elsewhere that weren't meant to be keys. While the workaround is a bit more work for the author, it is at least consistent with how other keys work. |
|
saabie | | Tue 29th Dec 2015 07:39 |
In 5.0.34 the group keys are working consistantly.
If "LightSources" is a group key and "Items" is a mandatory selection-only property:
"LightSources": With just the group key the actions of the called task are run once and cannot include actions on the referenced item.
"LightSources.Items": With a filter the actions are run for each item in the group.
Rather than clutter every item's property list with a mandatory property, I would recomend an "Items" function on groups that converts the group key into a list of item keys in the same way an always-true filter property does.
This enhancement request can then be closed.
|
|
|