TheKilltech / rift_balance

1 stars 0 forks source link

Alert light yellow target #1

Open SenorRagequit opened 8 months ago

SenorRagequit commented 8 months ago

Is this part of yellow light with target correct? No idea what the building does tbh, but feels like green would make more sense.

https://github.com/TheKilltech/rift_balance/blob/a3fcd01efa2be930ebf0abfca44d81f34c56bdee/lua/buildings/defense/fire_control_station.lua#L158C2-L158C61

TheKilltech commented 8 months ago

yeah. this part of the code is originally only there to help me debug - to have some visual feedback rather then having to look into the log. there are two effects, one is the light which indicates the internal state. if the fire control station detects enemies in the area it goes red and yellow is an intermediary state when switching to green altert - i.e. when it's safe. the yellow state is there mostly for technical reasons. i could have made not noticeable, but i didn't think it was worth the effort.

the target effect is the laser pointer which points to one of the detected enemies. the research station mesh does not have bones like a turret, yet i use that lua code. to have some visual representation where the tower is facing i used that effect instead. it's also useful for the player to clear remaining enemies so the fire control station can power down defenses afterwards.

this method switches from one state to another, and this is why you first have to disable all effects of the old state first before enabling effects of the new state.

the debug stuff provided good feedback to the player so i decided to keep it.