c_move and prticle funcitons

Posted By: PlaystationThree

c_move and prticle funcitons - 11/14/08 08:27

I'm makig an FPS style gam and am using particles to create explosions. I used c_move to move my bullet from the camera point forewards and the bullet stops at the first thing it hits. but when i want to make an explosion using my.x as the positon, it always create the explosion at the start point of the c_move when hitting an entity, but if it hits a wall it does fine. any ideas as to why this is happening?
Posted By: MrGuest

Re: c_move and prticle funcitons - 11/15/08 13:11

post the code you have

at a guess i think you're just getting the coordinates too early
Posted By: EvilSOB

Re: c_move and prticle funcitons - 11/15/08 14:35

do as mrguest says, it sounds like you are getting
tangled in the me & you pointers. Easy to do when playing with collisions.
Posted By: PlaystationThree

Re: c_move and prticle funcitons - 11/16/08 01:29

Ok here it is:

action bulletAct(){
var temp;
set(me,TRANSLUCENT);
my.alpha = 0;
my.skill1 = bullet;
my.pan = camera.pan;
my.roll = camera.roll;
my.tilt = camera.tilt;

my.pan -= accuVar/2;
my.roll -= accuVar/2;
my.tilt -= accuVar/2;

my.pan += integer(random(accuVar*10))/10;
my.roll += integer(random(accuVar*10))/10;
my.tilt += integer(random(accuVar*10))/10;

you = player;
c_move(me,vector(range,0,0),nullvector,IGNORE_PASSABLE | IGNORE_PASSENTS | IGNORE_YOU);
set(me,PASSABLE);
wait(1);
you = player;
reset(me,PASSABLE);
c_trace(camera.x,my.x,IGNORE_YOU | IGNORE_PASSABLE);
effect(effect_explosion,50,target,nullvector);
set(my,PASSABLE);
wait(-1);
ent_remove(me);
}
Posted By: EvilSOB

Re: c_move and prticle funcitons - 11/16/08 03:18

I THINK you need to change your c_trace command to
c_trace(camera.x,my.x,IGNORE_YOU | IGNORE_PASSABLE | IGNORE_ME);
Posted By: Ottawa

Re: c_move and prticle funcitons - 11/17/08 00:51

Hi!

I believe that the "var temp;" is already
included in GameStudio.
You are redefining it in your action and there
might be a conflict.

Ottawa smile
Posted By: Uhrwerk

Re: c_move and prticle funcitons - 11/17/08 01:08

No, that is not correct. If you define a variable "temp" in any of your functions, this is totally valid. It just creates a new local variable with the name "temp". The only drawback is then that you can't access the global variable temp.
Posted By: Ottawa

Re: c_move and prticle funcitons - 11/17/08 01:14

Hi Uhrwerk

Thanks for the info. smile


Ottawa
Posted By: PlaystationThree

Re: c_move and prticle funcitons - 11/17/08 05:19

Nope... I tried IGNORE_ME but the problem is still there.
© 2023 lite-C Forums