Jump to content

Modding errors: Difference between revisions

m
link fixes (er, the grammar was right the first time ;-)
m (restored images)
m (link fixes (er, the grammar was right the first time ;-))
Line 117: Line 117:
The engine has some kind of limit on how many BSL commands can occur in a single BSL file. When you pass the limit, you'll get errors in the developer console like this: "Func "main", File "(called from engine)", Line 0: semantic error, function "main" does not exist." (it can also be a function other than "main").
The engine has some kind of limit on how many BSL commands can occur in a single BSL file. When you pass the limit, you'll get errors in the developer console like this: "Func "main", File "(called from engine)", Line 0: semantic error, function "main" does not exist." (it can also be a function other than "main").


For an example, extract these files and place them in IGMD/EnvWarehouse to experience the problem: [http://script10k.oni2.net/wikifiles/main_not_working_without_commenting_commands.zip], [http://script10k.oni2.net/wikifiles/main_not_working_without_commenting_commands(functions_split).zip], [http://script10k.oni2.net/wikifiles/main_split_in_two_files.zip]
For an example, extract these files and place them in IGMD/EnvWarehouse to experience the problem: [http://script10k.oni2.net/wikifiles/main_not_working_without_commenting_commands.zip], [http://script10k.oni2.net/wikifiles/main_not_working_without_commenting_commands(functions_splitted).zip], [http://script10k.oni2.net/wikifiles/main_splitted_in_two_files.zip]


In all these BSL files, the message "This message should appear on the beginning" should appear when you load level 1. However for "main_not_working_without_commenting_commands" it doesn't work unless you comment out the 5th line of the BSL file. The "main_not_working_without_commenting_commands(functions_split)" script is the same, but in this one the "main" function is split into two functions, which is still not enough for the error to go away. The scripts in "main_split_in_two_files" are the same BSL as previously, but the two functions are split into two different files: "main.bsl" and "continuation.bsl". In this case the script works as expected, and the message "This message should appear on the beginning" appears on level load.
In all these BSL files, the message "This message should appear on the beginning" should appear when you load level 1. However for "main_not_working_without_commenting_commands" it doesn't work unless you comment out the 5th line of the BSL file. The "main_not_working_without_commenting_commands(functions_split)" script is the same, but in this one the "main" function is split into two functions, which is still not enough for the error to go away. The scripts in "main_split_in_two_files" are the same BSL as previously, but the two functions are split into two different files: "main.bsl" and "continuation.bsl". In this case the script works as expected, and the message "This message should appear on the beginning" appears on level load.