2 registered members (AndrewAMD, TipmyPip),
13,353
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: changing entities
[Re: rtsgamer706]
#304633
01/09/10 13:42
01/09/10 13:42
|
Joined: Mar 2009
Posts: 40
DR_Black
Newbie
|
Newbie
Joined: Mar 2009
Posts: 40
|
Use ent_morph function or animate your asteroid model
every body got some dues in life to pay
|
|
|
Re: changing entities
[Re: DR_Black]
#304639
01/09/10 14:42
01/09/10 14:42
|
Joined: Nov 2007
Posts: 2,568 Germany, BW, Stuttgart
MasterQ32
Expert
|
Expert
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
|
i would try this:
function asteriod_event();
function asteriod()
{
my.emask |= ENABLE_SHOOT;
my.event = asteriod_event;
VECTOR vel;
vec_set(vel,vector(random(2)-1,random(2)-1,random(2)-1));
VECTOR temp;
while(me)
{
vec_set(temp,vel);
vec_normalize(temp,5 * time_step);
vec_add(my.x,temp);
wait(1);
}
}
function asteriod_event()
{
if(event_type == EVENT_SHOOT)
{
ent_create("small_asteroid.mdl",my.x,asteroid);
ent_create("small_asteroid.mdl",my.x,asteroid);
ent_create("small_asteroid.mdl",my.x,asteroid);
ent_remove(me);
}
}
This code will create three asteroids, if the asteroid will be hit.
Last edited by Richi007; 01/09/10 14:43.
|
|
|
Re: changing entities
[Re: DR_Black]
#304676
01/09/10 21:15
01/09/10 21:15
|
Joined: Dec 2009
Posts: 361
rtsgamer706
OP
Senior Member
|
OP
Senior Member
Joined: Dec 2009
Posts: 361
|
getting closer but when my laser (bullet) hits the asteroid it says can't open file. Here is the relevant part of my code:
function remove_asteroid() { var boom_percent = 0; if(event_type == EVENT_IMPACT) { wait (1); ent_remove(me); ent_remove(laser); } }
action asteroid() { ent_create("laser.mdl", vector (26000, 0, 0), laser_fire); rock = me; while (1) { c_move (my, vector(-25*time_step, 0, 0), nullvector, GLIDE); // move the fragment left wait (1); my.emask = (ENABLE_IMPACT); // make entity sensitive for block and entity collision my.event = remove_asteroid; } }
function remove_asteroidbig () { ent_morph (my, rock); }
action asteroid_big() { boulder = me; while (1) { c_move (my, vector(-28*time_step, 0, 0), nullvector, GLIDE); // move the fragment left wait (1); my.emask = (ENABLE_IMPACT); // make entity sensitive for block and entity collision my.event = remove_asteroidbig; } }
thanks for the help
|
|
|
Re: changing entities
[Re: rtsgamer706]
#304678
01/09/10 21:35
01/09/10 21:35
|
Joined: Mar 2009
Posts: 40
DR_Black
Newbie
|
Newbie
Joined: Mar 2009
Posts: 40
|
Try this
var IsAsteriodBig = 1;
function remove_asteroid ();
action asteroid()
{
ent_create("laser.mdl", vector (26000, 0, 0), laser_fire);
while (1)
{
c_move (my, vector(-25*time_step, 0, 0), nullvector, GLIDE); // move the fragment left
wait (1);
my.emask = (ENABLE_IMPACT); // make entity sensitive for block and entity collision
my.event = remove_asteroid;
}
}
function remove_asteroid ()
{
if(event_type == EVENT_IMPACT)
{
if (IsAsteriodBig)
{
ent_morph (me, "asteroidlittle.mdl");
}
else
{
wait (1);
ent_remove(me);
ent_remove(laser);
}
}
}
I didnt test it.I think it will work.
every body got some dues in life to pay
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|