Jump to content

ZCR Dev Library - SQF c-like/PHP-like functions - Making scripting easier


Recommended Posts

Hi all,

 

While re-developing ZFM I have found I need some useful tools which aren't really in one place at the moment. There are some existing tools for arrays, strings, and so on, which are useful, but their features are a bit haphazard and aren't consistent in what they offer. It's very annoying that SQF doesn't have any existing functions for doing things like string length, and all the rest, so I just thought "why not make one?" like I usually do.

 

ZCR is a Common Runtime, meaning it's something you can include in your projects and use under an open-source license. ZCR brings PHP and c-like functions over to SQF for you to use and doesn't require including an additional module, just adding in a "call compile" at the top of your scripts.

 

Documentation:

https://github.com/zambino/zambinocommonruntime/wiki

 

Where to get it:

https://github.com/zambino/zambinocommonruntime

 

How to install it

  1. Download the repo from the link above
  2. Extract the "ZCR" folder into the main folder your scripts are in.
  3. In the main init file/whichever file you want to use ZCR in, add in the following:
    call compile preprocessFileLineNumbers "ZCR/ZCR_init.sqf";
    
  4. Happy trails..

What it provides:

 

ZCR has the following functions as of 0.2:

 

Strings:

  • StrpBrk
  • StrLen
  • SubString
  • StrPos
  • Implode

Arrays

  • Array_Reduce (With callback)
  • Array_Shuffle
  • Array_Unique
  • Array_Pop
  • Array_Shift
  • Array_Slice
  • Array_Intersect
  • Array_Chunk
  • Array_Merge
  • Array_Fill

 

I will be providing a @Mod version of the library too with more features as I require them in ZFM.

 

Happy developing,

Zamboni

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...