Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Kusanagi on January 03, 2011, 12:34:16 am
-
I know we already have a ship's glowpoints set to flicker on and off with damage lightning, so how about also tying that code in to a ship's glowmap along with a table entry to make it optional for it?
-
Seconded.
-
id use some kind of procedural frame selection system where the glowmap contains several frame sets that are used under certain conditions. all sets would draw on the same pool of frames to give the most possible combination out of as few frames as possible. of course int that something the planned new eff system will cover?
you could do something where you have a set of frames that are to be played when the ship is healthy and a set to be played when the ship is dead. you would swap healthy frames with dead frames at some random interval based on the damage. so that the swap probability 100% at 0% health and 0% at 100% health. when a swap occures the playback of the healthy frameset is paused in place and a frame from the damage set is played, if the next frame is not to be swapped then the healthy animation continues, but if the swap is go, play the next damage frame in the frameset. it would look something like this:
health is 100% -> 0% chance of swap -> swap fails -> play healthy frame 1
health is 90% -> 10% chance of swap -> swap fails -> play healthy frame 2
health is 80% -> 20% chance of swap -> swap passes -> play damage frame 1
health is 60% -> 40% chance of swap -> swap passes -> play damage frame 2
health is 60% -> 40% chance of swap -> swap passes -> play damage frame 3
health is 60% -> 40% chance of swap -> swap fails -> play healthy frame 3
health is 60% -> 40% chance of swap -> swap fails -> play healthy frame 4
health is 60% -> 40% chance of swap -> swap passes -> play damage frame 4
it need not have 2 conditions, for example you might have a set of frames that happen when a ship gets emped or a set to play when the ship is disabled or when the ship looses a subsystem. you could construct a wide range of different patterns from only say 8 different frames with 8 levels of intensity, the only difference would be the playback order.
-
I think once we can tap into the material system via LUA this should be pretty simple. ;)
Maximum flexibility and no new code for a single special case.
-
yea thats kinda something i want. theres already a material object but as far as i can tell theres no way to tap into it. i need to be able to draw to the alpha channel, then hud-on-a-polygon will be possible.
-
I'm wondering about one thing though.
Given the case that we want an intense per frame flickering.
Will the GPU have to wait for a new value before it can render the next frame, or will it just use the previous value?
Or could this be something that simply shouldn't be scripted?