Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, Aku_Aku, 7th_zorro, Ayumi), 1,080 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
the c_move won't move my entity!!! #132323
05/27/07 15:53
05/27/07 15:53
Joined: Mar 2007
Posts: 18
A
ato Offline OP
Newbie
ato  Offline OP
Newbie
A

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 Offline
Member
Pinkhead  Offline
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


I'm 14, NOW! RollingStone Fullversion Rolling Stone won by u19! -> German - Winnerlist
Re: the c_move won't move my entity!!! [Re: Pinkhead] #132325
05/27/07 16:03
05/27/07 16:03
Joined: Mar 2007
Posts: 18
A
ato Offline OP
Newbie
ato  Offline OP
Newbie
A

Joined: Mar 2007
Posts: 18
No errors appears during gameplay.
The WAITT(3); is used to make a delay of firing when you hold down the ctrl key....

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 Offline
Member
Pinkhead  Offline
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;
}




I'm 14, NOW! RollingStone Fullversion Rolling Stone won by u19! -> German - Winnerlist
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
A
ato Offline OP
Newbie
ato  Offline OP
Newbie
A

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: ato] #132328
05/27/07 17:50
05/27/07 17:50
Joined: Jan 2007
Posts: 126
Germany
Pinkhead Offline
Member
Pinkhead  Offline
Member

Joined: Jan 2007
Posts: 126
Germany
Ah ok,
Does my new code work right?


I'm 14, NOW! RollingStone Fullversion Rolling Stone won by u19! -> German - Winnerlist
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
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

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
A
ato Offline OP
Newbie
ato  Offline OP
Newbie
A

Joined: Mar 2007
Posts: 18
yes Fenriswolf! I've missed the loop... Doh! Now works! Pinkhead thanks!

Thank you very much guys!!! :)

Re: the c_move won't move my entity!!! [Re: ato] #132331
05/28/07 07:52
05/28/07 07:52
Joined: Jan 2007
Posts: 126
Germany
Pinkhead Offline
Member
Pinkhead  Offline
Member

Joined: Jan 2007
Posts: 126
Germany
Yeah the loop, i forgot it.
Good Luck by your work, ato!


I'm 14, NOW! RollingStone Fullversion Rolling Stone won by u19! -> German - Winnerlist
Re: the c_move won't move my entity!!! [Re: Pinkhead] #132332
05/28/07 09:44
05/28/07 09:44
Joined: Mar 2007
Posts: 18
A
ato Offline OP
Newbie
ato  Offline OP
Newbie
A

Joined: Mar 2007
Posts: 18
Thank you! I'll post to you a screenshot in this day

Page 1 of 2 1 2

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1