Hi,
I've done something like that in my game, maybe it can help you out.
Possible solution 1: (no custom code)
You could give the plants a parameter like "parentMossTouchedBySeed". Then in the layer with the plants and the moss, you can access a specific moss parameter "touchedBySeed" and if it is true, then you can set all this moss's plants parameter "parentMossTouchedBySeed" to true. From that point, when you have to do a specific action in the plant's rules, rather than checking for the moss's "touchedBySeed" parameter, check for the "parentMossTouchedBySeed" parameter of the plants, you should have no problem doing that. Of course, you need a lot of rules, but it can be done.
Possible solution 2: (with custom code)
With a custom script you could access the moss's parameter without having to create plan rules. First step, give each moss a property called something like "mossID" and set these properties to an integer value "0, 1, 2, 3, etc" and just make sure that each moss as a different value. Then create a property on your plant sprite called something like "parentMossID" and give it the same value that the moss's "mossID" that owns this plant.
Then, create a new custom class and create this function:
[Description("Returns the parent moss touchedBySeed property")]
public static int GetParentMossTouchedBySeed(SpriteBase PlantSprite, int parentMossID)
{
int i;
for (i=0; i < PlantSprite.ParentLayer.m_Sprites.Count - 1; i++)
{
if(PlantSprite.ParentLayer.m_Sprites[i].mossID == parentMossID )
{
//return the actual value
return PlantSprite.ParentLayer.m_Sprites[i].touchedBySeed
//to break the loop
i = PlantSprite.ParentLayer.m_Sprites.Count;
}
}
}
Oh! I forgot to tell you. Your parameters "mossID", "parentMossID" and "TouchedBySeed" have to be created in the SpriteBase.cs file. You need to create a field and then a property with "get/set". Of course, all of your sprites will have these properties, but you can ignore them on the sprites which doesn't need them. Or maybe someone knows a way to access the parameters of a sprite created by the wizard.
Anyway, when this is done, in your plant sprite rules you select your custom function like this:
Create a rule, select "CustomObjects.YourCustomClassName.GetParentMossTouchedBySeed" and pass the two parameters "this" and "parentMossID". And you have it.
The second solution is more complicated to develop, but you have far less rules to manage after that.
Feel free to ask some questions if it's not explained well enough. I'll try to make it easier.
Good luck!
