PDA

View Full Version : Using scripts



Xanorak
Jul 14 2011, 14:06
Hey all, I'm really new to all this stuff so please, try to bear with me ;)

Anyways, I just started playing ArmA 2 recently. One of the first things I did was fire up the editor, and I'm doing pretty well in it. However, I wanted to use a few scripts for my mission. One of them being the Traffic Transportation System (http://forums.bistudio.com/showthread.php?t=119820). The installation instructions were quite confusing to me, but it just said to copy and paste a line into my unit's init bar. I had no idea what that was, but I found out.

To clarify, I go to my profiles folder in My Documents, go to Missions and create a txt file. I then pasted in the code I was told to, saved and renamed it to init.sqf. In the instructions I was also told to put the fnc_traffic folder directly in my missions folder, so I put it in both the one in My Documents and the root ArmA folder.

Now, when I start my mission and click Preview, I expected to see a bunch of cars moving around randomly. What I got was a message saying the script WCRffsx_fnc_traffic.sqf was not found. This is the exact same line I was told to put in my init.sqf, and I definitely put the fnc_traffic folder in both Missions folders. The file is clearly there, but the game can't detect it!

So here's the line copy/pasted from the Readme file included in the Traffic download: "Download the function and unzip it, put the folder fnc_Traffic into your mission folder directly. copy the code: fnc = [50] execVM "fnc_Traffic\WCRffsx_fnc_Traffic.sqf"; into your unit's init bar."

Is it fine just to paste that line in like that? I can't think why the script isn't working. I'm running the same map, and I have the file requested. Please help!

On a smaller note, is it okay to run other scripts in the same init.sqf file by putting it next to it? For example, I want to use the Advanced Fire Script, and I am told to put the line, "_nul = [] execVM "AFS\AFS_Init.sqf";" into my init file. So it should look like this?


fnc = [50] execVM "fnc_Traffic\WCRffsx_fnc_Traffic.sqf";_nul = [] execVM "AFS\AFS_Init.sqf";

Any help would be much appreciated! I haven't gotten to using Triggers in the editor, by the way. I've only been spawning units and waypoints. Thanks.

DMarkwick
Jul 22 2011, 15:30
You need to save your mission in the editor first, that will give you a mission folder in your Missions directory. Lets say you named it MyVehicleTest. So in your Docs/ArmA2/Missions folder, there is a new folder called MyVehicleTest.Utes (or whatever map you used). This is the folder that the script needs to go in.

---------- Post added at 04:30 PM ---------- Previous post was at 04:27 PM ----------

You might also want to check out JTD Ambient Civilian Traffic module. (http://forums.bistudio.com/showthread.php?t=90435) :)

Foxhound
Jul 22 2011, 16:01
The troubleshootong section obviously is not meant for troubles you experience when trying to use community made scripts. Thats what the editing section is for.
Why don't you use the Traffic Transportation System topic you linked to yourself already? Thats where this question belongs :)