SQF Highlighter – Extension

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix style)
m (Fix description)
Line 9: Line 9:
|-
|-
! style="vertical-align: top" | Version
! style="vertical-align: top" | Version
| 0.5b (continuous updates as of 2022-03-14)
| 0.5b<br>(version is not incremented for now<br>due to continuous updates as of 2022-03-14)
|-
|-
! style="vertical-align: top" | Release Date
! style="vertical-align: top" | Release Date
Line 24: Line 24:
* Unzip the directory to {{hl|wiki/extensions/SQFHighlighter}}
* Unzip the directory to {{hl|wiki/extensions/SQFHighlighter}}
* Add {{ic|wfLoadExtension({{Color|#F33|'SQFHighlighter'}});}} to {{hl|LocalSettings.php}}
* Add {{ic|wfLoadExtension({{Color|#F33|'SQFHighlighter'}});}} to {{hl|LocalSettings.php}}
* There are no settings -the extension only allows relative links from {{hl|community.bistudio.com}} and {{hl|community.bohemia.net}}, any other host will create full path links
* There are no settings - the extension creates full path links unless the host is one of the following (then relative links are created):
** {{hl|community.bistudio.com}}
** {{hl|community.bohemia.net}}




Line 41: Line 43:
| <pre><sqf></sqf></pre>
| <pre><sqf></sqf></pre>
| <sqf></sqf>
| <sqf></sqf>
|- style="vertical-align: top"
| <pre><sqf> </sqf></pre>
| <sqf> </sqf>
|- style="vertical-align: top"
|- style="vertical-align: top"
| <pre><sqf>hint "It Works!";</sqf></pre>
| <pre><sqf>hint "It Works!";</sqf></pre>
Line 55: Line 60:
|- style="vertical-align: top"
|- style="vertical-align: top"
| <pre><sqf>
| <pre><sqf>
#define FADE_IN 3
#define fadeInDuration 3
#define end_duration 10
 
waitUntil { not alive player };
hint DEATH_MESSAGE;
cutText ["", "Black", playerRespawnTime];


if (not alive player) then
private _deathTime = time;
{
Deaths = Deaths + 1;
hint "You are dead";
cutText ["", "Black", playerRespawnTime];
};


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


sleep 3;
sleep 3;
cutText ["Welcome!", "Black in", FADE_IN];
cutText ["Welcome!", "Black in", fadeInDuration];
 
// after 10s, end the mission
sleep end_duration;
[] call BIS_fnc_endMission;
</sqf></pre>
</sqf></pre>
| <sqf>
| <sqf>
#define FADE_IN 3
#define fadeInDuration 3
#define end_duration 10
 
waitUntil { not alive player };
hint DEATH_MESSAGE;
cutText ["", "Black", playerRespawnTime];


if (not alive player) then
private _deathTime = time;
{
Deaths = Deaths + 1;
hint "You are dead";
cutText ["", "Black", playerRespawnTime];
};


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


sleep 3;
sleep 3;
cutText ["Welcome!", "Black in", FADE_IN];
cutText ["Welcome!", "Black in", fadeInDuration];
 
// after 10s, end the mission
sleep end_duration;
[] call BIS_fnc_endMission;
</sqf>
</sqf>
|}
|}
== Known Issues ==
* comment blocks still highlight words as global variables for now
* report other issues on [https://discord.gg/arma Discord]

Revision as of 01:33, 15 March 2022

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