User:Pinsplash/BaseEntity: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(.)
(.)
Line 1: Line 1:
Basic functions for all entities. Recommended to paste at the top of base.fgd.
Basic functions for all entities. Recommended to paste at the top of base.fgd.
{{ExpandBox|
{{ExpandBox|
<code>
@BaseClass base(Targetname, Angles, Origin, Global) {{=}} CBaseEntity
@BaseClass base(Targetname, Angles, Origin, Global) {{=}} CBaseEntity
[
 
        {{User:Pinsplash/FGDline|smart=Response Contexts|ResponseContext|param=string|Pre-defined response system contexts for this entity. Format is key:value,key:value,...}}
[
        {{User:Pinsplash/FGDline|smart=Effects|effects|param=integer|Combination of effect flags to use.}}
 
        {{User:Pinsplash/FGDline|smart=Local Time|ltime|param=float|The local time of the entity, independent of the global clock. Used mainly for physics calculations.}}
{{User:Pinsplash/FGDline|smart=Response Contexts|ResponseContext|param=string|Pre-defined response system contexts for this entity. Format is key:value,key:value,...}}
        {{User:Pinsplash/FGDline|smart=Next Think|nextthink|param=float|Amount of time before the entity thinks again.}}
 
        {{User:Pinsplash/FGDline|smart=Hammer ID|hammerid|param=integer|The entity's Hammer ID. Mainly used by plugins and debugging commands, such as ent_keyvalue. Can be manually assigned. Entities spawned at run-time are not assigned any Hammer ID.}}
{{User:Pinsplash/FGDline|smart=Effects|effects|param=integer|Combination of effect flags to use.}}
        {{User:Pinsplash/FGDline|smart=Minimum CPU Level|mincpulevel|param=integer|Minimum CPU Level allowed for this entity. 0 means all levels allowed.|since=L4D}}
 
        {{User:Pinsplash/FGDline|smart=Maximum CPU Level|maxcpulevel|param=integer|Maximum CPU Level allowed for this entity. 0 means all levels allowed.|since=L4D}}
{{User:Pinsplash/FGDline|smart=Local Time|ltime|param=float|The local time of the entity, independent of the global clock. Used mainly for physics calculations.}}
        {{User:Pinsplash/FGDline|smart=Minimum GPU Level|mingpulevel|param=integer|Minimum GPU Level allowed for this entity. 0 means all levels allowed.|since=L4D}}
 
        {{User:Pinsplash/FGDline|smart=Maximum GPU Level|maxgpulevel|param=integer|Maximum GPU Level allowed for this entity. 0 means all levels allowed.|since=L4D}}
{{User:Pinsplash/FGDline|smart=Next Think|nextthink|param=float|Amount of time before the entity thinks again.}}
        {{User:Pinsplash/FGDline|smart=Lag Compensation|LagCompensate|param=choices|def=0|Set to Yes to lag compensate this entity. Should be used very sparingly!|since=L4D2}} {{=}}  
 
        [
{{User:Pinsplash/FGDline|smart=Hammer ID|hammerid|param=integer|The entity's Hammer ID. Mainly used by plugins and debugging commands, such as ent_keyvalue. Can be manually assigned. Entities spawned at run-time are not assigned any Hammer ID.}}
                0: "No"
 
                1: "Yes"
{{User:Pinsplash/FGDline|smart=Minimum CPU Level|mincpulevel|param=integer|Minimum CPU Level allowed for this entity. 0 means all levels allowed.|since=L4D}}
        ]
 
        {{User:Pinsplash/FGDline|smart=Is Automatic-Aim Target|is_autoaim_target|param=choices|If yes, automatic-aim assistance will target this entity.|since=CSGO}} {{=}}  
{{User:Pinsplash/FGDline|smart=Maximum CPU Level|maxcpulevel|param=integer|Maximum CPU Level allowed for this entity. 0 means all levels allowed.|since=L4D}}
        [
 
                0: "No"
{{User:Pinsplash/FGDline|smart=Minimum GPU Level|mingpulevel|param=integer|Minimum GPU Level allowed for this entity. 0 means all levels allowed.|since=L4D}}
                1: "Yes"
 
        ]
{{User:Pinsplash/FGDline|smart=Maximum GPU Level|maxgpulevel|param=integer|Maximum GPU Level allowed for this entity. 0 means all levels allowed.|since=L4D}}
        ///////////////////////inputs
 
        {{User:Pinsplash/FGDline|input=1|Use|Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.}}
{{User:Pinsplash/FGDline|smart=Lag Compensation|LagCompensate|param=choices|def=0|Set to Yes to lag compensate this entity. Should be used very sparingly!|since=L4D2}} {{=}}  
        {{User:Pinsplash/FGDline|input=1|DispatchEffect|Dispatches a special effect from the entity's origin. Replaced by particles since Left 4 Dead.|param=string}}
 
        {{User:Pinsplash/FGDline|input=1|DispatchResponse|Dispatches a response to the entity.|param=string}}
[
        {{User:Pinsplash/FGDline|input=1|AddContext|Adds to the entity's list of response contexts. Format is <key>:<value>.|param=string}}
 
        {{User:Pinsplash/FGDline|input=1|RemoveContext|Remove a context from this entity's list. The name should match the key of an existing context.|param=string}}
0: "No"
        {{User:Pinsplash/FGDline|input=1|ClearContext|Removes all contexts from this entity's list.|param=string}}
 
        {{User:Pinsplash/FGDline|input=1|CallScriptFunction|Execute a VScript function in the scope of the receiving entity.|param=string|since=L4D2}}
1: "Yes"
        {{User:Pinsplash/FGDline|input=1|SetLocalOrigin|Set this entity's origin in the map. (dubious)|param=string|since=p2}}
 
        {{User:Pinsplash/FGDline|input=1|SetLocalAngles|Set this entity's angles in the map. (dubious)|param=string|since=p2}}
]
]
 
}}
{{User:Pinsplash/FGDline|smart=Is Automatic-Aim Target|is_autoaim_target|param=choices|If yes, automatic-aim assistance will target this entity.|since=CSGO}} {{=}}  
 
[
 
0: "No"
 
1: "Yes"
 
]
 
///////////////////////inputs
 
{{User:Pinsplash/FGDline|input=1|Use|Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input.}}
 
{{User:Pinsplash/FGDline|input=1|DispatchEffect|Dispatches a special effect from the entity's origin. Replaced by particles since Left 4 Dead.|param=string}}
 
{{User:Pinsplash/FGDline|input=1|DispatchResponse|Dispatches a response to the entity.|param=string}}
 
{{User:Pinsplash/FGDline|input=1|AddContext|Adds to the entity's list of response contexts. Format is <key>:<value>.|param=string}}
 
{{User:Pinsplash/FGDline|input=1|RemoveContext|Remove a context from this entity's list. The name should match the key of an existing context.|param=string}}
 
{{User:Pinsplash/FGDline|input=1|ClearContext|Removes all contexts from this entity's list.|param=string}}
 
{{User:Pinsplash/FGDline|input=1|CallScriptFunction|Execute a VScript function in the scope of the receiving entity.|param=string|since=L4D2}}
 
{{User:Pinsplash/FGDline|input=1|SetLocalOrigin|Set this entity's origin in the map. (dubious)|param=string|since=p2}}
 
{{User:Pinsplash/FGDline|input=1|SetLocalAngles|Set this entity's angles in the map. (dubious)|param=string|since=p2}}
 
]
</code>}}

Revision as of 18:02, 15 September 2018

Basic functions for all entities. Recommended to paste at the top of base.fgd.


@BaseClass base(Targetname, Angles, Origin, Global) = CBaseEntity
[
        ResponseContext(string) : "Response Contexts" :  : "Pre-defined response system contexts for this entity. Format is key:value,key:value,..."
        effects(integer) : "Effects" :  : "Combination of effect flags to use."
        ltime(float) : "Local Time" :  : "The local time of the entity, independent of the global clock. Used mainly for physics calculations."
        nextthink(float) : "Next Think" :  : "Amount of time before the entity thinks again."
        hammerid(integer) : "Hammer ID" :  : "The entity's Hammer ID. Mainly used by plugins and debugging commands, such as ent_keyvalue. Can be manually assigned. Entities spawned at run-time are not assigned any Hammer ID."
        mincpulevel(integer) : "Minimum CPU Level (Since L4D)" :  : "Minimum CPU Level allowed for this entity. 0 means all levels allowed."
        maxcpulevel(integer) : "Maximum CPU Level (Since L4D)" :  : "Maximum CPU Level allowed for this entity. 0 means all levels allowed."
        mingpulevel(integer) : "Minimum GPU Level (Since L4D)" :  : "Minimum GPU Level allowed for this entity. 0 means all levels allowed."
        maxgpulevel(integer) : "Maximum GPU Level (Since L4D)" :  : "Maximum GPU Level allowed for this entity. 0 means all levels allowed."
        LagCompensate(choices) : "Lag Compensation (Since L4D2)" : 0 : "Set to Yes to lag compensate this entity. Should be used very sparingly!" = 
        [
                0: "No"
                1: "Yes"
        ]
        is_autoaim_target(choices) : "Is Automatic-Aim Target (Since CSGO)" :  : "If yes, automatic-aim assistance will target this entity." = 
        [
                0: "No"
                1: "Yes"
        ]
        ///////////////////////inputs
        input Use(void) : "Same as a player invoking +use; may not do anything. Can also be invoked by creating an output that does not specify an input."
        input DispatchEffect(string) : "Dispatches a special effect from the entity's origin. Replaced by particles since Left 4 Dead."
        input DispatchResponse(string) : "Dispatches a response to the entity."
        input AddContext(string) : "Adds to the entity's list of response contexts. Format is <key>:<value>."
        input RemoveContext(string) : "Remove a context from this entity's list. The name should match the key of an existing context."
        input ClearContext(string) : "Removes all contexts from this entity's list."
        input CallScriptFunction(string) : "Since L4D2. Execute a VScript function in the scope of the receiving entity."
        input SetLocalOrigin(string) : "Since p2. Set this entity's origin in the map. (dubious)"
        input SetLocalAngles(string) : "Since p2. Set this entity's angles in the map. (dubious)"
]