Author Topic: Color shifting and LoadCheck States  (Read 673 times)

Ok, this time, I have 2 questions.

1.) How do you determine Color Shift for both Item/Weapon Color and projectile/trail color, as in, how do you define the digits to get colors like red, blue, etc. What is the purpose for color shift if you already have textures to define the gun colors?

2.) I am using Space Guy's old ammo script, and the current weapon I am working on calls Load Checks when the weapon is drawn, while it's ready, and after it fires.
Code: [Select]
Activate -> LoadCheckA
LoadCheckA ~> ifAmmoFull? -> Ready
LoadCheckA ~> ifNoAmmo -> LoadCheckB
LoadCheckB -> Reload
Reload -> Ready
Ready ~> Wait1Second -> LoadCheckA
Ready ~> TriggerDown -> Fire
Fire -> ReloadCheckA
ReloadCheckA ~> ifAmmoFull? -> Ready
ReloadCheckA ~> ifNoAmmo -> ReloadCheckB
ReloadCheckB -> Reload

Would it be wise to keep this system in place, or are the extra LoadChecks unneccessary? I can post the full state system if anyone doesn't have enough info.

How do you determine Color Shift for both Item/Weapon Color and projectile/trail color, as in, how do you define the digits to get colors like red, blue, etc. What is the purpose for color shift if you already have textures to define the gun colors?

Colorshift works the same for all of those.  It's just a RGBA color in float format (0.0 is minimum, 1.0 is maximum).





It's as simple as it says on the tin - the three component colors are added together to produce a color.  This isn't anything specific to colorshifting, this is just the RGB color space.  Some people come up with colors just by writing the numbers (you quickly learn how to combine colors to get what you want when working with it), but there's plenty of color picker utilities on the internet if you can't do it yourself.

For example: http://www.colorpicker.com



The three values I've selected are the red, green and blue components in decimal.  To convert them to the float representation used by TGE, divide each by 255.

I am using Space Guy's old ammo script, and the current weapon I am working on calls Load Checks when the weapon is drawn, while it's ready, and after it fires.
Would it be wise to keep this system in place, or are the extra LoadChecks unneccessary? I can post the full state system if anyone doesn't have enough info.

If it works, keep it, unless you find a better way. I don't know enough about the kind of weapon you're making or what the scripts behind your states do to say much about it.  Perhaps you could just mentally go through the progression of states and determine yourself when something really isn't necessary at a certain point.
« Last Edit: May 06, 2016, 01:08:18 PM by portify »

What is the purpose for color shift if you already have textures to define the gun colors?


It's just an easy way to change the color. It also makes changing the item icon's color WAY easier.

It's just an easy way to change the color. It also makes changing the item icon's color WAY easier.
building off this
you can make multiple different colored weapons without making multiple model files


the load checks are a necessary part to that variant of ammo system if you want your weapon to use ammo and reload properly
you can try rewriting the ammo script if you want, but thats probably the best method to it

Thank you very much guys.