Difference between revisions of "Game"

From Vendetta Lua
Jump to: navigation, search
(SetCVar)
(GetObjectAtScreenPos)
Line 133: Line 133:
 
=== GetObjectAtScreenPos ===
 
=== GetObjectAtScreenPos ===
 
'''Definition:'''<br>
 
'''Definition:'''<br>
GetObjectAtScreenPos() -> ?
+
GetObjectAtScreenPos(float x, y) -> int [[nodeid]], [[objectid]]
 
<br><br>
 
<br><br>
 
'''Description:''' <br>
 
'''Description:''' <br>
 
+
Returns nodeid and objectid of a targetable object at specified screen coordinates
 
<br><br>
 
<br><br>
 
'''Arguments:''' <br>
 
'''Arguments:''' <br>
?
+
''x'',''y'' - screen coordinates, range from 0 to 1 where 0,0 is top left corner of screen and 1,1 is bottom right
 
<br><br>
 
<br><br>
 
'''Returns:''' <br>
 
'''Returns:''' <br>
?
+
[[nodeid]], [[objectid]] - ids, as used by radar functions
 
<br><br>
 
<br><br>
 
'''Example:'''
 
'''Example:'''
<br><br>
+
<br>
 
+
<source lang="lua">
 
+
radar.SetRadarSelection(Game.GetObjectAtPos(0.5, 0.5)) -- will target object directly in front (also stuff not normally targettable, like station parts)
 +
</source>
  
 
=== GetTurretHealth ===
 
=== GetTurretHealth ===

Revision as of 23:41, 26 October 2009

Functions

DisableInput

Definition:
DisableInput() -> ?

Description:



Arguments:
?

Returns:
?

Example:


EnableInput

Definition:
EnableInput()

Description:



Arguments:
none

Returns:
nothing

Example:

Game.EnableInput()



GetCVar

Definition:
GetCVar(string name) -> result

Description:
Returns the value of a C variable(?)
I'm assuming that the term CVar refers to an ingame variable not directly accessible by Lua

Arguments:
name name of the variable.

Returns:
The value or nil
Example:

print(Game.GetCVar("rRenderStationInMenu")) -- output: 1 or 0, ie. true/false
if Game.GetCVar("autoaim") == 1 then print("autoaim is on") end
print(Game.GetCVar("rHUDxscale")) -- output: 900
if Game.GetCVar("filterchannelmsgs") ==  1 then print("Channel Messages are being filtered") end

GetClientBuildNumber

Definition:
GetClientBuildNumber() -> ?

Description:



Arguments:
?

Returns:
?

Example:


GetDesiredSpeed

Definition:
GetDesiredSpeed() -> ?

Description:



Arguments:
?

Returns:
?

Example:


GetFlightMode

Definition:
GetFlightMode() -> boolean

Description:



Arguments:
?

Returns:
?

Example:

local a = Game.GetFlightMode()
print tostring(a).." ("..type(a)..")" -- outputs: true (boolean)



GetNFZMode

Definition:
GetNFZMode() -> ?

Description:



Arguments:
?

Returns:
?

Example:


GetObjectAtScreenPos

Definition:
GetObjectAtScreenPos(float x, y) -> int nodeid, objectid

Description:
Returns nodeid and objectid of a targetable object at specified screen coordinates

Arguments:
x,y - screen coordinates, range from 0 to 1 where 0,0 is top left corner of screen and 1,1 is bottom right

Returns:
nodeid, objectid - ids, as used by radar functions

Example:

radar.SetRadarSelection(Game.GetObjectAtPos(0.5, 0.5)) -- will target object directly in front (also stuff not normally targettable, like station parts)

GetTurretHealth

Definition:
GetTurretHealth() -> ?

Description:



Arguments:
?

Returns:
?

Example:


GetTurretObjectID

Definition:
GetTurretObjectID() -> ?

Description:



Arguments:
?

Returns:
?

Example:


Quit

Definition:
Quit()

Description:



Arguments:
none

Returns:
nothing

Example:

Game.Quit()



SetCVar

Definition:
SetCVar(string name, string value) -> ?

Description:



Arguments:

string name - name of existing cvar string value - value to set it to



Returns:

true - if the cvar is valid, false otherwise



Example:

if(Game.SetCVar("fov", "95") == true) then print "fov set to 95" end



SetDesiredSpeed

Definition:
SetDesiredSpeed() -> ?

Description:



Arguments:
?

Returns:
?

Example:


SetInputMode

Definition:
SetInputMode() -> ?

Description:



Arguments:
?

Returns:
?

Example:


SetJumpDest

Definition:
SetJumpDest(sectorid)

Description:



Arguments:
sectorid -- sectorid of jump destination.

Returns:
nothing

Example:

Game.SetJumpDest(2902)



StartLoginCinematic

Definition:
StartLoginCinematic()

Description:



Arguments:
none

Returns:
none

Example:

Game.StartLoginCinematic()



StopLoginCinematic

Definition:
StopLoginCinematic()

Description:



Arguments:
none

Returns:
none

Example:

Game.StopLoginCinematic()