|
|
And again one of my simple questions C_TRACE
#237403
11/20/08 01:50
11/20/08 01:50
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
OP
 
X
|
OP
 
X
Joined: Jul 2008
Posts: 2,107
Germany
|
I want to use this line from the manual: c_trace(my.x,your.x,IGNORE_ME|IGNORE_PASSABLE|ACTIVATE_SHOOT); It "shoots" from my.x to your.x. But i want to shoot a line from my.x ahead. I dont know how to make this. What should i use instead of your.x ? I want to create a very simply weapon that just shoots from my.pos or camera.pos in front of the player. I know its easy for u gods out there  Edit Shooting to the ground like in the manual to check the floor would be easy. But shooting in front kills my brain cause the player can look around.
Last edited by rayp; 11/20/08 01:53.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: And again one of my simple questions C_TRACE
[Re: rayp]
#237404
11/20/08 02:07
11/20/08 02:07
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
You could use while(1) { VECTOR trace_target; vec_set(trace_target,vector(5000,0,0)); // the weapon has a firing range of 5000 quants vec_rotate(trace_target, camera.pan);
c_trace (my.x,trace_target),IGNORE_ME|IGNORE_PASSABLE); wait(1); }
works for me. You can check out the ent_decal in the manual this is basicaly that just cut out the trace.
Last edited by GamerX; 11/20/08 02:10.
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Re: And again one of my simple questions C_TRACE
[Re: GamerX]
#237408
11/20/08 02:20
11/20/08 02:20
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
OP
 
X
|
OP
 
X
Joined: Jul 2008
Posts: 2,107
Germany
|
thanx for quick reply im testing... ive done this
ACTION __Main_Gun_Fire {
vec_set(temp,vector(5000,0,0)); // the weapon has a firing..
vec_rotate(temp, player.pan);
c_trace (player.x,temp,IGNORE_ME|IGNORE_PASSABLE);
}
on_mouse_left __Main_Gun_Fire;
first ive used VECTOR trace_target. But it says "UNKOWN KEYWORD VECTOR" so i used temp ? And ive used player.x (my player model) because my.x is empty in this case. But it wont hit my entity (sprite) ?
Last edited by rayp; 11/20/08 02:29.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: And again one of my simple questions C_TRACE
[Re: rayp]
#237410
11/20/08 02:33
11/20/08 02:33
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
Well you are proly using C-script the code was lite-c but it should still be able to be changed to work.
What do you mean it wont hit your entity? Something in front of you?Can enplane a little better please.
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Re: And again one of my simple questions C_TRACE
[Re: rayp]
#237414
11/20/08 02:39
11/20/08 02:39
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
Do you have ACTIVATE_SHOOT in the c_trace because up there you don't.
Put this right after the c_trace to see if it at least tracing right.
draw_point3d(hit.x,vector(50,50,255),100,3);
Last edited by GamerX; 11/20/08 02:41.
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Re: And again one of my simple questions C_TRACE
[Re: GamerX]
#237417
11/20/08 02:48
11/20/08 02:48
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
OP
 
X
|
OP
 
X
Joined: Jul 2008
Posts: 2,107
Germany
|
VERY GOOD! Ive forgotten ACTIVATE_SHOOT! Thought it works now...but still my entity is not hit.  Nothing works in the last time...i should shut down my computer next time 
ACTION __Main_Gun_Fire {
vec_set(temp,vector(5000,0,0)); // the weapon has a firing range of 5000 quants
vec_rotate(temp, player.pan);
c_trace (player.x,temp,IGNORE_ME|IGNORE_PASSABLE|ACTIVATE_SHOOT);
}
on_mouse_left __Main_Gun_Fire;
And the entity
ACTION Sprite_Event {
IF(EVENT_TYPE==EVENT_SHOOT) {
ENT_MORPH(ME,"leftf+23.tga");
MY.SKILL3=4;
MY._FORCE=0;
}
..
}
...
..
ACTION THE_SPRITE_TO_HIT {
MY.ENABLE_SHOOT=ON;
MY.EVENT=Sprite_Event;
..
Ive added draw_point3d(target.x,vector(50,50,255),100,3); and the trace seams to went into the floor. When i look down and go near to the entity i can hit it
Last edited by rayp; 11/20/08 02:51.
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: And again one of my simple questions C_TRACE
[Re: rayp]
#237419
11/20/08 02:54
11/20/08 02:54
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
OP
 
X
|
OP
 
X
Joined: Jul 2008
Posts: 2,107
Germany
|
Now it works! Thanx for ure great help man! At 04:00 in germany  working code
ACTION __Main_Gun_Fire {
vec_set(temp,vector(5000,0,0)); // the weapon has a firing range of 5000 quants
vec_rotate(temp, camera.pan);
c_trace (camera.x,temp,IGNORE_ME|IGNORE_PASSABLE|ACTIVATE_SHOOT);
draw_point3d(target.x,vector(50,50,255),100,3);
}
on_mouse_left __Main_Gun_Fire;
changed player to camera 
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Re: And again one of my simple questions C_TRACE
[Re: rayp]
#237420
11/20/08 02:56
11/20/08 02:56
|
Joined: Aug 2008
Posts: 218 U.S.
GamerX
Member
|
Member
Joined: Aug 2008
Posts: 218
U.S.
|
Ahh glad to help waiting for the new southpark lol.
"You may never know what results come of your action, but if you do nothing there will be no result." -Mahatma Gandhi
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|