Can ent_morph be used with type PANEL* ?

Posted By: bpc31

Can ent_morph be used with type PANEL* ? - 04/13/11 07:02

I keep getting 'Invalid arguments in set_current_car'

Code:
PANEL* car_pan =
{
	pos_x = 30;
	pos_y = 120;
	bmap = "car1.bmp";
	layer = 100;
	flags = SHOW;
}

function set_current_car()
{
       ent_morph(car_pan, "car2.bmp");
}


Posted By: bpc31

Re: Can ent_morph be used with type PANEL* ? - 04/13/11 07:54

I found another way to do this:

BMAP* car = "car2.bmp";

function set_current_car()
{
//ent_morph(car_pan, car);
car_pan.bmap = car;
}

However still curious if ent_morph can be used on panels...
Posted By: alibaba

Re: Can ent_morph be used with type PANEL* ? - 04/13/11 09:51

No it canīt be used for panels. As the name says ENT_morph so itīs only for entites wink
Posted By: Iglarion

Re: Can ent_morph be used with type PANEL* ? - 04/13/11 15:33

If this not work directly with bmp make some simple panel model in MED and then put this panel in model like skin. Now you can use ent_morph for change panels (models). Best thing is when you one time set entity (panel) positions, this work good on all resolution. I use something like this in my game.

If you want use entity istended of panel, you can try next:
Code:
ENTITY* car_pan = {
	type = "carpanel.mdl";
	layer = 5;
	flags = SHOW;
	VIEW = camera;
	pan = 270;
	x = 400; // here set your panel position
	y = 300;
	z = 200;
}


and later when you want change panel:
Code:
if (show_car == 1)   { ent_morph(car_pan,"carpanel2.mdl"); }


Posted By: Redeemer

Re: Can ent_morph be used with type PANEL* ? - 04/13/11 15:43

Panels are completely different type structures compared to entities. You can't expect to use a PANEL* in a function that specifically requires an ENTITY* any more than you can expect to use a BMAP* where you need a STRING*.

What you need to do is use bmap_load or something to load a bitmap into your car_panel.bmap.
© 2024 lite-C Forums