Hey !
What a nice post, explained, clear, .. everything !
Let's try to answer.
Just to start with, I'm also a "new full C2" user, and I've played around and found some of the same problems you did. Here is what I found :
1/ Ennemy_type
Let's talk about your function "onHit". You have to understand the picking mechanic here. As you didn't pick anything, everything is picked. All ennemies. All zombies and all purple sprites. The first action is then applied to all zombies that have "ennemy_type" set to 1 (so all zombis), and then the same appends for the purple sprite.
So first, you have to pick your ennemy. How? By UID. Use ennemy.UID as "onHit" argument when you call it, and add a condition "Pick Ennemy By UID (Function.Param(0)) at the start of the onHit function.
Then your 2 events (36 and 37 in the screenshot) will work, just replace "Zombie" and "Sprite" objects with "Ennemy" family.
Having an ennemy_type variable is useless in this case.
2/ LoS
This one is going to be quick. Don't use a family for this. Don't use a container. Use the new "line of sight" behavior (introduced on r134, start of this month).
3/ Instance Variables
First of all, your icon visibility setting can't work like this.
For example, whene the event 24 is triggered (zombie alerted, overlapping roof), you set the icon invisible. But at the same time, the event 23 is triggered, so you also set it to visible, every tick. Try to use sub events, like this
Zombie IS ALERTED :
- Zombie is overlapping roof, roof visible : set invisible
- else : set visible
Same goes for LoS (events 26 to 28)
Next, you have to pick the ennemy in your function here too ! event 21, add a condition "Ennemy : pick by UID", and use the Function.Param(0) to specify the ennemy UID.
I don't have time to go in the capx right now, but I will try to help more tonight, it can work, just need some more debug :)