Jump to content

Fiddi

Member
  • Content Count

    241
  • Joined

  • Last visited

  • Medals

Everything posted by Fiddi

  1. Okay, so now it finds positions but if it doesn't get a dead-end from those roads found earlier it returns with an error Zero divisor when it tries to access an array number that doesn't exist. I'm having a brain-fart, I can't figure out how to make a foolproof way to find dead-ends.
  2. Okay, changed that, now I get an undefined variable in _spawnRoad.
  3. So far I have this: private ["_spawnRoadSegment", "_spawnRoad","_roads"]; _spawnPos = [getPos HQ_dropOff, 5000, 7500, 10, 0, 0.3, 0] call BIS_fnc_findSafePos; waitUntil {Sleep 1; !isNil "_spawnPos"}; _roadRadius = 50; _roads = []; While {count _roads < 5} do { Sleep 0.05; _roads = _spawnPos nearRoads _roadRadius; _roadRadius = _roadRadius + 50; }; hint format["%1", _roads]; _roadSelectArray = 0; while {_spawnRoad isEqualTo ObjNull} do { _spawnRoadSegment = _roads select _roadSelectArray; _connectedRoads = roadsConnectedTo _spawnRoadSegment; if(count _connectedRoads isEqualTo 1) exitWith {_spawnRoad = _connectedRoads select 0;}; _roadSelectArray = _roadSelectArray + 1; }; _spawnPos = getPos _spawnRoad; _markerName = "jasf"; _markerStr = createMarker [str(_markerName), _spawnPos]; _markerStr setMarkerShape "ELLIPSE"; str(_markerName) setMarkerBrush "SolidBorder"; str(_markerName) setMarkerColor "ColorOrange"; str(_markerName) setMarkerSize [100, 100]; str(_markerName) setMarkerAlpha 1; This part works, I think, but not the other: _roadRadius = 50; _roads = []; While {count _roads < 5} do { Sleep 0.05; _roads = _spawnPos nearRoads _roadRadius; _roadRadius = _roadRadius + 50; };
  4. Okay, I'm not exactly sure what you mean, I'm with you on the nearRoads part. But connecting roads, how would I filter out a road that has only 1 connecting road? I'm just gonna have 3 vehicles, but I can't figure out how you mean.. :confused_o:
  5. I did some testing, made a convoy containing three vehicles in a group, A hunter, A HEMTT and an AMV Marshall. The went from Camp Rogain to Stratis Airbase, passing through Agia Marina with a single MOVE waypoint in the airbase. They were in Limited speed and Column formation. I tried a couple of times on both Vcom and Vanilla. VANILLA: To Agia Marina: 4.00 min, no damage or issues, other than a little but reversing in the middle of the road without obstacles. Outside Agia Marina: 1.40 min, didn't use the bridge (drove beside), and got caught on a telephone pole, but quickly returned to the road. Airbase, finish: 1.20 min, perfect run. Total of ca. 7 minutes. VCom: To Agia Marina: 4.50 min, not much to say about the way there, pretty much the same as vanilla except a bit slower to get out of rogain. They got stuck on the bridge in agia marina everytime and never finished the waypoint, also they didn't actually use the bridge, they too drove beside it and got permanently stuck on the pole which the vanilla managed to drive past. Okay, so the convoy part is good, now to just find a good spot to spawn them. I've been wondering about the blacklist parameter in FindSafePos, how do I use that?
  6. Thanks for the answer! I, preferrably, want to do this without involving other scripts, but I will see what at least the second is doing. How stupid is the AI at low speed? The convoy will be moving with limited speed, and not fast. So is the VCom essential or just handy if there are many obstacles, I'm a little worried about the performance impact? Also, the first problem remains, how to find a suitable place to spawn the convoy. On a road, 10 km away, in a random direction (not within 5km of players), without them blowing up due to spawning inside each other.
  7. Okay, so say you have a file named "FRED_fnc_typeText.sqf" in the folder functions (I put this in for educational purposes) in the mission root folder, the file contains the function. /* Author: Jiri Wainar Modified by: Fredrik Eriksson Description: Types a structured text on the screen, letter by letter, cursor blinking. Parameter(s): 0 : NUMBER Typing Speed. 1 : NUMBER Delay before disappearing. 2 : ARRAY 0 : ARRAY 0 : ARRAY 0 : STRING Your text here, multiple lines and structuring supported. 1 : STRING Structuring and formatting here. 3 : NUMBER X-position. 4 : NUMBER Y-position. Remarks: * Every text block is an array of text and formatting tag. * Blocks don't have to span over whole line. Example: [ 0.06, 10, [ [ ["TEXTTEXTTEXT","<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t>"], ["MORETEXT","<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t><br/>"], ["ANDSOMEMORE","<t align = 'center' shadow = '1' size = '1.0' font='PuristaBold'>%1</t><br/>"], ] ], 1,1 ] spawn FRED_fnc_typeText; */ FRED_fnc_typeText = { private["_data","_posX","_posY","_rootFormat","_toDisplay"]; private["_blocks","_block","_blockCount","_blockNr","_blockArray","_blockText","_blockTextF","_blockTextF_","_blockFormat","_formats","_inputData","_processedTextF","_char","_cursorInvis","_blinkCounts","_blinkCount"]; _delayCharacter = _this select 0; _delayRemove = _this select 1; _data = _this select 2 param [0, [], [[]]]; _rootFormat = _this select 2 param [1, "<t >%1</t>", [""]]; _posX = _this select 3; _posY = _this select 4; _delayCursor = 0.04; _blockCount = count _data; _invisCursor = "<t color ='#00000000' shadow = '0'>_</t>"; //process the input data _blocks = []; _formats = []; _blinkCounts = []; { _inputData = _x; _block = _inputData param [0, "", [""]]; _format = _inputData param [1, "<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>", [""]]; _blinkCount = _inputData param [2, 5, [123]]; //convert strings into array of chars _blockArray = toArray _block; {_blockArray set [_forEachIndex, toString [_x]]} forEach _blockArray; _blocks = _blocks + [_blockArray]; _formats = _formats + [_format]; _blinkCounts = _blinkCounts + [_blinkCount]; } forEach _data; //do the printing _processedTextF = ""; { _blockArray = _x; _blockNr = _forEachIndex; _blockFormat = _formats select _blockNr; _blockText = ""; _blockTextF = ""; _blockTextF_ = ""; { _char = _x; _blockText = _blockText + _char; _blockTextF = format[_blockFormat, _blockText + _invisCursor]; _blockTextF_ = format[_blockFormat, _blockText + "_"]; //print the output _toDisplay = format[_rootFormat,_processedTextF + _blockTextF_]; [_toDisplay, _posX, _posY, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; playSound "ReadoutClick"; sleep _delayCharacter; _toDisplay = format[_rootFormat,_processedTextF + _blockTextF]; [_toDisplay, _posX, _posY, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; sleep _delayCursor; } forEach _blockArray; _blinkCount = _blinkCounts select _forEachIndex; if (_blinkCount > 0) then { for "_i" from 1 to _blinkCount do { _toDisplay = format[_rootFormat,_processedTextF + _blockTextF_]; [_toDisplay, _posX, _posY, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; sleep _delayCharacter; _toDisplay = format[_rootFormat,_processedTextF + _blockTextF]; [_toDisplay, _posX, _posY, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; sleep _delayCursor; }; }; //store finished block _processedTextF = _processedTextF + _blockTextF; } forEach _blocks; Sleep _delayRemove; //clean the screen ["", _posX, _posY, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; }; Like so. After in init.sqf you have this at the top: call compile preprocessFileLineNumbers "functions\FRED_fnc_typeText.sqf"; And whenever you want the typeText to appear you put this ie. in init.sqf under the line above: [ 0.5, 10, [ [ ["TEXTTEXTTEXT","<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t>"], ["MORETEXT","<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t><br/>"], ["ANDSOMEMORE","<t align = 'center' shadow = '1' size = '1.0' font='PuristaBold'>%1</t><br/>"], ["ANDSOMEMORE","<t align = 'center' shadow = '1' size = '1.0' font='PuristaBold'>%1</t><br/>"] ] ], 1,1 ] spawn FRED_fnc_typeText; You can change the structuring yourself, I'm not sure about this one, I have not read much into it. But you can find more information here: https://community.bistudio.com/wiki/Structured_Text
  8. Not necessary, but you can if you want, it's neater that way probably. EDIT: Wait, yeah, if you Preprocess "FRED_fnc_typeText.sqf", you also need a file named so. Otherwise it compiles nothing. However you can Compile a file with my function in it called "CRAP.sqf" if you want, the functions name is not tied to the filename.
  9. Nevermind the former post, I have now modified and successfully added both control over typing speed and time it is up on screen. /* Author: Jiri Wainar Modified by: Fredrik Eriksson Description: Types a structured text on the screen, letter by letter, cursor blinking. Parameter(s): 0 : NUMBER Typing Speed. DEFAULT: 0.06 1 : NUMBER Delay in seconds before disappearing. 2 : ARRAY 0 : ARRAY 0 : ARRAY 0 : STRING Your text here, multiple lines and structuring supported. 1 : STRING Structuring and formatting here. 3 : NUMBER X-position. DEFAULT: 0 4 : NUMBER Y-position. DEFAULT: 0 Remarks: * Every text block is an array of text and formatting tag. * Blocks don't have to span over whole line. Example: [ 0.06, 10, [ [ ["TEXTTEXTTEXT","<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t>"], ["MORETEXT","<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t><br/>"], ["ANDSOMEMORE","<t align = 'center' shadow = '1' size = '1.0' font='PuristaBold'>%1</t><br/>"], ] ], 1,1 ] spawn FRED_fnc_typeText; */ FRED_fnc_typeText = { private["_data","_posX","_posY","_rootFormat","_toDisplay"]; private["_blocks","_block","_blockCount","_blockNr","_blockArray","_blockText","_blockTextF","_blockTextF_","_blockFormat","_formats","_inputData","_processedTextF","_char","_cursorInvis","_blinkCounts","_blinkCount"]; _delayCharacter = _this select 0; _delayRemove = _this select 1; _data = _this select 2 param [0, [], [[]]]; _rootFormat = _this select 2 param [1, "<t >%1</t>", [""]]; _posX = _this select 3; _posY = _this select 4; _delayCursor = 0.04; _blockCount = count _data; _invisCursor = "<t color ='#00000000' shadow = '0'>_</t>"; //process the input data _blocks = []; _formats = []; _blinkCounts = []; { _inputData = _x; _block = _inputData param [0, "", [""]]; _format = _inputData param [1, "<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>", [""]]; _blinkCount = _inputData param [2, 5, [123]]; //convert strings into array of chars _blockArray = toArray _block; {_blockArray set [_forEachIndex, toString [_x]]} forEach _blockArray; _blocks = _blocks + [_blockArray]; _formats = _formats + [_format]; _blinkCounts = _blinkCounts + [_blinkCount]; } forEach _data; //do the printing _processedTextF = ""; { _blockArray = _x; _blockNr = _forEachIndex; _blockFormat = _formats select _blockNr; _blockText = ""; _blockTextF = ""; _blockTextF_ = ""; { _char = _x; _blockText = _blockText + _char; _blockTextF = format[_blockFormat, _blockText + _invisCursor]; _blockTextF_ = format[_blockFormat, _blockText + "_"]; //print the output _toDisplay = format[_rootFormat,_processedTextF + _blockTextF_]; [_toDisplay, _posX, _posY, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; playSound "ReadoutClick"; sleep _delayCharacter; _toDisplay = format[_rootFormat,_processedTextF + _blockTextF]; [_toDisplay, _posX, _posY, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; sleep _delayCursor; } forEach _blockArray; _blinkCount = _blinkCounts select _forEachIndex; if (_blinkCount > 0) then { for "_i" from 1 to _blinkCount do { _toDisplay = format[_rootFormat,_processedTextF + _blockTextF_]; [_toDisplay, _posX, _posY, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; sleep _delayCharacter; _toDisplay = format[_rootFormat,_processedTextF + _blockTextF]; [_toDisplay, _posX, _posY, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; sleep _delayCursor; }; }; //store finished block _processedTextF = _processedTextF + _blockTextF; } forEach _blocks; Sleep _delayRemove; //clean the screen ["", _posX, _posY, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; }; Spawn it with: [ 0.06, 10, [ [ ["TEXTTEXTTEXT","<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t>"], ["MORETEXT","<t align = 'center' shadow = '1' size = '0.7' font='PuristaBold'>%1</t><br/>"], ["ANDSOMEMORE","<t align = 'center' shadow = '1' size = '1.0' font='PuristaBold'>%1</t><br/>"], ] ], 0,0 ] spawn FRED_fnc_typeText;
  10. After looking at the function in the functions viewer I can say that those lines being in the wiki is most likely a mistake, they're part of the function. I'm not sure how to rewrite that particular part to allow different values on those two though. On the infoText part, you can use multiple lines to display your title. You can have 4 lines, before those are cut off by the boundary of the UI element infoText seem to be bound in.
  11. Oh, I don't use it at the beginning but you can certainly have it like you have in your init.sqf. I guess I explained poorly. I use mine later in the mission for side mission, but I'll probably add on one at the start of the mission as well. call compile preprocessFileLineNumbers "FRED_fnc_infoText.sqf"; [["SIDE OPS", "BY: FREDRIK", format["11th July 2035, %1",([dayTime, "HH:MM"] call BIS_fnc_timeToString)]], 10] spawn FRED_fnc_infoText; Something like that, Some name, my Name, and the current date and time. and I want it up for 10 seconds.
  12. call compile preprocessFileLineNumbers "FRED_fnc_infoText.sqf"; That's what I use. https://community.bistudio.com/wiki/BIS_fnc_typeText #define DELAY_CHARACTER 0.06; #define DELAY_CURSOR 0.04; Don't really know where to put that, other than maybe in description.ext. About increasing letter limit, no idea, want to know that with infoText also.
  13. Oh, so it was that easy... Thanks alot for the help!
  14. Hey, I have a little question, how would I get who pressed a button in a custom GUI Menu? I need to forward the activating player to a script, this is the button in question. class MTHI_GUI_5: SUPER_BUTTON { idc = -2; text = "STRATEGIC MAP"; x = 0.45 * safezoneW + safezoneX; y = 0.525 * safezoneH + safezoneY; w = 0.1 * safezoneW; h = 0.05 * safezoneH; sizeEx = "0.029 / (getResolution select 5)"; action = "closeDialog 0; [/*PLAYERHERE*/] execVM 'SideOps\SideOpsSelectMission.sqf'"; }; The GUI Menu is called by an action if that helps.
  15. Yes, what na_palm said. I forgot to add that in my post, sorry. Anyway glad it worked out. :)
  16. I have this in my mission, since I thought that it fades away to quickly. Not exactly what you want but you can choose the delay yourself. FRED_fnc_infoText = { /* File: infoText.sqf Author: Karel Moricky Modified By: Fredrik Eriksson Description: Info with some effect. Parameter(s): 0 : ARRAY - Array containing lines of text. 1 : NUMBER - Seconds before text fades away. */ (["FRED_info"] call bis_fnc_rscLayer) cutrsc ["rscInfoText","plain"]; //--- Separate lines _text = _this select 0; _textArrayUnicode = []; {_textArrayUnicode = _textArrayUnicode + [toarray _x]} foreach _text; _fadeDelay = if (count _this > 1) then {_this select 1} else {2}; //--- Separate letters _textArrayLines = []; for "_i" from 0 to (count _textArrayUnicode - 1) do { _line = _textArrayUnicode select _i; _textArrayTemp = []; {_textArrayTemp = _textArrayTemp + [tostring [_x]]} foreach _line; _textArrayLines set [_i,_textArrayTemp]; }; //--- Merge arrays _textArray = []; _emptyArray = []; _nArrayTemp = []; _n = 0; { _line = _x; _textArray = _textArray + _line + ["\n"]; { //_emptyArray = _emptyArray + [_line call bis_fnc_selectrandom]; //--- Shuffled text //_emptyArray = _emptyArray + [str floor random 2]; //--- Binary Solo //_emptyArray = _emptyArray + [""]; //--- Rolling text _emptyArray = _emptyArray + [" "]; //--- Space _nArrayTemp = _nArrayTemp + [_n]; _n = _n + 1; } foreach _x; _n = _n + 1; _emptyArray = _emptyArray + ["\n"]; } foreach _textArrayLines; _finalArray = _emptyArray; _text = composetext _finalArray; //--- Random order _nArray = []; while {count _nArrayTemp > 0} do { _element = _nArrayTemp select (floor random (count _nArrayTemp)); _nArray = _nArray + [_element]; _nArrayTemp = _nArrayTemp - [_element]; }; //--- Visualization disableserialization; _display = uinamespace getvariable "BIS_InfoText"; _textControl = _display displayctrl 3101; _text = composetext _finalArray; _textControl ctrlsettext str _text; _textControl ctrlcommit 0.01; sleep 1; { _finalArray set [_x,_textArray select _x]; _text = composetext _finalArray; _textControl ctrlsettext str _text; _textControl ctrlcommit 0.01; playsound "ReadoutClick"; if (random 1 > 0.9) then {sleep 0.1}; sleep 0.01; } foreach _nArray; sleep _fadeDelay; //--- Fade away { _finalArray set [_x," "]; _text = composetext _finalArray; _textControl ctrlsettext str _text; _textControl ctrlcommit 0.01; playsound "ReadoutClick"; //if (random 1 > 0.9) then {sleep 0.2}; sleep 0.01; } foreach _nArray; (["FRED_info"] call bis_fnc_rscLayer) cuttext [" ","plain"]; }; So it would be called by: [["TEXT", "text", "TexT"], 10] spawn FRED_fnc_infoText;
  17. Hey, is it possible to establish a closing shot without actually ending the mission and continue afterwards instead? https://community.bistudio.com/wiki/Debriefing Or is there an other way to get the closing shot effect? I think that it's a cool effect and would like to have it in my side missions.
  18. I created this function, works perfectly. Fades perfectly in and fades perfectly out, while playing a little bit of music. FRED_fnc_endSideGraphic = { /* Author: Fredrik Eriksson Description: Side mission ending graphic. Parameter: 0 : STRING - Graphic Name (Defined in Descriptions.ext) Returns: NOTHING */ Private ["_endGraphic"]; _endGraphic = _this select 0; missionnamespace setvariable ["BIS_fnc_missionHandlers_end", _endGraphic]; _layerInterlacing = "BIS_fnc_endMission_interlacing" call bis_fnc_rscLayer; _layerStatic = "BIS_fnc_endMission_static" call bis_fnc_rscLayer; _layerEnd = "BIS_fnc_endMission_end" call bis_fnc_rscLayer; _layerTiles = "BIS_layerEstShot" call BIS_fnc_rscLayer; {_x cuttext ["","PLAIN"]} foreach [_layerInterlacing,_layerStatic,_layerEnd,_layerTiles]; playmusic "EventTrack01_F_Curator"; 2.5 fadesound 0; 0 fademusic 2; _layerStatic cutrsc ["RscStatic","PLAIN"]; Sleep 0.3; showhud false; _layerEnd cutrsc ["RscMissionEnd","PLAIN", 0.5]; _layerInterlacing cutrsc ["RscInterlacing","PLAIN"]; _layerTiles cutrsc ["RscEstablishingShot","PLAIN"]; Sleep 5; _layerStatic cutrsc ["RscStatic","PLAIN"]; 2.5 fadesound 1; Sleep 0.2; {_x cutFadeOut 1} foreach [_layerInterlacing,_layerStatic,_layerEnd]; _layerTiles cutFadeOut 3; showhud true; missionnamespace setvariable ["BIS_fnc_missionHandlers_end", ""]; }; Thanks for the help and advice!
  19. Fiddi

    Visual Upgrade – Feedback

    Yep, that's what I've done the past 3 years, it's just when you start to think about clouds... :D
  20. Fiddi

    Visual Upgrade – Feedback

    Oh, okay. Well, when or if TrueSky developers do fix the problem, will you incorporate the fix into Arma 3?
  21. Fiddi

    Visual Upgrade – Feedback

    The new visuals are absolutely gorgeous, feels a lot more real than before. :D However, clouds are still moving on the edge of the screen when you look around, they change shape..
  22. Okay, I'll do that, thanks. Always thought that a simple notification that a side mission was completed were a bit weak.
  23. According to the examples, I understand that a higher mid value than max and min, generates a higher number. So I guess that you can use floor(random [50,100,50]) * selectRandom [1,-1]; The last is just to generate negative numbers also. There's most likely a better way. Increase min and max to increase the generated number.
  24. Fiddi

    New Respawn Screen (dev branch)

    Would be great if the loadout selector could be configured to be able to choose from saved loadouts from Virtual Arsenal. Though I also could not respawn at all, I'm just getting stuck in the menu without a way out, even abort doesn't work. However I see that you know about this already and I can't wait for a fix. :)
×