Entity/DTVar

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{Func |Name=DTVar |Parent=Entity |Description= |Realm=Shared |IsClass=Yes }}")
 
Line 2: Line 2:
 
|Name=DTVar
 
|Name=DTVar
 
|Parent=Entity
 
|Parent=Entity
|Description=
+
|Description=Sets up a self.dt.NAME alias for a [[DTVars| Data Table var]]
 +
| Arg1Name = Type
 +
| Arg1Type = string
 +
| Arg1Desc = The type of the DTVar being set up. It can be one of the following: 'Int', 'Float', 'Vector', 'Angle', 'Bool', 'Entity' or 'String'
 +
| Arg2Name = ID
 +
| Arg2Type = number
 +
| Arg2Desc = The ID of the DTVar. Can be between 0 and 3
 +
| Arg3Name = Name
 +
| Arg3Type = string
 +
| Arg3Desc = Name by which you will refer to DTVar. It must be a valid variable name. (No spaces!)
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=Yes
 
|IsClass=Yes
 +
}}
 +
{{Arg
 +
|type=string
 +
|name=Type
 +
|desc=The type of the DTVar being set up. It can be one of the following: 'Int', 'Float', 'Vector', 'Angle', 'Bool', 'Entity' or 'String'
 +
| Arg2Name = ID
 +
| Arg2Type = number
 +
| Arg2Desc = The ID of the DTVar. Can be between 0 and 3
 +
| Arg3Name = Name
 +
| Arg3Type = string
 +
| Arg3Desc = Name by which you will refer to DTVar. It must be a valid variable name. (No spaces!)
 +
}}
 +
{{Arg
 +
|type=number
 +
|name=ID
 +
|desc=The ID of the DTVar. Can be between 0 and 3
 +
| Arg3Name = Name
 +
| Arg3Type = string
 +
| Arg3Desc = Name by which you will refer to DTVar. It must be a valid variable name. (No spaces!)
 +
}}
 +
{{Arg
 +
|type=string
 +
|name=Name
 +
|desc=Name by which you will refer to DTVar. It must be a valid variable name. (No spaces!)
 +
}}
 +
{{Example
 +
| Description = Sets up two float networked variables, '''TargetZ''' and '''Speed'''
 +
| Code = function ENT:SetupDataTables()
 +
 +
self:DTVar( "Float", 0, "TargetZ" );
 +
self:DTVar( "Float", 1, "Speed" );
 +
 +
end
 
}}
 
}}

Revision as of 14:18, 27 February 2013

 Entity:DTVar( )

Contents

Description

Sets up a self.dt.NAME alias for a Data Table var

Arguments

string Type

The type of the DTVar being set up. It can be one of the following: 'Int', 'Float', 'Vector', 'Angle', 'Bool', 'Entity' or 'String'

Arguments

number ID

The ID of the DTVar. Can be between 0 and 3

Arguments

string Name

Name by which you will refer to DTVar. It must be a valid variable name. (No spaces!)

Examples

Example

Sets up two float networked variables, TargetZ and Speed

function ENT:SetupDataTables()

 self:DTVar( "Float", 0, "TargetZ" );
 self:DTVar( "Float", 1, "Speed" );

end


Personal tools
Navigation