Tremulous Forum
Mods => Modding Center => Topic started by: rotacak on December 13, 2009, 04:48:29 pm
-
Hi,
in file models/weapons/new_weapon/weapon.cfg is defined missileDlightColor 1 1 1
That mean white light. Is possible to use random color everytime when is weapon used? For example new luci: I will shot one bullet (color pink), second (red), third (blue) etc.
I tried missileDlightColor 0~1 0~1 0~1 but it not work. Even this will be bugged, because result can be 0 0 0, but anyway, it not work at all.
-
Hi,
in file models/weapons/new_weapon/weapon.cfg is defined missileDlightColor 1 1 1
That mean white light. Is possible to use random color everytime when is weapon used? For example new luci: I will shot one bullet (color pink), second (red), third (blue) etc.
I tried missileDlightColor 0~1 0~1 0~1 but it not work. Even this will be bugged, because result can be 0 0 0, but anyway, it not work at all.
Its been awhile since i programmed but perhaps you program a random integer?
for example
Define SHORT Luci_Ball_Col
{
Luci_Ball_Col == 1 - (rnd*1+0.1)
}
missileDlightColor Luci_Ball_Col Luci_Ball_Col Luci_Ball_Col;
Sorry I forgot C++ command for random, but basically make it random between 0.1 and 1. I believe you have to use a variable in the command as missileDlightColor Will only accept integers (or short/long I dont know I havent checked).
-
Except that the weapon cfg's aren't C...
-
Except that the weapon cfg's aren't C...
Well whatever language they are written in the same principle applies you cannot assign a variable which only accepts certain Datatypes another datatype. In this case, im sure missileDlightColor only accepts INTs or SHORTs therefore you cannot plug in an argument, as it will only accept a number, not an equation (0~1 is an equation, not a number). Therefore you need to make you OWN equation seperate from missileDlightColor to accept. As in the example I gave above
-
From my messing around with it, I concluded it was buggy, it only produced white colors no matter what parameters it was given. (i think)