|
|
the c_move won't move my entity!!!
#132323
05/27/07 15:53
05/27/07 15:53
|
Joined: Mar 2007
Posts: 18
ato
OP
Newbie
|
OP
Newbie
Joined: Mar 2007
Posts: 18
|
hello! I'm working (for my excercises) on a spaceship shooter. See below, the code relative to firing, please: Code:
... ... if(key_ctrl && firing==0) { firing = 1; ent_create("fuoco.mdl",vector(my.x,my.y+32,my.z),fuoco); } ... ...
my is related to the spaceship. And see this following code: Code:
var firing = 0; var s_laser;
sound laser <laser1.wav>;
function event_fuoco() { firing = 0; ent_remove(my); }
function f_fuoco() { temp.x = 0; temp.y = 12*time; temp.z = 0; c_move(e_fuoco, temp, nullvector, IGNORE_YOU); // THIS DON'T WORKS... s_laser = snd_play(laser,30,0); waitt(3); // firing = 0; }
action fuoco { e_fuoco = my; e_fuoco.enable_block = ON; e_fuoco.event = event_fuoco; e_fuoco.scale_x = 0.066; e_fuoco.scale_y = 0.066; e_fuoco.scale_z = 0.066; f_fuoco(); }
I'll only see the fire identity appearing but don't move upward... Any idea? Thank you! 
|
|
|
Re: the c_move won't move my entity!!!
[Re: ato]
#132324
05/27/07 16:02
05/27/07 16:02
|
Joined: Jan 2007
Posts: 126 Germany
Pinkhead
Member
|
Member
Joined: Jan 2007
Posts: 126
Germany
|
Have the oringinal script that, too? Code:
function f_fuoco() { temp.x = 0; temp.y = 12*time; temp.z = 0; c_move(e_fuoco, temp, nullvector, IGNORE_YOU); // THIS DON'T WORKS... s_laser = snd_play(laser,30,0); waitt(3); // firing = 0; }
When you run the game (or something other) a error message appears? Sorry for my bad english, Pinkhead
|
|
|
Re: the c_move won't move my entity!!!
[Re: ato]
#132326
05/27/07 16:13
05/27/07 16:13
|
Joined: Jan 2007
Posts: 126 Germany
Pinkhead
Member
|
Member
Joined: Jan 2007
Posts: 126
Germany
|
Oh sorry, i don't know that waiTT(3); exist... I'm not a expert.  Test it so: Maybe it works. Code:
var firing = 0; var s_laser;
sound laser <laser1.wav>;
function event_fuoco() { firing = 0; ent_remove(my); }
action fuoco { e_fuoco = my; e_fuoco.enable_block = ON; e_fuoco.event = event_fuoco; e_fuoco.scale_x = 0.066; e_fuoco.scale_y = 0.066; e_fuoco.scale_z = 0.066; f_fuoco(); }
function f_fuoco() { temp.x = 0; temp.y = 12*time; temp.z = 0; c_move(e_fuoco,temp,nullvector,IGNORE_YOU); s_laser = snd_play(laser,30,0); waitt(3); // firing = 0; }
|
|
|
Re: the c_move won't move my entity!!!
[Re: Pinkhead]
#132327
05/27/07 17:49
05/27/07 17:49
|
Joined: Mar 2007
Posts: 18
ato
OP
Newbie
|
OP
Newbie
Joined: Mar 2007
Posts: 18
|
the difference by wait() and waitt() is: wait(n) - waits for n frames waitt(n) - waits for n ticks 
|
|
|
Re: the c_move won't move my entity!!!
[Re: Pinkhead]
#132329
05/27/07 19:00
05/27/07 19:00
|
Joined: Jan 2007
Posts: 221
Fenriswolf
Member
|
Member
Joined: Jan 2007
Posts: 221
|
Hi, you need a while loop in your script. Without a loop your c_move instruction is called only once. Example: Code:
function f_fuoco() { s_laser = snd_play(laser,30,0); while(my) { // repeat as long as this entity exists temp.x = 0; temp.y = 12*time; temp.z = 0; c_move(e_fuoco, temp, nullvector, IGNORE_YOU); wait(1); } }
|
|
|
Re: the c_move won't move my entity!!!
[Re: Fenriswolf]
#132330
05/28/07 07:10
05/28/07 07:10
|
Joined: Mar 2007
Posts: 18
ato
OP
Newbie
|
OP
Newbie
Joined: Mar 2007
Posts: 18
|
yes Fenriswolf! I've missed the loop...  Doh! Now works! Pinkhead thanks! Thank you very much guys!!!  :)
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|