Hard Light Productions Forums
Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: Kiloku on August 06, 2009, 10:20:49 am
-
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
$version: 3.7
to
$version: 3.10
it worked, but it gives me an error every time I load the game. Also, 3.7? Can't someone update the guide?
#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
------------------------------------------------------------------
-
Yeah, that guide has to be updated.
#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
-
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:
------------------------------------------------------------------
------------------------------------------------------------------
-
#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
-
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 $version: 3.7
to
$version: 3.10
it 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.
-
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'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