SQF Highlighter – Extension

From Bohemia Interactive Community
Revision as of 02:33, 15 March 2022 by Lou Montana (talk | contribs) (Fix description)

Categories:
SQF Highlighter
Description Highlights and links SQF commands and functions
Author Lou Montana
Version 0.5b
(version is not incremented for now
due to continuous updates as of 2022-03-14)
Release Date 2022-03-12: First upload
Project Start 2022-03-08: Project start

This extension highlights and automatically links SQF commands and functions.


Installation

  • Unzip the directory to wiki/extensions/SQFHighlighter
  • Add wfLoadExtension('SQFHighlighter'); to LocalSettings.php
  • There are no settings - the extension creates full path links unless the host is one of the following (then relative links are created):
    • community.bistudio.com
    • community.bohemia.net


Usage

Using <sqf> tags will auto-generate syntax highlighting and links to the pages.

Examples
Code Result
<sqf/>
-no SQF code provided-
<sqf></sqf>
-no SQF code provided-
<sqf> </sqf>
-no SQF code provided-
<sqf>hint "It Works!";</sqf>
hint "It Works!";
<sqf>
// your code here
hint "good!";
</sqf>
// your code here hint "good!";
<sqf>
#define fadeInDuration 3
	#define end_duration 10

waitUntil { not alive player };
hint DEATH_MESSAGE;
cutText ["", "Black", playerRespawnTime];

private _deathTime = time;
Deaths = Deaths + 1;

/*
	wait for resurrection
*/
waitUntil { alive player && { preloadCamera getPosATL player } };

sleep 3;
cutText ["Welcome!", "Black in", fadeInDuration];

// after 10s, end the mission
sleep end_duration;
[] call BIS_fnc_endMission;
</sqf>
#define fadeInDuration 3 #define end_duration 10 waitUntil { not alive player }; hint DEATH_MESSAGE; cutText ["", "Black", playerRespawnTime]; private _deathTime = time; Deaths = Deaths + 1; /* wait for resurrection */ waitUntil { alive player && { preloadCamera getPosATL player } }; sleep 3; cutText ["Welcome!", "Black in", fadeInDuration]; // after 10s, end the mission sleep end_duration; [] call BIS_fnc_endMission;


Known Issues

  • comment blocks still highlight words as global variables for now
  • report other issues on Discord