Jump to content

Recommended Posts

Hi all! I'm a huge fan of this game, so I showed it to some of my friends and they actually bought it. They asked me if I could make some kind of Battle Royale "mission" and I said: Sure! I was like hm.. okay im just gonna place some vehicles and stuff, do some basic triggers and the drop-off plane...WAIT! The crates! So I opened up Chris' OFP Editor (a cool tool which I use to make briefings, scripts, custom crates and stuff) and made like 40 different crate variations with various weapons in it. So I have these crate scripts in my mission folder, they work but I have one problem. I want to sort of "randomize" them. By that, I mean that when I put down a crate in editor it's either "crate1", or "crate2", or "crate3"...and so on until "crate40" Is it possible?

Im using - [this] exec "crate1.sqs" - at the weapon crate's init. line to "define" my crate script or however u say it, it's not my native language lol.

Anyway, thx for anyone in advance! Peace! 😄

Share this post


Link to post
Share on other sites
Quote

nr = 1 + abs (random  40); [this] exec format["crate%1.sqs", nr]

So I tried this one and it SHOULD do the trick so thanks for it but when I tried it in game for some reason the code is searching for non-existing crates. What I mean:

So as I stated before I have "crate1.sqs" and so on until "crate40.sqs" and this code that u sent does exactly what I want, pick one of the crates randomly. however for some reason it searches for like "crate6.19043" and 18.5684 so basically it puts random (mybe random) digits after it and so the editor tells me that there is no such crate as crate18.5684.

Do you know what causes this? I was really happy when I saw that ur answered but now I'm sad it doesn't work 😞

Thx in advance 😄

-Dima

ps. Just i case I'll attach some pics :)

(Hope it'll show correctly)

(psps.:sry my pc's in Hungarian language:D)

thumb_show.php?i=2u9cvha52thumb_show.php?i=xkv5kxuvxthumb_show.php?i=93webktbj

Share this post


Link to post
Share on other sites

ah, stupid me - it should be floor instead of abs (absolute just changes negative to positive)

nr = 1 + floor (random  40); [this] exec format["crate%1.sqs", nr] 

 

Share this post


Link to post
Share on other sites

Lol I just checked in! Thx, I'll try it now! Ya probably saved my ass... Thx bro, appreciated!

Share this post


Link to post
Share on other sites

It still says unknown operator... 😞

(Btw sorry for bothering you, but  I really want this to work... 😄 )

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

×