Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, 7th_zorro, ozgur, Quad), 841 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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 Offline OP
Member
Ericmor  Offline 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 Offline
Senior Expert
Superku  Offline
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: Ericmor] #324000
05/18/10 21:43
05/18/10 21:43
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Just define the entity as a view entity and give it a high layer.

http://www.conitec.net/beta/aent_createlayer.htm

EDIT: :PPP


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] #324011
05/18/10 22:47
05/18/10 22:47
Joined: Apr 2007
Posts: 125
Brazil - São Paulo
Ericmor Offline OP
Member
Ericmor  Offline 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 frown
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 Offline
Expert
Uhrwerk  Offline
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 Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
LOL, i managed!



This is what i came up with:

Code:
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:

Code:
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 Offline
Expert
Uhrwerk  Offline
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 Offline OP
Member
Ericmor  Offline OP
Member

Joined: Apr 2007
Posts: 125
Brazil - São Paulo
That's were the LIFE_METER shrink function comes in hand laugh
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.

Re: A 3D entity MDL as a Panel "life meter" [Re: Ericmor] #324028
05/19/10 02:27
05/19/10 02:27
Joined: Apr 2006
Posts: 624
DEEP 13
badapple Offline
User
badapple  Offline
User

Joined: Apr 2006
Posts: 624
DEEP 13
looks excellent , did you make all the content? it reminds me of quest64 for some reason , great work so far.

Re: A 3D entity MDL as a Panel "life meter" [Re: badapple] #324037
05/19/10 05:52
05/19/10 05:52
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Yes, all pictures from you looks great. Keep on your work...

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1