-
Content Count
4313 -
Joined
-
Last visited
-
Medals
Posts posted by Grumpy Old Man
-
-
42 minutes ago, davidoss said:What exactly are you trying to do?
Hard to tell where you're having problems from your snippet above, besides odd if then checks...
Cheers
-
This could do the trick (untested):
_bedTypes = [ "Land_Sleeping_bag_F", "Land_Sleeping_bag_blue_F", "Land_Sleeping_bag_brown_F", "Land_Ground_sheet_F", "Land_Ground_sheet_blue_F", "Land_Ground_sheet_khaki_F", "Land_Ground_sheet_OPFOR_F", "Land_Ground_sheet_yellow_F" ]; _beds = vehicles select {typeOf _x in _bedTypes}; { _x addAction ["Dormir 5 Horas",{ titleCut ["", "BLACK OUT", 5]; 5 fadeSound 0; sleep 5; titletext ["6 Hours later", "PLAIN"]; disableUserInput true; [player,"AinjPpneMstpSnonWrflDnon"] remoteExec ["switchMove", 0]; player setDir (direction _bedTypes); player setPos (_bedTypes modelToWorld [0,0.25,0]); skiptime 8; sleep 10; 5 fadeSound 1; "dynamicBlur" ppEffectEnable true; "dynamicBlur" ppEffectAdjust [6]; "dynamicBlur" ppEffectCommit 0; "dynamicBlur" ppEffectAdjust [0.0]; "dynamicBlur" ppEffectCommit 10; titleCut ["", "BLACK IN", 5]; sleep 3; [player,"AinjPpneMstpSnonWrflDnon_rolltofront"] remoteExec ["playMove", 0]; _fin = player addEventHandler ["AnimDone",{ [(_this select 0),"AmovPpneMstpSrasWrflDnon"] remoteExec ["switchMove",0]; }]; uiSleep 3; player removeEventHandler ["AnimDone",_fin]; disableUserInput false } ]; } forEach _beds;-
2
-
-
6 minutes ago, Vanhouten_cz said:guys I need help with ingame time.
My story: i have mission, where I need launch nuke at 12:00. Mission is started at 10:00. When I use BI countdown timer, countdown isnt accurate (because acctime, save/load, etc. - difference should be +- 30 minutes ingame time, so in result it is one hour "window" when nuke can launched).
My idea is use ingame time. I try many things with this, but I´m not able to do it functional. I have complete whole mission with almost 2 hours gameplay but this problem with countdown makes me crazy :-/ Other two friends try to fix it, but they also dont know.
Can anyone help me with this?
Idea: Script checking ingame time (no how long I am playing, but time on ingame clocks). When will be 12:00 script start my script "launch.sqf".
What I try to use. But isn´t accurate.
_launch = time + 7200; waitUntil {time >= _launch};Has someone any idea? Thank you
Simply use daytime:
_launch = 14; waitUntil {dayTime > _launch};Cheers
-
2
-
-
11 hours ago, killzone_kid said:
This will not change playerSide thoughIndeed, weird, the wiki suggests otherwise:
QuoteReturns the player's side. This is valid even when the player controlled person is dead (a difference from side player).
After reading the comments I decided to do a quick check, playerSide always seems to return the initial side of the player unit (maybe retrieved from Cfg?).
Even after joining east group and setting captive it returns west, the initial side.
So it will be better to check for side player instead.
This begs the question of the actual purpose of playerSide, heh.
Cheers
-
3
-
-
14 hours ago, Naiss said:How would someone change their Faction from west to civilian?
Let's say I'm west now so when I use PlayerSide command it returns west but i wanna change that to return Civ without the player needing to change slot
Thanks
12 hours ago, davidoss said:PlayerSide will return west, even if the player is setCaptive true.
setCaptive only pretends to change sides, a captive west player will still engage east units.
To properly change sides you need to use join or joinSilent:
[player] joinSilent createGroup civilian;Cheers
-
2
-
-
2 hours ago, MuRaZorWitchKING said:this is just someone else's work that I have revamped for a re-release. If the original author of the script no longer wants this up, this post WILL be removed.
That's not how this works.
You have to get permission first before releasing or "re-releasing" a tweak or modificated work made by someone else (unless stated otherwise inside the original files).
It's a bit unfortunate especially with a community that has quite some fluctuation in its member base (transition from A2 to A3 was really rough, lots of folks left for good with no way to contact them).
Fortunately sqf is pretty easy to get a hold of and there's still plenty of folks left that make scripts for the heck of it.
Cheers
-
1 hour ago, M1ke_SK said:Well, if it is your code you should know how to use it :D
btw that script is made by "Steven Campbell"
Here is maybe more info about it.
https://www.altisliferpg.com/topic/4703-traffic-light-script-for-the-e76-traffic-lights/
(note for moderators: not promoting other forums ... )
You should post on some altis life forum, they will probably help you more than here.
Well he ripped it off some altis life server, so it has to be his code, right?
SpoilerAlso curious how this should work:
if(isServer && {life_loopExit}) exitWith {
Cheers
-
2
-
-
On 12/24/2018 at 12:56 PM, JohnKalo said:Merry Christmas @Far East Lieutenant! Hope you all have a great time. It does indeed not work @Grumpy Old Man
It shows this error:
Tried changing the condition but errors kept on popping up. How can this be fixed please?
Guess sqf strikes again, for some reason # demands brackets if another command is involved (if I remember correctly),
something like this might fix it:
!isNull (_x#1)Cheers
-
52 minutes ago, gc8 said:Well you know all those lineintersect calls you have to make. if house has 10 positions and there's 50 houses in town your code has to make 500 intersect calls. So I would prefer another way :)
Just check once for every unique house className on the map upon mission start via preInit or postInit.
Cheers
-
2
-
-
4 minutes ago, JohnKalo said:Glad to hear it worked! Yep the weekend seems to be going fine. Spending much time in editing myself. As for issue number 3 let us not leave it unresolved

Here is what you can try,
1.] Create any sort of marker you like in the editor and name it nameOfMarker.
2.] You have already named your units so we will use the name directly p1.
2.] In your init.sqf place this line:
[] spawn { while{not isnull p1} do {"nameOfMarker" setmarkerpos getpos p1; sleep 0.5;}; };
All done for unit p1! The above line will attach the nameOfMarker marker on your p1 unit and its position will be updated on anybodys map after 0.5 seconds.
Doing so for all units will give you the exact position in real time for all units you desire. Maybe you only want the leaders' positions so you will add 2 such lines in your init.sqf.
For the units' names you can just add a text to each unit's marker.
For more markers you just copy paste the above as many times as you like like this:
[] spawn { while{not isnull drop_plane} do {"Marker_drop_plane" setmarkerpos getpos drop_plane; sleep 0.5;}; }; [] spawn { while{not isnull aa0} do {"marker_aa0" setmarkerpos getpos aa0; sleep 1;}; }; [] spawn { while{not isnull aa1} do {"marker_aa1" setmarkerpos getpos aa1; sleep 1;}; }; [] spawn { while{not isnull hostjet0} do {"marker_hostjet0" setmarkerpos getpos hostjet0; sleep 1;}; }; [] spawn { while{not isnull hostjet1} do {"marker_hostjet1" setmarkerpos getpos hostjet1; sleep 1;}; }; [] spawn { while{not isnull hostjet2} do {"marker_hostjet2" setmarkerpos getpos hostjet2; sleep 1;}; }; [] spawn { while{not isnull aa2} do {"marker_aa2" setmarkerpos getpos aa2; sleep 1;}; }; [] spawn { while{not isnull aa3} do {"marker_aa3" setmarkerpos getpos aa3; sleep 1;}; };
It would be wise to just not over-minimize the 0.5 value. That might cause lag if set to 0.001 for example. It will be less realisticly shown in the map too.
I'd reduce all those loops into a single array and put it into an eachFrame EH so you actually get a realtime update (if this is wanted):
//initplayerlocal.sqf addMissionEventHandler ["EachFrame",{ _array = [ ["Marker_drop_plane",drop_plane], ["marker_aa0",aa0], ["marker_aa1",aa1], ["marker_hostjet0",hostjet0], ["marker_hostjet1",hostjet1], ["marker_hostjet2",hostjet2], ["marker_aa2",aa2], ["marker_aa3",aa3] ]; { if (!isNull _x#1) then {_x#0 setMarkerPos _x#1}; } forEach _array; }];setMarkerPos doesn't eat much performance, you can easily do this for a dozen or so vehicles, as long as it's done locally via initPlayerLocal.sqf.
You can reduce it even further if you plan on creating the markers dynamically, so you don't need to touch the array at all, just a simple setVariable in the object init field would do.
Cheers
-
3
-
-
1 hour ago, gc8 said:@haleks Sounds like that could work but then there's the performance question, hmmm
What performance question?
Cheers
-
1
-
-
14 minutes ago, johnnyboy said:I want to be able to detect if a particular AI is being fired at by the enemy. FiredNear eventHandler is not good enough, as the AI may not be the target, and anyone within 70 meters (friend or foe) could be firing. I can put Fired eventHandlers on the enemy AI, but that eventHandler does not tell you who he is shooting at.
How can I detect when AI shooting at or near a particular AI?
Thanks!
You could use assignedTarget inside the fired eventhandler, but that doesn't work reliably either, since it can occasionally return objNull for some reason.
Tried to do something similar back in the days without finding a 100% reliable way to return a units current target.
Cheers
-
3
-
1
-
-
15 minutes ago, davidoss said:actRevive = player addAction [ localize "STR_action_revive", { [cursorObject, (_this select 0)] spawn Haz_fnc_revive; }, [], 0, false, false, "", "_this distance cursorObject <= 4 && cursorObject getVariable [""isUnconscious"", FALSE] && !(cursorObject getVariable [""isBeingRevived"", FALSE])"]; [] spawn { while {alive player} do { waitUntil {sleep 1; !isNull cursorTarget && {cursorTarget getVariable ["isUnconscious", FALSE]}}; player setUserActionText [ actRevive, format [localize "STR_action_revive", name cursorTarget]; }; };
???
No need for a separate loop:
_ID = player addAction [name cursorObject, {}, [], 0, false, false, "", "_target setUserActionText [_target getVariable ['TAG_fnc_myActionID',-1], name cursorObject];_target distance cursorObject <= 4"]; player setVariable ["TAG_fnc_myActionID",_ID];Cheers
-
1
-
1
-
-
25 minutes ago, HazJ said:Yeah that! ^^
Sorry I couldn't be more help, it was just way too early for me to code haha. I made a rule. No coding after 2 am. Sh*t tends to get crazy otherwise. Nap time.
Not a question of daytime, it's a question of how much coffee you had and if you're physically capable of making another mug o' black gold.
Cheers
-
1
-
-
The way factions currently work I'd say it's not worth it making a mod just for a few faction strings no one will ever see when playing the game.
Just use a few loadout templates and randomize them to visually create a faction (base cap gang, balaclava troops, fedora federation etc).
Cheers
-
2
-
1
-
-
4 hours ago, Mattmad1234 said:I see what you are getting at here, but am a little confused on how I would actually implement that. (I'm a little new to scripting sorry...)
Could be something like this (untested):
//description.ext class CfgDebriefing { class tooLate { title = "Too Late"; subtitle = ""; description = "Mission in progress, wait for restart to join again."; pictureBackground = ""; picture = "b_inf"; pictureColor[] = {0.0,0.3,0.6,1}; }; }; //initServer.sqf missionNamespace setVariable ["TAG_fnc_kickJIP",false,true]; _lockOut = [] spawn { waitUntil {serverTime > 300}; missionNamespace setVariable ["TAG_fnc_kickJIP",true,true]; }; //initPlayerLocal.sqf params ["_player","_didJIP"]; if (_didJIP AND missionNamespace getVariable ["TAG_fnc_kickJIP",false]) exitWith { "tooLate" call BIS_fnc_endMission;//will end mission locally for player };Cheers
-
3
-
1
-
-
I guess you want to check if at least one group that contains players is left alive?
Condition check returning true when one or less teams containing at least one player is left:
count (allGroups select {count (units _x select {isPlayer _x AND alive _x}) > 0}) <= 1End mission when condition returns true:
//initServer.sqf in mission root _endMission = [] spawn { waitUntil {sleep 3;count (allGroups select {count (units _x select {isPlayer _x AND alive _x}) > 0}) <= 1}; "SideScore" call BIS_fnc_endMissionServer; };Check BIS_fnc_endMissionServer for further parameters.
Edit: corrected function condition, thanks for the hint @GEORGE FLOROS GR
Cheers
-
2
-
-
30 minutes ago, JohnKalo said:If it does not work after respawn it is a major bug since many missions will become unplayable.
It's not a bug.
Tasks assigned via module to objects cease to work, because upon respawn the player becomes a new object.
Can be handled via onPlayerRespawn.sqf or respawn eventhandler etc.
Also you never should execVM either onPlayerRespawn.sqf or onPlayerKilled.sqf since they are automatically executed upon their respective events.
Cheers
-
4
-
-
37 minutes ago, Gen. MERICA said:Thank you both for the quick responses,
GrumpyOldMan that is an interesting solution that I hadn't thought of. I didn't think of having the loop be inside the string to get it to work to avoid passing anything. Although I plan to have multiple borders so I would still have to pass through what location borders we are looking for (there would've been no way for you to know that, I should've had that in my post, my bad.).
I definitely plan to save your example for creating compact and effective loops in the future.
pierremgi I plan to use polygons but I wanted to get lines working first before I attempt a polygon lol, baby steps.
But I did discover something that I never knew you could do with event handlers.
You CAN pass local variables to an event handler
_var = "it"
"You have to structure" + _var + "like so.";
That's just string manipulation, you don't pass variables towards EH scope that way.
You can also go fancy with multiple borders like this, even add custom color for every border etc:
GOM_fnc_drawBorders = { params ["_borderArray"]; { (findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw",format [" _border = %1; _border params ['_markerPrefix','_color']; _markers = allMapMarkers select {toUpper _x find toUpper _markerPrefix >= 0}; _markers sort true; _positions = _markers apply {getMarkerPos _x}; _positions pushBack (_positions#0); { if (_forEachIndex < count _positions - 1) then { (_this select 0) drawLine [ _x, (_positions select (_forEachIndex + 1)), _color ]; } } forEach _positions; ", _x]]; } forEach _borderArray; }; _customBorders = [["RED",[1,0,0,1]],["BLUE",[0,0,1,1]]]; [_customBorders] call GOM_fnc_drawBorders;
Pretty easy to build upon.
3 hours ago, pierremgi said:Why not drawPolygon?
Sure, why not?
GOM_fnc_drawBordersAsLeFancyPolygon = { params ["_borderArray"]; { (findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw",format [" _border = %1; _border params ['_markerPrefix','_color']; _markers = allMapMarkers select {toUpper _x find toUpper _markerPrefix >= 0}; _markers sort true; _positions = _markers apply {getMarkerPos _x}; (_this select 0) drawPolygon [_positions,_color] ", _x]]; } forEach _borderArray; }; _customBorders = [["RED",[1,0,0,1]],["BLUE",[0,0,1,1]]]; [_customBorders] call GOM_fnc_drawBordersAsLeFancyPolygon;Cheers
-
1
-
-
28 minutes ago, Gen. MERICA said:Hello everyone,
I am trying to draw a border through a set of markers like so,
But due to the ctrlAddEventHandler I cant pass local variables to it, so I need to make them global somehow.
I ended up using global place placeholders to pass it through the ctrlAddEventHandler and end up with this,
I believe its due to the way the loop ends up cycling through itself, and it seems to just move the corresponding line.
Does anyone know of a clever work around to this?
FYI the border markers share the same name and text in case this leads to something.
I tried thinking of a solution where it looks for similar names and then links them but it ends up creating a spider web unfortunately.
Thanks in advance
You simply need to sort the array of fitting markers and to close the polygon add the first marker to the end of the array:
(findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw"," _markers = allMapMarkers select {toUpper _x find 'BORDER' >= 0}; _markers sort true; _positions = _markers apply {getMarkerPos _x}; _positions pushBack (_positions#0); { if (_forEachIndex < count _positions - 1) then { (_this select 0) drawLine [ _x, (_positions select (_forEachIndex + 1)), [1,1,1,1] ]; } } forEach _positions; "];This way you simple create one marker named "border" and copy paste it, the automatic marker naming will work fine with the sort command (pasted markers will be named "border_1", "border_2" etc).
Check out the wiki entries of the respective commands, if things are unclear ask again.

Cheers
-
3
-
-
28 minutes ago, Djavu said:Hello guys. I would like to know which programming language most identifies with Arma3. I intend to start some course in this area. Not as a profession, but only out of passion for Arma 3.
I'd say .sqf compares most to something like javascript, it's not really a programming language but a scripting language.
Had no experience in scripting/programming myself prior to sqf (some 4-5 years ago I guess) and am currently neck deep into C++, which I enjoy much more.
The more time I spend in C++, the less I wanna go back to .sqf...
Cheers
-
4
-
2
-
-
14 hours ago, major-stiffy said:unitName, globalChat "chatText"
player, globalChat "This is what I want to say!";
player, globalChat "What?";
These will not work at all, comma has no place in .sqf syntax, not with any amount of beer.
Using sideChat you will only see the group ID and the index of the group member (Alpha 1-5 etc.), not the name.
Using globalChat you will only see the side (Civilian) in front of the message.
The only proper way using the vanilla system for having AI chatter with visible names in white font (directChat doesn't exist for some weird reason, but I'm past that...) is to use kbTell.
A quick showcase to this is to define a basic function so messages are properly transmitted for MP:
//init.sqf or wherever you seem fit GOM_fnc_transmitMessage = { params ["_from","_to","_sentence"]; [_from,["Randomsentence", "protocol.bikb"]] remoteExec ["kbAddtopic",0]; [_from,[_to, "Randomsentence", "Randomsentence", ["Randomsentence", {}, _sentence, [] ]]] remoteexec ["kbtell",0]; true }; //protocol.bikb in mission root class Sentences { class randomsentence { text = "%Randomsentence"; speech[]={%Randomsentence}; class Arguments { class Randomsentence {type = "simple";}; }; }; }; class Arguments{}; class Special{}; startWithVocal[] = {hour}; startWithConsonant[] = {europe, university}; //to make one unit speak to another: _talk = [baschir,player,"Hello"] call GOM_fnc_transmitMessageYou can also give the unit first and last names, using setName:
this setname ["Abdullah Abd-Allah","Abdullah","Abd-Allah"]I believe there's also a more recent function to display chat in the lower center of the screen, no idea, believe it's different from titleText or so...
Cheers
-
2
-
-
No such thing as city IDs, there's probably another script picking the location based on the values from description.ext params.
Other than that, ask the original mission author for permission to alter his mission and how to go about changing those values.
Cheers
-
1
-
1
-
-
4 hours ago, damsous said:No i try with 2 box with your exemple
Do you absolutely have to do it via triggers? Stuff that goes beyond if XY in thisList is done more conveniently with a simple script snippet.
What @pierremgi meant was that the condition won't fire with 2 objects, because it requires >2 objects, means more than 2, other than >=2, which will fire with 2 objects, or more. A simple thing to tweak on your own, really.
Cheers


Change Faction
in ARMA 3 - MISSION EDITING & SCRIPTING
Posted
Why do you need to use playerSide?
Cheers