You may post in this section if you need any help with regards to scripting for Liberty Unleashed.
Please follow these few guidelines:
• Make sure that your subject is informative.Do not set your subject as "HELP!" for example.
Rather, set it as something specific to your need such as:
Can't get player to spawn
If you are asking about a problem with a released script, prefix your subject with the name of the release.
For example,
[FBS] Help with spawning cars
• Make sure that you have checked all available documentation for solutions.Liberty Unleashed has a wiki which can be found at the following link.
http://liberty-unleashed.co.uk/LUWiki/Main_PageThe wiki contains most of the information you need to know.
Squirrel has quite a few in-built functions however and you can access the Squirrel Language documentation at the following link.
http://squirrel-lang.org/#documentationLU comes with Squirrel version 3, so you will want to check the documentation linked below the heading:
Squirrel 3.xIf you are working on a released set of scripts, check the script's readme or release topic.
For example, FBS v1's topic is
over here.
• Make sure that you have tried everything possible before asking.Sometimes, the solution can be very obvious.
This means that you should debug your code extensively. If you find interesting facts while debugging, do not hesitate to post a
snippet or
tutorial to help other users!
Some common ways of debugging include:
- Using print() to output useful information.function ABC ( text )
{
print( "Parameter text contains: "+ text );
DoSomethingUseful1();
print( "The function, DoSomethingUseful1 has been executed" );
DoSomethingUseful2();
print( "The function, DoSomethingUseful2 has been executed" );
}
The above example tells you what the contents of your variable, 'text' is and whether a function has been executed without failing.
- Use try/catchhttp://squirrel-lang.org/doc/squirrel3.html#d0e871Try/catch is Squirrel's in-built method of attempting to run scripts and catching errors in the event an error occurs.
A simple example is the following script.
try {
print( "Hello World!" );
} catch ( errormessage )
if ( errormessage ) print( "ERROR" );
• Search this forum for an answer.You can search by clicking on
this link or the "Search" button above.
Your problem may not be new and someone may have already solved it.
Maybe someone is currently having the same problem. You could then work with that person to solve the problem.