|
3 registered members (TipmyPip, USER0328, 1 invisible),
5,962
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
problem with panels!
#132454
05/28/07 09:11
05/28/07 09:11
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
Okay.. I'm trying to create hp bars for everyone entity in the game... well not every entity.. but you know the typical stuff.. monsters..players.. The problem is the code only seems to work if I use a global variable... and I don't understand why... here is my code: Code:
panel* hp_bar_panel_pointer; define hp_bar_handle,skill45;
//the following is from inside my player script var hp_bar_x = 0; hp_bar_panel_pointer = pan_create("window(10, 10, 50, 5, hp_bar_bmp, hp_bar_x, 0);flags = visible; size_x = 100;size_y = 5;",1); my.hp_bar_handle = handle(hp_bar_panel_pointer); hp_bar_x=name_ent1(hp_bar_x); //------------------------------------------------------------ function name_ent1(hp_bar_x_) { hp_bar_panel_pointer = ptr_for_handle(my.hp_bar_handle); vec_set (temp, my.x); temp.z += 40; if(c_trace(my.x,camera.x,ignore_me|ignore_models|ignore_passents)==0&&my.health!= 0&&my.health_total!=0) { vec_to_screen (temp, camera); name1_txt.pos_x = temp.x; name1_txt.pos_y = temp.y; hp_bar_panel_pointer.pos_x=name1_txt.pos_x; hp_bar_panel_pointer.pos_y=name1_txt.pos_y+10; name1_txt.visible = on; hp_bar_panel_pointer.visible = on; hp_bar_x_ = 50 - int(((my.health/my.health_total)/2)*100); return(hp_bar_x_); } else { name1_txt.visible = off; hp_bar_panel_pointer.visible = off; } }
if i make hp_bar_x a global variable and don't go bother with returning from name_ent1 everything seems to work fine... but I ABSOLUTELY NEED this to work with hp_bar_x being a local variable. I even tried doing this as hp_bar_x being a skill and I still couldn't get it to work... maybe someone can see something i can't. I'm starting to think of this as a bug. [edit] btw this is a logic error not syntex incase i wasn't clear on that... [/edit]
Last edited by PrenceOfDarkness; 05/28/07 09:14.
"There is no problem that can't be solved with time and determination." -me prenceofdarkness for instant messages on AIM.
Looking for a model designer PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
|
|
|
Re: problem with panels!
[Re: testDummy]
#132456
05/28/07 15:38
05/28/07 15:38
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
There have been other stupid glitches but I've found stupid ways to get around them... AND MAN... DO I MEAN STUPID GLITCHES!
Regardless... i'm kind of tired of wasting my time argueing with conitec... after buying pro and getting my so hard earn tech support... they gave me the run around for three weeks.. ("may take upto two days for you two get an answer"..."Oops... the tech 'guy' is on vacation.. he wont be back until next week")
so help from conitec is out of the answer... i get the feeling sometimes ppl on the forum know more about the engine then conitec -_-'
edit: besides... I have nothing left to play with... they already got me to buy pro..
Last edited by PrenceOfDarkness; 05/28/07 15:39.
"There is no problem that can't be solved with time and determination." -me prenceofdarkness for instant messages on AIM.
Looking for a model designer PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
|
|
|
Re: problem with panels!
[Re: PrenceOfDarkness]
#132457
05/29/07 18:19
05/29/07 18:19
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
As it would turn out... window properties can't be local; must be global...
"There is no problem that can't be solved with time and determination." -me prenceofdarkness for instant messages on AIM.
Looking for a model designer PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
|
|
|
Re: problem with panels!
[Re: testDummy]
#132460
05/30/07 06:12
05/30/07 06:12
|
Joined: Aug 2004
Posts: 1,305 New York
PrenceOfDarkness
OP
Serious User
|
OP
Serious User
Joined: Aug 2004
Posts: 1,305
New York
|
I found a work around that seems to work... More or less... i have a set number of panels hopefully a bit more then will ever be present at the same time on the screen, and I just set them to a character in the game... This seems to work for now. I guess as long as it looks right it doesn't matter how you do it.
"There is no problem that can't be solved with time and determination." -me prenceofdarkness for instant messages on AIM.
Looking for a model designer PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
|
|
|
|