I am just learning here, and am in the process of writing my first script following these directions:
Your first script
Below is an example of an extremely simple script. This script will take in a string value and output that text as a hint.
************
;hintmaker.sqs
;This script takes a string value and generates a hint from it
_mystring = _this select 0
hint _mystring
exit
************
NOW IT'S YOUR TURN.
Now that we've discussed the above script, lets create this script on our machines and actually use it.
1. First, you must create a scenario and save it, so you have a working directory to place your script in. You will be placing all your scripts in the root directory of your mission. Create a simple scenario with just one individual, the player, and save your scenario as "script_test"
2. ALT-TAB to the desktop. Find the mission directory for your mission and create a text file called hintmaker.sqs. Your missions directory is located in: OFP1\users\MyUserName\missions\intro.Script_Test
3. Open the script file, and type in the above script. Check for typos and save your work. You can skip the comments if you like. Just remember that comments are your friend when you make your own scripts.
4. As with all scripts, they may be executed from the individual's init field, triggers, waypoints and other scripts. As an example, let's execute our script with a trigger. Go back to the editor and create a trigger with the following fields:
Axis a: 0
Axis b: 0
Countdown: Min: 3 Mid: 3 Max: 3
Condition: true
Activation: ["Have a nice day"] exec "hintmaker.sqs"
Type: Switch
Text: show a hint
4. Go ahead and preview the scenario. After three seconds, your hint will appear with a resounding "ding!" If all went well, you have successfully created and used your first script.
I am running version 1.46 and I followed all of these directions. Upon making the trigger, it doesn't seem to detect the hintmaker script. I thought this was going to be an easy tutorial for scripting... This trial and error stuff is tedious. The sqs file is still saved as a text document... could that be part of it? How do I change it if that is the problem?