Jump to content

Recommended Posts

Im trying to make a .sqf file

I am doing so by making a new document in my missions folder named "rem.sqf" and then opening it typing a bit of code and then saving the file by changing the type from "text" to "all files" 

the document still shows up as a text file though. 

I am using notepad. 

help would be appreciated 

Share this post


Link to post
Share on other sites

Have you checked the box in your Windows Explorer options to show "File name extensions?" Because if you haven't, and you rename a file, all you're doing is changing it to "rem.sqf.txt" because you're only editing the filename, not the extension as well (which is hidden).

 

Sorry, also, I think that if you're in notepad and "Save as" and change the type to "All files (*.*)" it should still work anyway.

  • Like 2

Share this post


Link to post
Share on other sites

Update: 

So i have the file. 

My rem.sqf looks like this 

"removeHeadgear this:
removeGoggles this;
removeVest this;
removeBackpack this;
removeUniform this;
removeAllWeapons this:
removeAllAssignedItems this;"

How do I make this happen in game?

Share this post


Link to post
Share on other sites

Without going into too much detail, just keep it simple and replace this with player:

removeHeadgear player:
removeGoggles player;
removeVest player;
removeBackpack player;
removeUniform player;
removeAllWeapons player:
removeAllAssignedItems player;

Then, create another .sqf file but call this one init.sqf. It has to be named that, so that when the mission starts any code in the init.sqf will run. Then in the init.sqf, put:

execVM "rem.sqf";

 

Share this post


Link to post
Share on other sites

Still no good. 

rem.sqf is not being found

 

I am placing in my player's init field "null= [] execVM "rem.sqf";" maybe this is the problem?

Share this post


Link to post
Share on other sites
4 minutes ago, Jubal Savid said:

null= [] execVM "rem.sqf";

 

Should be:

nul = [] execVM "rem.sqf";

The difference being nul v's null.

  • Like 1

Share this post


Link to post
Share on other sites

Still no good. 

nul = [] execVM "rem.sqf"; is what i have in the player's initiation field. 

However it still says rem.sqf not found. 

Literally all I have done is make both the "init.sqf" and the "rem.sqf" and add" nul = [] execVM "rem.sqf";" to the human player's initiation field. 

Share this post


Link to post
Share on other sites

Ahhh, well assuming rem.sqf is in the mission folder directory it will work. There is a mistake somewhere and it's most likely a very simple one. I've gotta go to bed, but if you upload the mission somewhere (Dropbox, Google drive, etc) and paste a link here it'll get sorted out quick smart.

Share this post


Link to post
Share on other sites

Well, first of all, if you place

nil = execVM "rem.sqf";

in the player's init field you don't need init.sqf.

Secondly, I am almost 100% (close to  99.9% to be more exact 😋... Check the wiki) sure that it should be nil instead of nul.

Finally, if your rem.sqf is NOT in the mission folder you should specify a relative path like

// Assuming that rem.sqf is in a subfolder named "TestingForumsSuggestions" inside the mission's folder
nil = execVM "Scripts/TestingForumsSuggestions/rem.sqf"; // Execute the script

Also, there is a version/syntax of execVM that needs no arguments, so you can omitt the brackets (wiki link).

 

Hope this solves the problem 🤞.

Share this post


Link to post
Share on other sites
6 hours ago, beno_83au said:

The difference being nul v's null.

Makes no difference, both are variables, it is like saying 
nmber = 123 is wrong and should be number = 123

  • Like 3
  • Haha 1

Share this post


Link to post
Share on other sites
22 minutes ago, ZaellixA said:

Well, first of all, if you place


nil = execVM "rem.sqf"


nil is a nular command you cannot assign to nular command, please do not confuse people

  • Like 1

Share this post


Link to post
Share on other sites

Well, sorry if I caused any confusion. I just used nil because I thought that the idea was to not assign the script handler. Didn't really mean to imply that nil is a variable. Because, as you also said, there is no (functional) difference between nul and null I thought that nil was meant right from the start.

 

Thanks for the clarification though and hope this didn't cause any confusion... 😐

  • Haha 1

Share this post


Link to post
Share on other sites

I use 0:

0 = []

😁

  • Like 4

Share this post


Link to post
Share on other sites

:hehe:

So do I, sometimes, in triggers or init fields... 0 is not so null

  • Like 3
  • Haha 1

Share this post


Link to post
Share on other sites
20 hours ago, ZaellixA said:

I just used nil because I thought that the idea was to not assign the script handler.

No the idea is to swallow the script handle (assign to a throwaway var) so it is not left as a return value from the executing code.

 

Quite often see debugConsole examples from me using h for scriptHandle. In my projects I ordinarily use nul or variation of.

  • Like 2

Share this post


Link to post
Share on other sites

If execVM doesn't work you can also try

call compile preprocessFileLineNumbers "rem.sqf";

 

  • Like 1
  • Confused 1

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

×