Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: LUA Documentation  (Read 3823 times)

0 Members and 1 Guest are viewing this topic.

Offline BIZ

  • 32-Bit Hobo
  • *
  • *
  • +0% chance to make useful post
  • BIZ hides in shadows.
    • BSNOOCH.COM
LUA Documentation
« on: October 12, 2009, 03:45:22 AM »
Sorry that there isn't much here. the_author was pretty cryptic...I guess this assumes you have a basic understanding of the LUA language.


LUA Documentation


 

Note: not much detail.
Did not think too hard to implement.
Please listen to the bulletin board if you need help.

Also, some functions may not have exception handling.

. Vector calculation related


.. To create a BEKUTATEBURU
Vector = HL2.Vector (x, y, z)

.. From Vector "xyz" create a format string
String = HL2.VectorString (Vector)

.. For the inner product
Value = HL2.DotProduct (VectorA, VectorB)

.. For the distance between vectors
Length = HL2.VectorLength (VectorA, VectorB)

.. Vector Normalization
Length = HL2.VectorNormalize (Vector)

.. Convert to vector angle
Vector = HL2.AngleVectors (Angle)

Angle from the vector to convert ..
Angle = HL2.VectorAngles (Vector)

.. Random initialization
HL2.RandomSeed (seed)

Create random numbers ..
Value = HL2.RandomInt (min, max)
Value = HL2.RandomFloat (min, max)

. Messages Related


See your message ..
HL2.ShowHUDMessage (Message)

See your message to the bottom left ..
HL2.ShowInfoMessage (Time, Color, Message)

The numerical notation timer .. (nn: nn) to the
String = HL2.TimerStr (value)

. Entity Related

.. Get the information of the entity
Get the position ...
Vector = HL2.GetAbsOrigin (pEnt)

... Obtain the orientation
Vector = HL2.GetAbsAngles (pEnt)

... Get a move vector
Vector = HL2.GetAbsVelocity (pEnt)

... Get a perspective
Vector = HL2.EyePosition (pEnt)

... Get the look
Vector = HL2.EyeAngles (pEnt)

... Return the information of the specified entity
Entinfo = HL2.GetEntInfo (pEnt)

Entinfo.Health
Entinfo.Classname
Entinfo.ModelName
Entinfo.IsAlive
Entinfo.IsNpc
Entinfo.IsPlayer
Entinfo.Owner
Entinfo.Name

.. Information to the entity set
... Setting the position
HL2.SetAbsOrigin (pEnt, Vector)

... Set the direction
HL2.SetAbsAngles (pEnt, Vector)

... Set of key fields
HL2.KeyValue (pEnt, Keyname, Value)
? Value can be set to strings and numbers BEKUTATEBURU.

Set the parent object.
HL2.SetEntityParent (ParentpEnt, ChildpEnt)
HL2.SetEntityParent (ParentpEnt, ChildpEnt, Attachname)

Setting the owner of the object ...
HL2.SetEntityOwner (OwnerpEnt, pEnt)

Set the move type.
HL2.SetEntityMoveType (pEnt, MoveType)

Setting a relationship ...
HL2.SetEntityRelationship (pEntA, pEntB, disposition, priority)
HL2.SetEntityRelationship (pEnt, Class_T, disposition, priority)
HL2.SetEntityRelationshipName (pEnt, Targetname, disposition, priority)
HL2.SetEntityRelationshipName2 (TargetNameA, TargetNameB, disposition, priority)

... Set the amount of movement of physical objects
HL2.SetEntityPhysVelocity (pEnt, Vector)

Fixed physical object ...
HL2.SetEntityPhysFreeze (pEnt, flag)

... Replace the specified model
HL2.SetModel (pEnt, Modelname)

Create the entity ..
pEnt = HL2.CreateEntity (Classname, Origin, Angle)

.. Advent of the entity
HL2.SpawnEntity (pEnt)

Search by name entity ..
PEnt = HL2.FindEntityByName (pEnt, Targetname)

Search by name of the entity class ..
pEnt = HL2.FindEntityByClassname (pEnt, Classname)

Remove the entity ..
HL2.RemoveEntity (pEnt)

. Spaces, Traces


.. Check if there is space in the specified range
Checkflag = HL2.CheckRoom (Origin, Mins, Maxs)

.. Between the entity (A-> B) to confirm that you can see
Info = HL2.CheckVisible (pEntA, pEntB)

Info.IsVisible see a
Distance info.Length A and B
info.AngleYaw A angle B from the front of the off -
info.AnglePitch A angle B from the front of the off -

. Node Related


.. Return the number of nodes on the map
Nodecount = HL2.GetNodeCounts ()

.. Return the information of the specified node number
Pnode = HL2.GetNodeData (NodeID)

Pnode.x pnode.y pnode.z position
Pnode.yaw orientation
Type pnode.type

. Player Related

.. Get the money for players
Value = HL2.GetMoney ()

Set the player's money ..
HL2.SetMoney (Value)

Getting a player ..
PEnt = HL2.GetPlayer ()

. Associated sound
.. The sound of the specified sound in the specified location
HL2.PlaySoundPos (Soundname, Origin)

Soundname: Sound script name
Origin: Playing position

.. The sound of the specified sound from a given entity
HL2.PlaySoundEntity (Soundname, pEnt)

.Saving a Value

.. Recorded a string key
HL2.SaveString (Key, String)
? 1 is held only on the map.

.. Get the string from the specified key
String = HL2.LoadString (key)

.. Lua string stored in a secure environment for
HL2.StoreWorkVar (index, String)
? _luaworkvar1 string instrument that is stored in the tab

.. Get a string of variables stored
String = HL2.GetWorkVar (index)

. Other

The event ..
HL2.EntFire (Targetname, Activator, Action, Value, <Delay>)

.. Killed Hook events
... When someone was killed, fly to the specified function
HL2.HookKilledEvent ( "function")
... Stop the hook
HL2.HookKilledEvent ()
... Information that is returned to the function
HookFunction (info)
Info.IsPlayer
Info.IsNPC
Info.Relation
Info.DamageType
Info.Damage
Info.AmmoType
Info.Attacker
Info.KilledEnt

Create a timer ..
Seconds after the call to specify the functions specified.
The called side, continued to set the timer in seconds, and then calling a return value.
0 will be destroyed and the timer is returned.

... Creating a timer
pEnt = HL2.CreateTimer ( "function", intervaltime, <tag string>)

... Information that is returned to the function
Function (<tag string>)
<tag String>

.. The years MMDD returns in the form
Date = HL2.LuaF_GetDateMD ()

.. Get the name of the current MAP
Mapname = HL2.CurrentMapName ()

Specified change in the map ..
HL2.ChangeLevel (mapname)

.. Mapadd run the script specified in the label
HL2.CallMapaddLabel (LabelName)


Lua 5.0 license

Copyright ? 1994-2005 Lua.org, PUC-Rio.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.