Jump to content
Sign in to follow this  
Cain_

Init.sqf will only run one script

Recommended Posts

I got a problem. Im making a mission where I am removing the chat function and the abillity to press map.

The problem is that the init.sqf is only able to load 1 command line.

sleep 1;

waitUntil {sleep 0.01; (!(isNull (findDisplay 46)))};

(findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 in actionKeys 'Chat') then { true } else { false };"]

~5

hint format ["Welcome %1 to Desert Operation",Player]

The problem is that i only disables the chat, but dosnt show the hint. If i put the hint in front like this i only get the hint and chat is working.

hint format ["Welcome %1 to Desert Operation",Player]

sleep 1;

waitUntil {sleep 0.01; (!(isNull (findDisplay 46)))};

(findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 in actionKeys 'Chat') then { true } else { false };"]

Since i want disable the abillity to press M to see map and score i tried

(findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 in actionKeys 'Map') then { true } else { false };"] but it dosnt work :(

Share this post


Link to post
Share on other sites

Try 'ShowMap' (and 'HideMap', but probably not relevant for you) instead of 'Map'.

Weird mix of .sqf and .sqs syntax; ~5 and sleep 1, ; character only on some lines etc.

Share this post


Link to post
Share on other sites
Try 'ShowMap' (and 'HideMap', but probably not relevant for you) instead of 'Map'.

Weird mix of .sqf and .sqs syntax; ~5 and sleep 1, ; character only on some lines etc.

ye i dont want ppl to see their score in map menu :). I cleared out all shit but it still gives me problems. I remember editing in OFP. I used to get tons of errors ingame when something was "typed" wrong. In ArmA i get nothing, it just dont work.

Share this post


Link to post
Share on other sites

Using sqs syntax in a .sqf file will cause all kinds of mystery errors. Either switch to sqf syntax or rename the file with a .sqs extension. That should help clear up a number of problems.

Share this post


Link to post
Share on other sites

@Cain: Use startup parameter -showScriptErrors to show the errors on screen like in OFP, otherwise they are just logged to the .rpt.

Share this post


Link to post
Share on other sites

Yeah, "~5" is definitely the problem. Change it to "sleep 5" in sqf.

Share this post


Link to post
Share on other sites
Yeah, "~5" is definitely the problem. Change it to "sleep 5" in sqf.

sleep 5; :)

Share this post


Link to post
Share on other sites

Even if I might be up for the biggest Scripting Noob Award I have to say that I am not mentally retarded, at least now when being sober:) I am 100% sober when typing this.

Step 1: added -showScriptErrors to my shortcut

Step 2: re saved my SQF file into SQS

Step 3: tried to run script again => nothing worked, didnt even get any errors.

Step 4: Express my happies in a gained roar crushing which if the sound travels at 342 m/s should hit you guys any second now.

I used to script back in OFP but now I cant even get a hint message to show :).

*Iam modding the mission in MP editor and playing "live"

*I have only placed 3 soldiers in the game editor and nothing else

*Iam a Swede, maybe we are ment to fail?

:yay:

---------- Post added at 06:43 PM ---------- Previous post was at 06:35 PM ----------

We made progress people

we have finally gotten somewhere.

Iam now pround to announce I have gotten my first

Error Message

Share this post


Link to post
Share on other sites

What does it say? :)

Also, you may find more information in the ArmA2.rpt/ArmA2OA.rpt. The location of that file depends on what your OS is.

Share this post


Link to post
Share on other sites

It says "Please remove Current ArmA 2 user from Computer" ;)

Now im off able to make my masterpiece! = more threads of this sort will come :)

cain2001 was my old username, all my post were from this subforum :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×