Advertisement
MjnMixael

Untitled

Dec 14th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #Conditional Hooks
  2. $Application: FS2_Open
  3. $State: GS_STATE_GAME_PLAY
  4. $On Frame:
  5. [
  6.  
  7.  
  8. --print stuffs
  9. if printSexpVars then
  10. gr.drawString("Sexp Var Name: Value, Type, Persistence", posX, posY )
  11. for i=1, #mn.SEXPVariables do
  12. local var = mn.SEXPVariables[i]
  13. if var:isValid() then
  14. gr.drawString( tostring(var)..": "..tostring(var.Value)..", "..getSexpstates(tostring(var.Type))..", "..getSexpstates(tostring(var.Persistence)) )
  15. end
  16. end
  17. end
  18.  
  19. ]
  20.  
  21. $Application: FS2_Open
  22. $On Gameplay Start:
  23. [
  24. --tweakables!
  25. posX,posY = 10,50
  26. printSexpVars = false
  27.  
  28. sexpstates = {}
  29. sexpstates["SEXPVAR_CAMPAIGN_PERSISTENT"] = "CP"
  30. sexpstates["SEXPVAR_NOT_PERSISTENT"] = "NP"
  31. sexpstates["SEXPVAR_PLAYER_PERSISTENT"] = "PP"
  32. sexpstates["SEXPVAR_TYPE_NUMBER"] = "number"
  33. sexpstates["SEXPVAR_TYPE_STRING"] = "string"
  34.  
  35. function getSexpstates(state)
  36. if sexpstates[state] then
  37. return sexpstates[state]
  38. else
  39. return state
  40. end
  41. end
  42. ]
  43.  
  44. $State: GS_STATE_GAME_PLAY
  45. $On Key Pressed:
  46. [
  47. if hv.Key == "Alt-2" then
  48. if printSexpVars then
  49. printSexpVars = false
  50. elseif not printSexpVars then
  51. printSexpVars = true
  52. end
  53. end
  54. ]
  55.  
  56. #end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement