Hey.
I'm currently learning animation and modelling I don't have the time to learn C++ properly, however there is some very simple (I hope) code I would like to try and implement.
Basically, I'm working with npc_citizen. My model has 6 different skins, listed below:
0 - Normal, 'clean' skin
1 - Damaged skin, some scratches here and there
2 - Wounded skin, with some more prominent blood
3 - Badly wounded skin, basically 2 with more blood
4 - Near-death skin, much bloodier
5 - Dead skin with dried blood, more dead-looking face
What I would like to do is implement a very simple feature. I've modified the citizen to have 100 health.
I would like to have the following code:
If health is 100, switch to skin 0
If health is between 99 and 75, switch to skin 1
If health is between 74 and 50, switch to skin 2
If health is between 49 and 25, switch to skin 3
If health is between 24 and 1, switch to skin 4
If health is zero/npc is dead, switch to skin 5
The reason for that implementation is if I heal the npc, the skin will go backwards. If I give enough health to an npc on skin 4, he switches back to skin 0, etc.
Would anyone here be kind enough to write out and explain this very simple code?
You don't need to write it all out if you do; the only code I want to know is:
If health is between a and b, switch to skin c
So I can change values a, b and c to get the results I want. I assume the code would just be one line, but I'm probably wrong- I don't know C++.
If you can do this for me, or at least point me in the right direction, it would be excellent and very much appreciated.
Remember I have 0 C++ experience, so you will probably need to explain everything you say related to the code!
I will probably ask a lot of questions too.
-TechieUK (WILLAM)