another question about ent_create

Posted By: jigalypuff

another question about ent_create - 05/09/07 17:21

i have looked through the aums for an example of what i am after but can`t find anything. i want to change between two models in game, one is the ship itself

the other is the bridge of the ship

i have a camera code set for 3 views one of which is an fps view (which will be the bridge view) could anyone point me in the right direction for something like this?
the camera to go into fps is actived by 2 btw. i hope i`ve explained this ok
Posted By: Claus_N

Re: another question about ent_create - 05/09/07 17:32

If you want to change a model to another model, use ent_morph
Posted By: jigalypuff

Re: another question about ent_create - 05/09/07 17:43

cool i`ll give that a try and hopefully not have to keep bothering you lol, thanks.
Posted By: jigalypuff

Re: another question about ent_create - 05/09/07 18:58

well i have failed miserably, i found two examples of ent_morph in the aums, unfortunatly it is for explosions and not quite what i need, so i tried this
Code:

function ship_camera()
{
if (key_1 == on) {camera_number = 1;}
if (key_2 == on) {camera_number = 2;}
if (key_3 == on) {camera_number = 3;}
if (camera_number == 1) // top view
{
camera.x = player.x;
camera.y = player.y;
camera.z = player.z + 900; // play with this value
camera.pan = player.pan;
camera.tilt = -90;
}
if (camera_number == 2) // simulated first person view (that's just another isometric view, really)
{
camera.x = player.x -40 * cos(player.pan);
camera.y = player.y - 0 * sin(player.pan);
camera.z = player.z + 0;
camera.pan = player.pan;
camera.tilt = 0;
}
ent_morph(my,bridge_mdl);

if (camera_number == 3) // true isometric view
{
camera.x = player.x - 200 * cos(player.pan); // 200 = distance
camera.y = player.y - 200 * sin(player.pan); // same value here
camera.z = player.z + 150; // above the player
camera.pan = player.pan;
camera.tilt = -27; // look down at the player
}
wait (1);
}


what i hoped for here was when 2 was pressed then the bridge mesh would appear and the ship mesh would be gone, however as soon as i launch the code the bridge mesh is there straight away even though the camera is set to 1 for the start. cheers for any and all help.
Posted By: nipx

Re: another question about ent_create - 05/09/07 19:32

Code:
function ship_camera()
{
if (key_1 == on) {camera_number = 1;}
if (key_2 == on) {camera_number = 2;ent_morph(my,bridge_mdl); }
if (key_3 == on) {camera_number = 3;}
if (camera_number == 1) // top view
{
camera.x = player.x;
camera.y = player.y;
camera.z = player.z + 900; // play with this value
camera.pan = player.pan;
camera.tilt = -90;
}
if (camera_number == 2) // simulated first person view (that's just another isometric view, really)
{
camera.x = player.x -40 * cos(player.pan);
camera.y = player.y - 0 * sin(player.pan);
camera.z = player.z + 0;
camera.pan = player.pan;
camera.tilt = 0;
}


if (camera_number == 3) // true isometric view
{
camera.x = player.x - 200 * cos(player.pan); // 200 = distance
camera.y = player.y - 200 * sin(player.pan); // same value here
camera.z = player.z + 150; // above the player
camera.pan = player.pan;
camera.tilt = -27; // look down at the player
}
wait (1);
}




ent_morph doesnt just change the meshs, it changes the whole model.


dont know if this is what you are looking for but there you placed it, its propably wrong...
Posted By: jigalypuff

Re: another question about ent_create - 05/09/07 19:47

woohoo, that works perfectly mate thanks guys.
© 2024 lite-C Forums