Closed freghar closed 8 years ago
Note that for cinematic effect, BIS_fnc_establishingShot
may be better - it includes typing the text, date, time and shows the target location from an UAV-like view. It can also display icons in 3D as map markers, allowing ie. establishing shot of multiple enemy artillery positions, each with a marker on it.
// [target_position_or_object, "text to display", altitude_of_camera, radius_of_camera_around_pos]
0 = [player, "Awaiting counterattack", 50, 20] spawn BIS_fnc_establishingShot;
It also has more arguments, see https://community.bistudio.com/wiki/BIS_fnc_establishingShot .
@milivojm - maybe useful for the case you originally had in mind.
Very nice. Again, you found a function I wasn't aware of. :+1:
In any case, the basic OSD version is also done, eaa5e4cbb4.
Wanted to ask you, I've seen you use a lot of exitWith
? Does it behave like it should? I know there is a warning on the wiki page about that not behaving well.
Well, it's the only way to break out a scope without restarting it, essentially the equivalent of break
and return
in other languages, so I kind of have to use it to create programming logic that doesn't look like brainf*ck. :)
Yes, it seems to behave as it should, but it has some unexplained behavior as it doesn't simply end the scope in all cases - ie. in a forEach
loop, it ends the loop entirely, despite being in its own {}
. This makes common sense, but it defies the strict definition.
The weirdest thing is that you cannot write constructions like
while {something} do {
if (cond) then {
exitWith {};
};
};
in SQF, because the exitWith
terminates the if
scope, not the while
scope. Hence the alternative syntax of
while {something} do {
if (cond) exitWith {};
};
(notice no then
and no new scope). Unfortunately, this makes nested conditions breaking the while
loop impossible to do.
It behaves deterministically, it's just a bit weird to use if you're used to some actual programming languages. :)
Create the following wrappers for
BIS_fnc_typeText
orBIS_fnc_typeText
that would abstract the XML-like formatting:(these could be combined, but that would perhaps complicate the data input format).
Also create a function that would display mission info (
nearestLocations
, time as "0800", map name, ... holywood style) using the OSD functions.