Jump to content
Sign in to follow this  
dreadedentity

[CODE SNIPPET] Hopefully this blows your mind/Preprocessor Commands are fun

Recommended Posts

I know that title is rather cryptic, but bear with me. If this works like I think it will, it will be awesome. First go into the editor, pick any map, put a player down, and save it with any name.

Now download this script (Dropbox) and place it in your mission folder. Rename it all you want and then execVM it from your player's init line. (or even just rename it to init and let the game run it for you)

Enjoy! For fun screenshot the hint and post it! (you can blot out your name of course, oops spoilers!)

Edited by DreadedEntity

Share this post


Link to post
Share on other sites

Cryptic title, cryptic information....must....see...what it is all about....I must... :p

Share this post


Link to post
Share on other sites

Throws an error when ran:

Error in expression <
_map = [];
_trash = toArray(_newArray select 14);
reverse _trash;
{
if (_x == >
 Error position: <select 14);
reverse _trash;
{
if (_x == >
 Error Zero divisor
File e:\documents\arma 3 - other profiles\horde\missions\#furniture_1.Stratis\mindBlown.sqf, line 36

Share this post


Link to post
Share on other sites
Throws an error when ran:

Error in expression <
_map = [];
_trash = toArray(_newArray select 14);
reverse _trash;
{
if (_x == >
 Error position: <select 14);
reverse _trash;
{
if (_x == >
 Error Zero divisor
File e:\documents\arma 3 - other profiles\horde\missions\#furniture_1.Stratis\mindBlown.sqf, line 36

It's because your filepath is different! :o

Not enough elements in the array

Share this post


Link to post
Share on other sites
I will change my profile name to something longer immediately! ;)

Well, I thought that the path to missions was hard-coded, but it seems I was wrong. The little script works by reading the mission filepath, parsing the strings, then the results are hard-coded from that array.

Like, the normal filepath if you just used the default install directory would be "C:\Users\YOUR_NAME\Documents\Arma 3 - Other Profiles\PROFILENAME\missions\MISSION_NAME", so I literally just counted which elements I needed from the array to display them in a hint. I actually thought that the mission folder was hard-coded to "my documents", how did you get a different directory?

EDIT: D'oh it makes sense now. Since you're not using your boot drive, there is no Users folder, so just changing the install directory should be sufficient.

Share this post


Link to post
Share on other sites

I wanted to blow my mind with this, but link seems dead already? My mind is safe for now... :(

Share this post


Link to post
Share on other sites
I wanted to blow my mind with this, but link seems dead already? My mind is safe for now... :(

Oops, that's what I get for organizing my dropbox files! I made a new link

Share this post


Link to post
Share on other sites

Sorry but my mind apparently refused to be blown. ;)

Share this post


Link to post
Share on other sites

I don't really get any of it.. since when is __FILE__ a thing inside sqf? :o But it looks nice nonetheless.

Share this post


Link to post
Share on other sites

Ah I've seen that page. Totally forgot about it, didn't actually know these specific preprocessor commands are a thing.

Share this post


Link to post
Share on other sites

What does "save as" and "run from" supposed to show? There is profileName for profile name and worldName for the map, don't understand why parse script location for that? But my mind was nearly blown from looking at parsing strings into arrays and back if one can use count select and find with strings already :).

Share this post


Link to post
Share on other sites
But my mind was nearly blown from looking at parsing strings into arrays and back if one can use count select and find with strings already :).

Haha thanks, that was the really fun part! Actually it was all pretty fun, "saved as" shows you what you saved the mission as, and "run from" will show you the name of file :)

The only problem with it is that it only works if you have everything saved in the default location (C:\Users\YOUR_NAME\ etc.) due to the static array selections

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  

×