Hard Light Productions Forums

Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: Kiloku on August 06, 2009, 10:20:49 am

Title: About the General FS2 Scripting Tutorial
Post 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
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
------------------------------------------------------------------

Title: Re: About the General FS2 Scripting Tutorial
Post by: The E on August 06, 2009, 10:29:22 am
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
Title: Re: About the General FS2 Scripting Tutorial
Post by: Kiloku on August 06, 2009, 12:37:54 pm
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:
------------------------------------------------------------------
------------------------------------------------------------------
Title: Re: About the General FS2 Scripting Tutorial
Post by: The E on August 06, 2009, 01:33:36 pm
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
Title: Re: About the General FS2 Scripting Tutorial
Post by: Aardwolf on August 06, 2009, 08:21:00 pm
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.
Title: Re: About the General FS2 Scripting Tutorial
Post by: Nuke on August 06, 2009, 09:42:57 pm
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
Title: Re: About the General FS2 Scripting Tutorial
Post by: Kiloku on August 07, 2009, 09:08:31 pm
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