|
|
A 3D entity MDL as a Panel "life meter"
#323997
05/18/10 21:37
05/18/10 21:37
|
Joined: Apr 2007
Posts: 125 Brazil - São Paulo
Ericmor
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
|
Panels only use bitmaps, i was under the impression that it could be used with an entity 3d mdl model too. I wanted to start with an 3D animated life meter, but i simply couldn't find ANY template or related function to make a 3d entity placed on top of all rendered elements in a view. I even made a 3D animated life meter. I could swear that this was possible... am i hallucinating? keeping the life meter as a normal 3d scene entity in a specific position to the camera will imply on it getting stuck inside map entityes and other models during exploration - not cool. I was planning on making all menus in a 3D fashion - equiping the character with a rotating 3d avatar oblivion-style, etc... Maybe the solution is to enclose the menu elements in a separate 'room' with a camera, and render them in an extra view ontop of the main view like a car mirror?
|
|
|
Re: A 3D entity MDL as a Panel "life meter"
[Re: Ericmor]
#323999
05/18/10 21:42
05/18/10 21:42
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
You are looking for view entities, here an example from the manual:
ENTITY* compass_panel = { type = "compass.mdl"; layer = 2; // display above panels with layer 1 flags2 = SHOW; // visible on screen from the start x = 100; // place 100 quants ahead of the view y = -50; // 50 to the right z = 0; // and center vertically }
EDIT: @Uhrwerk: Hehe, I was looking for that page. Btw. how to search the online manual?
Last edited by Superku; 05/18/10 21:53.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: A 3D entity MDL as a Panel "life meter"
[Re: Uhrwerk]
#324011
05/18/10 22:47
05/18/10 22:47
|
Joined: Apr 2007
Posts: 125 Brazil - São Paulo
Ericmor
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
|
Agh, the explanation in the standard syntax manual made it appear like a SKY model only instruction... damn, i KNEW something was wrong :S The 'entity*...' example code doesn't work fot me(Gamestudio crashes right in the loading), is that Lite C? I'm using wdl on my game Thanks for the info, guys... now to create a code to place the damn .mdl as a life meter while mixing the animation frames correctly... Thanks again.
|
|
|
Re: A 3D entity MDL as a Panel "life meter"
[Re: Ericmor]
#324012
05/18/10 23:41
05/18/10 23:41
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Yes, the example is Lite-C. But there is an example for C-Script in the manual right under the entry "Entities".
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: A 3D entity MDL as a Panel "life meter"
[Re: Uhrwerk]
#324024
05/19/10 02:09
05/19/10 02:09
|
Joined: Apr 2007
Posts: 125 Brazil - São Paulo
Ericmor
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
|
LOL, i managed!  This is what i came up with:
function create_LIFE_METER()
{
if(LIFE_METER!=null){return;}
LIFE_METER = ent_createlayer("LIFE_METER.mdl",0,2);
life_meter();
return;
}
function life_meter()
{
while(LIFE_METER==null||camera_arrow_1==null){wait(1);}
LIFE_METER.y = 180;
LIFE_METER.z = 100;
LIFE_METER.x = 366;
LIFE_METER.pan = 300;
LIFE_METER.scale_x = 0.5;
LIFE_METER.scale_y = 0.5;
LIFE_METER.scale_z = 0.5;
return;
}
And there's even a small routine to shrink it back and forth from the top view:
var LIFE_METER_size=0;
var LIFE_METER_taswitch=0;
on_j = LIFE_METER_MOVES();
function LIFE_METER_MOVES()
{
if(LIFE_METER_taswitch==1){return;}
while(1)
{
if(LIFE_METER_size==0)
{ if(LIFE_METER_taswitch==0){LIFE_METER_taswitch=1;}
if(LIFE_METER.scale_x<1.0){LIFE_METER.scale_x+=0.1* time_step;}
if(LIFE_METER.scale_y<1.0){LIFE_METER.scale_y+=0.1* time_step;}
if(LIFE_METER.scale_z<1.0){LIFE_METER.scale_z+=0.1* time_step;}
if(LIFE_METER.y>=150){LIFE_METER.y-=7*time_step;}
if(LIFE_METER.z>=81){LIFE_METER.z-=5*time_step;}
if(LIFE_METER.tilt>=0 && LIFE_METER_taswitch==1){LIFE_METER.roll+=30*time_step;}
if(LIFE_METER.tilt>=25 && LIFE_METER_taswitch==1){LIFE_METER_taswitch=2;}
if(LIFE_METER.tilt>0 && LIFE_METER_taswitch==2){LIFE_METER.roll-=30*time_step;}
if(LIFE_METER.tilt<=0 && LIFE_METER_taswitch==2){LIFE_METER_taswitch=1;}
if(LIFE_METER.scale_x>=1.0){LIFE_METER.scale_x=1.0;LIFE_METER.scale_y=1.0;LIFE_METER.scale_z=1.0;LIFE_METER.y=150;LIFE_METER.z=80;LIFE_METER_size=1;LIFE_METER.roll = 0;LIFE_METER_taswitch=0;return;}
}
if(LIFE_METER_size==1)
{ if(LIFE_METER_taswitch==0){LIFE_METER_taswitch=1;}
if(LIFE_METER.scale_x>0.5){LIFE_METER.scale_x-=0.1* time_step;}
if(LIFE_METER.scale_y>0.5){LIFE_METER.scale_y-=0.1* time_step;}
if(LIFE_METER.scale_z>0.5){LIFE_METER.scale_z-=0.1* time_step;}
if(LIFE_METER.y<=180){LIFE_METER.y+=7*time_step;}
if(LIFE_METER.z<=100){LIFE_METER.z+=5*time_step;}
if(LIFE_METER.tilt>=0 && LIFE_METER_taswitch==1){LIFE_METER.roll-=30*time_step;}
if(LIFE_METER.tilt<=-25 && LIFE_METER_taswitch==1){LIFE_METER_taswitch=2;}
if(LIFE_METER.tilt<0 && LIFE_METER_taswitch==2){LIFE_METER.roll+=30*time_step;}
if(LIFE_METER.tilt>=0 && LIFE_METER_taswitch==2){LIFE_METER_taswitch=1;}
if(LIFE_METER.scale_x<=0.5){LIFE_METER.scale_x=0.5;LIFE_METER.scale_y=0.5;LIFE_METER.scale_z=0.5;LIFE_METER.y=180;LIFE_METER.z=100;LIFE_METER_size=0;LIFE_METER.roll = 0;LIFE_METER_taswitch=0;return;}
}
wait(1);
}
}
Thanks again for the quick help folks!
|
|
|
Re: A 3D entity MDL as a Panel "life meter"
[Re: Ericmor]
#324025
05/19/10 02:12
05/19/10 02:12
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
Looks cool. It's maybe just a little to big in proportion to the very slim character. Glad we could help. :-)
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: A 3D entity MDL as a Panel "life meter"
[Re: Uhrwerk]
#324026
05/19/10 02:20
05/19/10 02:20
|
Joined: Apr 2007
Posts: 125 Brazil - São Paulo
Ericmor
OP
Member
|
OP
Member
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
|
That's were the LIFE_METER shrink function comes in hand  Uh... actually, i'm using a wide monitor, and gamestudio is somehow capturing screenshots with that resolution distortion... real screen is a bit more stretched back here. I'm also placing a 'benchmark' level start in the game when it first runs, so the player can select screen and detail resolutions according to his/her tastes.
|
|
|
|