Author Topic: About the General FS2 Scripting Tutorial  (Read 2477 times)

0 Members and 1 Guest are viewing this topic.

Offline Kiloku

  • 27
  • Buzzbuzz!
    • Minecraft
About the General FS2 Scripting Tutorial
I just read it, and did the Hello World thing from the "Quick, a Full Example" section. I noticed I had to change the code from
Code: [Select]
$version: 3.7to
Code: [Select]
$version: 3.10it worked, but it gives me an error every time I load the game. Also, 3.7? Can't someone update the guide?


Code: (Hello World) [Select]
#Conditional Hooks
$Version: 3.6.10
$On Splash Screen:
[
--Set the color to white
Graphics.setColor(255, 255, 255)
--Write "Hello, world!"
Graphics.drawString("Hello, world!", 5, 10)
]
+Override: YES
#End

Error:
<UNKNOWN>: Argument 11 is an invalid type 'nil'; boolean expected

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name:      (null)
Name of:   (null)
Function type:   (null)
Defined on:   0
Upvalues:   0

Source:      (null)
Short source:   
Current line:   0
------------------------------------------------------------------


------------------------------------------------------------------
LUA Stack:
------------------------------------------------------------------

1: Userdata [Audio]
2: Userdata [Base]
3: Userdata [CFile]
4: Userdata [Controls]
5: Userdata [Graphics]
6: Userdata [HookVariables]
7: Userdata [Mission]
8: Userdata [Tables]
9: Userdata [Testing]
10: Function
11: NIL
------------------------------------------------------------------

Potato!

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: About the General FS2 Scripting Tutorial
Yeah, that guide has to be updated.

Code: (Hello World) [Select]
#Conditional Hooks
$On Splash Screen:
[
--Set the color to white
gr.setColor(255, 255, 255)
--Write "Hello, world!"
gr.drawString("Hello, world!", 5, 10)
]
+Override: YES
#End
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Kiloku

  • 27
  • Buzzbuzz!
    • Minecraft
Re: About the General FS2 Scripting Tutorial
actually, that was worse...
Error: scripting.tbl(line 2:
Error: Missing required token: [#End]. Found [$On Splash Screen:   ]  instead.

File: PARSELO.CPP
Line: 670


Call stack:
------------------------------------------------------------------
------------------------------------------------------------------


Error: scripting.tbl(line 3:
Error: Missing required token: [#End]. Found [[]  instead.

File: PARSELO.CPP
Line: 670


Call stack:
------------------------------------------------------------------
------------------------------------------------------------------

Error: scripting.tbl(line 4:
Error: Missing required token: [#End]. Found [--Set the color to white]  instead.

File: PARSELO.CPP
Line: 670


Call stack:
------------------------------------------------------------------
------------------------------------------------------------------

Error: scripting.tbl(line 5:
Error: Missing required token: [#End]. Found [gr.setColor(255, 255, 255)]  instead.

File: PARSELO.CPP
Line: 670


Call stack:
------------------------------------------------------------------
------------------------------------------------------------------

Error: scripting.tbl(line 6:
Error: Missing required token: [#End]. Found [--Write "Hello, world!"]  instead.

File: PARSELO.CPP
Line: 670


Call stack:
------------------------------------------------------------------
------------------------------------------------------------------
Potato!

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: About the General FS2 Scripting Tutorial
Code: (Hello World) [Select]
#Conditional Hooks
$Application: Freespace 2
$On Splash Screen:
[
--Set the color to white
gr.setColor(255, 255, 255)
--Write "Hello, world!"
gr.drawString("Hello, world!", 5, 10)
]
+Override: true
#End
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Aardwolf

  • 211
  • Posts: 16,384
    • Minecraft
Re: About the General FS2 Scripting Tutorial
I just read it, and did the Hello World thing from the "Quick, a Full Example" section. I noticed I had to change the code from
Code: [Select]
$version: 3.7to
Code: [Select]
$version: 3.10it worked, but it gives me an error every time I load the game. Also, 3.7? Can't someone update the guide?

Umm... no. 3.7 is not the same as 3.6.7, just like 3.10 is not the same as 3.6.10

3.7 is one more major version number than 3.6, and 3.10 is 3 versions later than any existing version of fs2.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: About the General FS2 Scripting Tutorial
i think a better breakdown of all the hooks, how to use them, how to use conditional overrides, and a better explanation of the Application: and Version: tags (such as what they are for and why there required under certain situations). also lists of hook variables and what they do would be pretty useful for anyone who wants to start scripting and cant make heads or tails of the scripting.tbl/*-sct.tbm
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Kiloku

  • 27
  • Buzzbuzz!
    • Minecraft
Re: About the General FS2 Scripting Tutorial
I'm a patient learner. So if anyone would like to start teaching me, we could take the opportunity to put every little piece of info in the Wiki
Potato!