I have an object called character that pulls information from a json file and changes the sprites colors according to what the json file dictates.
Both the player and npc's use the same shader and character object to be created and also pull data from the same json file.
Some how the npc's (!="Player") colors 3 and 4 show as black, while the first two colors render correctly.
All of the the player's colors render as intended.
My code is posted below.
First the player is made and then any npc afterward.
This code should be the only difference between them as far as appearance is concerned right now.
The code then takes the data collected from the json file and converts it into color info for the shader.
How is it that colors 3 and 4 of the npc are not showing while colors 3 and 4 of the player do?
Both the player and npc's use the same shader and character object to be created and also pull data from the same json file.
Some how the npc's (!="Player") colors 3 and 4 show as black, while the first two colors render correctly.
All of the the player's colors render as intended.
My code is posted below.
Code:
if global.curr_char = "Player"
{
schemes = ds_map_find_value (global.rmap, "colors");
var _colorlist = ds_map_find_value (global.rmap,"color" + string(color_scheme) +"_1");
for (var i = 0; i < 3; i++)
{
base_color1[i] = _colorlist[| i];
}
var _colorlist = ds_map_find_value (global.rmap,"color" + string(color_scheme) +"_2");
for (var i = 0; i < 3; i++)
{
base_color2[i] = _colorlist[| i];
}
var _colorlist = ds_map_find_value (global.rmap,"color" + string(color_scheme) +"_3");
for (var i = 0; i < 3; i++)
{
base_color3[i] = _colorlist[| i];
}
var _colorlist = ds_map_find_value (global.rmap,"color" + string(color_scheme) +"_4");
for (var i = 0; i < 3; i++)
{
base_color4[i] = _colorlist[| i];
}}
if global.curr_char != "Player"
{
var my_color = ds_map_find_value (global.cmap,"scheme")
var _colorlist = ds_map_find_value (global.rmap,"color" + string(my_color) +"_1");
for (var i = 0; i < 3; i++)
base_color1[i] = _colorlist[| i];
base_color2[i] = _colorlist[| i];
base_color3[i] = _colorlist[| i];
base_color4[i] = _colorlist[| i];
}
//get shader uniforms
uni_colorOut1 = shader_get_uniform (infinite_shader,"colorOut1")
_colorOut1 = [base_color1[0]/255,base_color1[1]/255,base_color1[2]/255,base_color1[3]/255]
uni_colorOut2 = shader_get_uniform (infinite_shader,"colorOut2")
_colorOut2 = [base_color2[0]/255,base_color2[1]/255,base_color2[2]/255,base_color2[3]/255]
uni_colorOut3 = shader_get_uniform (infinite_shader,"colorOut3")
_colorOut3 = [base_color3[0]/255,base_color3[1]/255,base_color3[2]/255,base_color3[3]/255]
uni_colorOut4 = shader_get_uniform (infinite_shader,"colorOut4")
_colorOut4 = [base_color4[0]/255,base_color4[1]/255,base_color4[2]/255,base_color4[3]/255]
}
This code should be the only difference between them as far as appearance is concerned right now.
The code then takes the data collected from the json file and converts it into color info for the shader.
How is it that colors 3 and 4 of the npc are not showing while colors 3 and 4 of the player do?