Skip to content
Deyan Dobromirov edited this page Feb 6, 2020 · 54 revisions

What does this extension include?

Tracers with hit and ray configuration. The difference with wire rangers is that this is a dedicated class being initialized once and used as many times as it is needed, not creating an instance on every E2 tick and later wipe that instance out. It can extract every aspect of the trace result structure returned and it can be sampled locally ( origin and direction relative to entity or pos/dir/ang ) or globally ( entity is not available and pos/dir/ang are treated world-space data ). Also, it has better performance than the regular wire rangers.

What is this thing designed for?

The FTrace class consists of fast performing traces object-oriented instance that is designed to be @persistand initialized in expression first() || dupefinished(). That way you create the tracer instance once and you can use it as many times as you need, without creating a new one.

What console variables can be used to setup it?

wire_expression2_ftrace_skip > Contains trace generator blacklisted methods ( ex. GetSkin/GetModel/IsVehicle )
wire_expression2_ftrace_only > Contains trace generator whitelisted methods ( ex. GetSkin/GetModel/IsVehicle )
wire_expression2_ftrace_dprn > Stores the default status output messages streaming destination
wire_expression2_ftrace_enst > Contains flag that enables status output messages

How to create an instance then?

You can create a trace object by calling one of the dedicated creators newFTrace below whenever you prefer to attach it to an entity or you prefer not to use the feature. When sampled locally, it will use the attachment entity to orient its direction and length in pure Lua. You can also call the class constructor without an entity to make it world-space based. Remember that negating the trace length will result in negating the trace direction. That is used because the trace length must always be positive so the direction is reversed instead.

Do you have an example by any chance?

The internal type of the class is xft and internal expression type ftrace, so to create a tracer instance you can take a look at the example.

Can you show me the methods of the class?

The description of the API is provided in the table below.

        Instance creator          Out   Description 
newFTrace(image) image Returns flash trace relative to the world by zero origin position, zero direction vector, zero length distance
newFTrace(image) image Returns flash trace relative to the world by length distance, direction vector, zero length distance
newFTrace(image) image Returns flash trace relative to the world by origin position, zero direction vector, zero length distance
newFTrace(image,image) image Returns flash trace relative to the world by origin position, direction vector from up, length distance
newFTrace(image,image) image Returns flash trace relative to the world by origin position, direction vector, length distance from direction vector
newFTrace(image,image,image) image Returns flash trace relative to the world by origin position, direction vector, length distance
noFTrace(image) image Returns invalid flash trace object
           Class methods            Out  Description 
