It keeps returning the color 0,0,0 even though it shouldn't.. I tested it with this pseudocode.
dcSetColor(dialogitem,Color(1,1,1),Group-AllPlayers);//Set color to 1,1,1c=libNtve_gf_DialogItemColor(dialogitem,Group-Player1);//Get color//Print c as a string
The output is always 0,0,0 no matter what I try.. could someone please help me verify this?
color libNtve_gf_DialogItemColor (int lp_dialogItem, int lp_player);
Takes an int as second argument, not a player group. But I guess that should prevent it from running in the first place...
Are you getting a color with three 0.0 values, or are you getting a null pointer that your colorToString converts into 0,0,0? Because ColorGetComponent returns 0.0 when given a null pointer as color.
Um yeah.. thats just a pseudocode, I did put a player number inside. The script won't compile with a parameter error if I try put a group anyway.
Since I am player 1 by default, I passed 1 to lp_player.
I'm really not sure how to test whether or not I'm getting a null pointer. How do I do so?
Logically speaking, since i set the color of the dialog for all players previously, it shouldn't matter what int I put for lp_player because they should all be seeing the same color.
I'm pretty convinced its returning a color with 3 0.0 values to me. But I can't verify it as I'm not sure how to check.
Edit: Okay.. I managed to get it working on a separate test map. Doesn't make sense why it doesn't work on the map I need it to work in though..
Figured it out. you were right, its most likely null pointer related. I was trying to index a struct with a variable i before setting i by accident -_- Thanks for the help!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
It keeps returning the color 0,0,0 even though it shouldn't.. I tested it with this pseudocode.
The output is always 0,0,0 no matter what I try.. could someone please help me verify this?
Maybe the engine needs a tick to update the color internally?
Have you tried setting the color and calling the getter a few seconds later?
@MTops: Go
Yeap.. Tried, it still keeps returning 0,0,0 black for me.
color libNtve_gf_DialogItemColor (int lp_dialogItem, int lp_player);
Takes an int as second argument, not a player group. But I guess that should prevent it from running in the first place...
Are you getting a color with three 0.0 values, or are you getting a null pointer that your colorToString converts into 0,0,0? Because ColorGetComponent returns 0.0 when given a null pointer as color.
@MTops: Go
Um yeah.. thats just a pseudocode, I did put a player number inside. The script won't compile with a parameter error if I try put a group anyway. Since I am player 1 by default, I passed 1 to lp_player.
I'm really not sure how to test whether or not I'm getting a null pointer. How do I do so?
Logically speaking, since i set the color of the dialog for all players previously, it shouldn't matter what int I put for lp_player because they should all be seeing the same color.
I'm pretty convinced its returning a color with 3 0.0 values to me. But I can't verify it as I'm not sure how to check.
Edit: Okay.. I managed to get it working on a separate test map. Doesn't make sense why it doesn't work on the map I need it to work in though..
This should work:
I can't explain why this works or not for you, I've never worked with interface elements.
@MTops: Go
Figured it out. you were right, its most likely null pointer related. I was trying to index a struct with a variable i before setting i by accident -_- Thanks for the help!