User Tools

Site Tools


hpl2:tutorials:script:problem

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hpl2:tutorials:script:problem [2013/10/14 22:59]
thegreatcthulhu [Unexpected end of file]
hpl2:tutorials:script:problem [2013/10/14 23:26] (current)
thegreatcthulhu [Unexpected end of file]
Line 28: Line 28:
  
  
-Debugging the error that cause the game to crash before it even starts is a pain; fortunately,​ there'​s an easier way to do it, assuming you've [[hpl2:​amnesia:​devenvguide|set up your development environment correctly]]. Make a copy of the your current, erroneous script text, and store it somewhere for the time being. The goal is to make the map load correctly. So, either revert your map script to an earlier, working version, or just delete everything, and just put in an empty OnStart() method. Also, make sure that the game launches in //windowed mode//, so that you can edit the script while the game is running.+Debugging the error that cause the game to crash before it even starts is a pain; fortunately, ​you don't have to restart the game every time - there'​s an easier way to do it, assuming you've [[hpl2:​amnesia:​devenvguide|set up your development environment correctly]]. Make a copy of the your current, erroneous script text, and store it somewhere for the time being. The goal is to make the map load correctly. So, either revert your map script to an earlier, working version, or just delete everything, and just put in an empty OnStart() method. Also, make sure that the game launches in //windowed mode//, so that you can edit the script while the game is running.
  
  
Line 39: Line 39:
  
  
-This error can be the most common, it's mostly the missing of another " somewhere, the most irritating of this is, you will need to look over the whole script for to know where it is. +This error can be the most common, it's mostly the missing of another " somewhere, the most irritating of this is, you will need to look over the whole script for to know where it is.
  
  
-{{http://​i.imgur.com/​SyBQW.png}}+{{http://​i.imgur.com/​SyBQW.png?​direct&​}}
  
  
Line 48: Line 48:
  
  
-However, if you use syntax highlighting capability that comes with code editors, you will probably be able to find this type of error more quickly. This is because, if syntax highlighting is enabled, string literals (the things written in double quotes, "like this") are displayed in a different color then the rest of the text; so if you forget a closing quote, there will be a piece of your code that will //look a bit wrong//. Your error will be there. ​Although this too might not be too easy to spot, it is easier ​then when you're looking at a uniformly black text.+However, if you use syntax highlighting capability that comes with code editors, you will probably be able to find the problem spot more quickly. This is because, if syntax highlighting is enabled, string literals (the things written in double quotes, "like this") are displayed in a different color then the rest of the text; so if you forget a closing quote, there will be a piece of your code that will //look a bit wrong//. Your error will be there. ​Even so, the error still might not be too easy to spot, but it will be easier ​compared to not having syntax highlighting, ​when the text looks uniformly black.
  
  
Line 60: Line 60:
  
  
-HPL2 engine uses AngelScript for scripting, but since it's syntax is similar to the languages in the C family, you can set up your editor to use syntax highlighting for C# or C++.+ 
 +HPL2 engine uses AngelScript for scripting, but since it's syntax is similar to the languages in the C family, you can set up your editor to use syntax highlighting for C# or C++, or, if you're using Notepad++ or Geany, configure your editor as described on the corresponding page on this wiki.
  
hpl2/tutorials/script/problem.1381791542.txt.gz · Last modified: 2013/10/14 22:59 by thegreatcthulhu