image:addEntHitOnly(image) image Adds the entity to the flash trace internal only hit list
image:addEntHitSkip(image) image Adds the entity to the flash trace internal ignore hit list
image:addHitOnly(image,image) image Adds the option to the flash trace internal hit only list
image:addHitOnly(image,image) image Adds the option to the flash trace internal hit only list
image:addHitSkip(image,image) image Adds the option to the flash trace internal ignore hit list
image:addHitSkip(image,image) image Adds the option to the flash trace internal ignore hit list
image:dumpItem(image) image Dumps the flash trace to the chat area by number identifier
image:dumpItem(image) image Dumps the flash trace to the chat area by string identifier
image:dumpItem(image,image) image Dumps the flash trace by number identifier in the specified area by first argument
image:dumpItem(image,image) image Dumps the flash trace by string identifier in the specified area by first argument
image:getBase(image) image Returns the flash trace base attachment entity if available
image:getBone(image) image Returns the flash trace trace-result PhysicsBone ID number
image:getChip(image) image Returns the flash trace auto-assigned expression chip entity
image:getCollideGroup(image) image Returns flash trace trace collision group enums COLLISION_GROUP
image:getCopy(image) image Returns flash trace copy instance of the current object
image:getCopy(image) image Returns flash trace copy instance of the current object using other entity
image:getCopy(image,image) image Returns flash trace copy instance of the current object using other entity and length
image:getCopy(image,image) image Returns flash trace copy instance of the current object using other entity and origin
image:getCopy(image,image,image) image Returns flash trace copy instance of the current object using other entity, origin and length
image:getCopy(image,image,image) image Returns flash trace copy instance of the current object using other entity, origin and direction
image:getCopy(image,image,image,image) image Returns flash trace copy instance of the current object using other entity, origin, direction and length
image:getCopy(image) image Returns flash trace copy instance of the current object using other length
image:getCopy(image) image Returns flash trace copy instance of the current object using other origin
image:getCopy(image,image) image Returns flash trace copy instance of the current object using other origin and length
image:getCopy(image,image) image Returns flash trace copy instance of the current object using other origin and direction
image:getCopy(image,image,image) image Returns flash trace copy instance of the current object using other origin, direction and length
image:getDir(image) image Returns flash trace direction vector
image:getDirLocal(image) image Returns flash trace world direction vector converted to base attachment entity local axis
image:getDirLocal(image) image Returns flash trace world direction vector converted to angle local axis
image:getDirLocal(image) image Returns flash trace world direction vector converted to entity local axis
image:getDirWorld(image) image Returns flash trace local direction vector converted to base attachment entity world axis
image:getDirWorld(image) image Returns flash trace local direction vector converted to angle world axis
image:getDirWorld(image) image Returns flash trace local direction vector converted to entity world axis
image:getEntity(image) image Returns the flash trace trace-result Entity entity
image:getFraction(image) image Returns the flash trace trace-result Fraction in the interval [0-1] number
image:getFractionLS(image) image Returns the flash trace trace-result FractionLeftSolid in the interval [0-1] number
image:getFractionLen(image) image Returns the flash trace trace-result Fraction multiplied by its length distance number
image:getFractionLenLS(image) image Returns the flash trace trace-result FractionLeftSolid multiplied by its length distance number
image:getHitBox(image) image Returns the flash trace trace-result HitBox number
image:getHitGroup(image) image Returns the flash trace trace-result HitGroup group ID number
image:getHitNormal(image) image Returns flash trace trace-result surface HitNormal vector
image:getHitPos(image) image Returns the flash trace trace-result HitPos location vector
image:getHitTexture(image) image Returns the flash trace trace-result HitTexture string
image:getLen(image) image Returns flash trace length distance
image:getMask(image) image Returns flash trace trace hit mask enums MASK
image:getMatType(image) image Returns the flash trace trace-result MatType material type number
image:getNormal(image) image Returns the flash trace trace-result Normal aim vector
image:getPos(image) image Returns flash trace origin position
image:getPosLocal(image) image Returns flash trace world origin position converted to base attachment entity local axis
image:getPosLocal(image) image Returns flash trace world origin position converted to entity local axis
image:getPosLocal(image,image) image Returns flash trace world origin position converted to position/angle local axis
image:getPosWorld(image) image Returns flash trace local origin position converted to base attachment entity world axis
image:getPosWorld(image) image Returns flash trace local origin position converted to entity world axis
image:getPosWorld(image,image) image Returns flash trace local origin position converted to position/angle world axis
image:getStart(image) image Returns flash trace trace start position sent to trace-line
image:getStartPos(image) image Returns the flash trace trace-result StartPos vector
image:getStop(image) image Returns flash trace trace stop position sent to trace-line
image:getSurfPropsID(image) image Returns the flash trace trace-result SurfaceProps ID type number
image:getSurfPropsName(image) image Returns the flash trace trace-result SurfaceProps ID type name string
image:isAllSolid(image) image Returns the flash trace trace-result AllSolid flag
image:isHit(image) image Returns the flash trace trace-result Hit flag
image:isHitNoDraw(image) image Returns the flash trace trace-result HitNoDraw flag
image:isHitNonWorld(image) image Returns the flash trace trace-result HitNonWorld flag
image:isHitSky(image) image Returns the flash trace trace-result HitSky flag
image:isHitWorld(image) image Returns the flash trace trace-result HitWorld flag
image:isIgnoreWorld(image) image Returns the flash trace trace IgnoreWorld flag
image:isStartSolid(image) image Returns the flash trace trace-result StartSolid flag
image:rayAim(image,image,image) image Aims the flash trace ray at a given position using three numbers
image:rayAim(image) image Aims the flash trace ray at a given position using a vector
image:rayAmend(image,image,image) image Amends the flash trace ray direction using three numbers
image:rayAmend(image) image Amends the flash trace ray direction using a vector
image:rayAmend(image,image) image Amends the flash trace ray direction using vector and magnitude
image:rayDiv(image) image Contracts the flash trace ray with a number
image:rayDiv(image,image,image) image Contracts the flash trace ray each component individually using three numbers
image:rayDiv(image) image Contracts the flash trace ray each component individually using a vector
image:rayMove(image) image Moves the flash trace ray with its own direction and magnitude
image:rayMove(image) image Moves the flash trace ray with its own direction and magnitude length
image:rayMove(image,image,image) image Moves the flash trace ray with displacement as three numbers
image:rayMove(image) image Moves the flash trace ray with displacement vector
image:rayMove(image,image) image Moves the flash trace ray with direction vector, magnitude length
image:rayMul(image) image Expands the flash trace ray with a number
image:rayMul(image,image,image) image Expands the flash trace ray each component individually using three numbers
image:rayMul(image) image Expands the flash trace ray each component individually using a vector
image:remBase(image) image Removes the base attachment entity of the flash trace
image:remEntHit(image) image Removes all the entities from the flash trace internal hit list
image:remEntHitOnly(image) image Removes all the entities from the flash trace internal only hit list
image:remEntHitOnly(image) image Removes the entity from the flash trace internal only hit list
image:remEntHitSkip(image) image Removes all the entities from the flash trace internal ignore hit list
image:remEntHitSkip(image) image Removes the entity from the flash trace internal ignore hit list
image:remHit(image) image Removes all the options from the flash trace internal hit preferences
image:remHit(image) image Removes the option from the flash trace internal hit preferences
image:remHitOnly(image,image) image Removes the option from the flash trace internal only hit list
image:remHitOnly(image,image) image Removes the option from the flash trace internal only hit list
image:remHitSkip(image,image) image Removes the option from the flash trace internal ignore hit list
image:remHitSkip(image,image) image Removes the option from the flash trace internal ignore hit list
image:setBase(image) image Updates the flash trace base attachment entity
image:setCollideGroup(image) image Updates flash trace trace collision group enums COLLISION_GROUP
image:setDir(image) image Updates the flash trace direction vector
image:setIsIgnoreWorld(image) image Updates the flash trace trace IgnoreWorld flag
image:setLen(image) image Updates flash trace length distance
image:setMask(image) image Updates flash trace trace hit mask enums MASK
image:setPos(image) image Updates the flash trace origin position
image:smpLocal(image) image Samples the flash trace and updates the trace-result by base attachment entity local axis
image:smpLocal(image) image Samples the flash trace and updates the trace-result by base position, angle
image:smpLocal(image) image Samples the flash trace and updates the trace-result by entity position and forward vectors
image:smpLocal(image,image) image Samples the flash trace and updates the trace-result by entity position, angle
image:smpLocal(image,image) image Samples the flash trace and updates the trace-result by position, entity angle
image:smpLocal(image) image Samples the flash trace and updates the trace-result by position, base angle
image:smpLocal(image,image) image Samples the flash trace and updates the trace-result by position, angle
image:smpWorld(image) image Samples the flash trace and updates the trace-result by the world axis
image:smpWorld(image) image Samples the flash trace and updates the trace-result by entity position and angle forward
image:smpWorld(image) image Samples the flash trace and updates the trace-result by entity position and forward vectors
image:smpWorld(image,image) image Samples the flash trace and updates the trace-result by entity position, angle
image:smpWorld(image,image) image Samples the flash trace and updates the trace-result by position, entity angle
image:smpWorld(image) image Samples the flash trace and updates the trace-result by position vector and entity forward
image:smpWorld(image,image) image Samples the flash trace and updates the trace-result by position, angle
    General functions      Out   Description 
image:setFTrace(image) image Returns flash trace local to the entity by zero origin position, zero direction vector, zero length distance
image:setFTrace(image) image Returns flash trace relative to the entity by length distance, direction vector, zero length distance
image:setFTrace(image) image Returns flash trace local to the entity by origin position, zero direction vector, zero length distance
image:setFTrace(image,image) image Returns flash trace relative to the entity by origin position, direction vector from up, length distance
image:setFTrace(image,image) image Returns flash trace local to the entity by origin position, direction vector, length distance from direction vector
image:setFTrace(image,image,image) image Returns flash trace local to the entity by origin position, direction vector, length distance
Clone this wiki locally