Author Topic: Important note regarding scripting  (Read 1453 times)

0 Members and 1 Guest are viewing this topic.

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Important note regarding scripting
The "+Override:" field for scripting hooks has been integrated into the scripting system. This means that rather than "YES" and "NO", it's necessary to use "true" and "false". This should be backwards compatible.

This also means that you can use the typical brackets to define a script to run within these fields. The only criteria is that the script must return either 'true' or 'false'. EG:

Code: [Select]
#Global Hooks
;;Typical usage
$GameInit: [[init.lua]]
     +Override: true

;;Here we see full script used
$Splash: [[splash.lua]]
     +Override: [
          if gr.getScreenWidth() > 640 then
               return false
          else
               return true
          end
     ]

;;Using a function to toggle override
$HUD: [[hud.lua]]
     +Override: display_scripting_hud_only()
#End

Changes will take effect with 3.6.9, and the next CVS build.
-C

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Important note regarding scripting
Another thing, I got the getScreenCoords() function for vectors to work. So you should be able to come up with targeting brackets and lead indicators and the like.
-C

 

Offline DaBrain

  • Screensniper
  • 212
    • Shadows of Lylat board
Re: Important note regarding scripting
Do you think this would be enough to create a Starfox64-like 3d reticle?
--------------------------------------------------
SoL is looking for a sound effect artist
Please PM me in case you want to apply
---------------------------------
Shadows of Lylat - A Freespace 2 total conversion
(hosted by Game-Warden)
----------------------------------

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Important note regarding scripting
I'm not exactly sure, but probably. As long as you can do the calculations to get the point in 3D space where you want the recticule to be displayed (in world coordinate space) you should be able to use the getScreenCoords to project the 2D image coordinates.
-C

 

Offline Turambar

  • Determined to inflict his entire social circle on us
  • 210
  • You can't spell Manslaughter without laughter
Re: Important note regarding scripting
does this mean that the hud can be non-distorted when i play at 1280x768?
10:55:48   TurambarBlade: i've been selecting my generals based on how much i like their hats
10:55:55   HerraTohtori: me too!
10:56:01   HerraTohtori: :D