• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Bullettrace
#1
Hello, Nyan Cat

I am going to explain something about this usefull command.

A bullettrace is something like the line that a bullet forms. It has a start and a end. Basically its structure is like this:

Code:
RandomTrace = Bullettrace(start,end,true,self);

The start is obvious what it is: the position from the one it starts.
The end is the position where it ends, Tongue.
The True is a command that will detect players or not, if you want it to detect players put true, if not false.
The self I putted is a entity that wont be affected by the trace, with self, it wont detect the own player or whatever you are using self for.

A example of usage:

Code:
ForwardTrace = Bullettrace(self getEye(),self getEye()+anglestoforward(self getplayerangles())*100000,true,self);

This will find the point that is forward to you at a scale of 100000. If you want to get the position, call it like this:

Code:
ForwardTrace["position"]

You can get the entity that is in that point with:

Code:
ForwardTrace["entity"]

In a bullettrace there is also a fraction, that can have a value beetween 0 and 1, 1 means that the trace has completely crashed against the surface(I am not very sure about this, is just what I tested, correct me if I am wrong)

You can call it like this:
Code:
ForwardTrace["fraction"]

There is also the surfacetype, that is the type of surface that is in the point of the bullettrace, like water,sand or mud:

You can call it like:
Code:
ForwardTrace["surfacetype"]

This is a list of them, I think that is complete, I putted it in alphabetical order:

Code:
asphalt
bark
brick
carpet
cloth
concrete
default
dirt
flesh
foliage
glass
grass
gravel
ice
metal
mud
paper
rock
sand
snow
water
wood

I think that this is all, I hope I helped a bit, if I said something wrong correct me.

Yamato, Awesome
[Image: veovuq.png]
[-] The following 8 users say Thank You to Yamato for this post:
  • AZUMIKKEL, barata, d0h!, DWM|Gdawg, iAegle, Nukem, Pozzuh, tjwjdqls75
  Reply
#2
Fuu

you just ruined something epic I wanted to release with something epic that not everyone knew
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

[-] The following 1 user says Thank You to iAegle for this post:
  • ScHmIdTy56789
  Reply
#3
Didn't know about the ["stuff"]. Thanks you! I think this counts for Black Ops too, yes? Should move/copy it there c:
YouTube 1: Azumikkel - Modding
YouTube 2: DerpShark - Gaming Entertainment
Website: Jensby.me
Contact: im[at]jensby.me
  Reply
#4
Yep, works for black ops.
[Image: MaEIQ.png]
  Reply
#5
Overall this is a nice tutorial for people who don;t know about this. (I do Nyan Cat )

P.S.
trace["position"] is where the trace ends at an object/material you can't shoot through, not always at
Code:
self getEye()+anglestoforward(self getplayerangles())*100000
[Image: b_560_95_1.png]
[-] The following 2 users say Thank You to Nukem for this post:
  • d0h!, Yamato
  Reply
#6
can I make it so it ignores every player not just self?

like
Code:
bulletTrace( eyePos, blabla_end, true, level.players );
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

  Reply
#7
(08-24-2011, 19:00)iAegle Wrote: can I make it so it ignores every player not just self?

like
Code:
bulletTrace( eyePos, blabla_end, true, level.players );

never tried, Undecided
[Image: veovuq.png]
  Reply
#8
(08-24-2011, 19:00)iAegle Wrote: can I make it so it ignores every player not just self?

like
Code:
bulletTrace( eyePos, blabla_end, true, level.players );

Sorry for the late reply but I just had to post this Troll

Code:
bulletTrace( eyePos, blabla_end, FALSE, self);
is what you want Fuck yea!
(07-18-2011, 19:39)Yamato Wrote: The True is a command that will detect players or not, if you want it to detect players put true, if not false.
[-] The following 1 user says Thank You to some_kid for this post:
  • iAegle
  Reply
#9
(09-12-2011, 01:39)some_kid Wrote:
(08-24-2011, 19:00)iAegle Wrote: can I make it so it ignores every player not just self?

like
Code:
bulletTrace( eyePos, blabla_end, true, level.players );

Sorry for the late reply but I just had to post this Troll
Code:
bulletTrace( eyePos, blabla_end, FALSE, self);
is what you want Fuck yea!
(07-18-2011, 19:39)Yamato Wrote: The True is a command that will detect players or not, if you want it to detect players put true, if not false.

I think he wants to ignore people he wants so the bullettrace won't crash and complete, make another variable like this:
Code:
Ignoretracem = ignoretracem();
bulletTrace( eyePos, blabla_end, FALSE, Ignoretracem);


Then put something like this:
Code:
ignoretracem()
{
if(blablabla)
return variable;
}
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Help if end bullettrace is bigger/passed the map aname 7 1,868 09-06-2011, 13:50
Last Post: AZUMIKKEL

Forum Jump:


Users browsing this thread: 1 Guest(s)