Animate view entities can it be done?

Posted By: D3D

Animate view entities can it be done? - 01/28/08 19:01

Have created a demo login. The player can select his/her team red/blue and depending on a number will show a certain view entity. Display the entity is no problem, but can I also animate view entities? I mean just rotate the model.
Posted By: Scorpion

Re: Animate view entities can it be done? - 01/28/08 19:09

of, just do it as you would animate any other entity :]

Code:
while(1)
{
nameofscreenent.pan += 5*time_step;
wait(1);
}


Posted By: D3D

Re: Animate view entities can it be done? - 01/28/08 22:42

Ok I tried and it lockup the engine. With ent_create you can pass a function with the entity, but not with view entities? The function below is just to test if it's working or not.

Code:
ENTITY* avatar_onscreen =
{
type = "default.mdl";
layer = 20;
flags2 = VISIBLE; // visible on screen from the start
flags = VISIBLE; client_id = camera; // same camera parameters as the default view
x = 100; // place 100 quants ahead of the view
y = -45; // 50 to the right
z = 0; // and center vertically
}

function xyz()
{
if(value==88)
{
// number 88 = blueteam
ent_morph(avatar_onscreen,"blueteam.mdl");

while(1)
{
avatar_onscreen.pan += 5*time_step;
}
wait(1);
}
}


© 2024 lite-C Forums