-
Content Count
753 -
Joined
-
Last visited
-
Medals
Everything posted by 7erra
-
Simply reset counter when it reaches a specific amount
7erra replied to Godis_1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Well if you are using an eventhandler (which one exactly? How do you apply it?) you don't need a while-true-loop since EH are way more performance friendly. // use the alternate syntax for getVariable instead: _eosKills = server getVariable ["EOSkillCounter",0]; // if the variable doesn't exist then 0 will be taken _eosKills = _eosKills + 1; server setvariable ["EOSkillCounter",_eosKills,true]; // Add 0.5 CP for each killed Nusra Fighter! commandpointsblu1 = commandpointsblu1 + 0.5; publicVariable "commandpointsblu1"; if (_eosKills >= 75) then { HINTC ["Counter reset!"]; // HintC is local. Depending on where and how you assigned the EH this will only fire on the local pc server setvariable ["EOSkillCounter",0,true]; }; Personally I had some locality issues with setting a variable before so I don't use them. If you are running this script on the server only then global variables will be sufficient and you can instead use remoteExec to execute commands that should fire on other PCs. With this method you might actually save a bit of bandwith since publicVariable broadcasts the variable over the network everytime. The whole locality thing is one huge topic that needs some getting used to. About understanding your code better: while {true} do { // The condition is defined in the brackets. Expression has to return true or false. True means that the code will run the entire mission unless an exitWith statement is placed inside of the code. if (_eosKills >= 75) then { HINTC ["You've killed %1",_eosKills,". Counter reset"]; // Wrong syntax: Missing brackets, see hintC on the BIKI // Update the amount of killed civillians to "0" - make them happy again! _gdskills= 0; // Not wrong but a bit redundant. server setvariable ["GDSKillcounter",_gdskills,true]; // Every new variable takes a bit of performance // Reset the amount of killed Al-Nusra Fighters _eosKills= 0; // See above server setvariable ["EOSkillCounter",_eosKills,true]; // " " }; sleep 0.5; // Now I need to jump back to script start - does that work? // Yes this will check the if statement every .5 seconds. The condition of the while loop will also be checked right here }; -
Need help making a Admin spawn menu using GUI
7erra replied to lel1224's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Your script doesn't make any sense. If you want to get all the displayNames from the config then this will do: Jackson_SpawnVic = { disableSerialization; _ctrl = (findDisplay 7000) displayCtrl 2400; lbClear _ctrl; _configs = "true" configClasses (configFile >> "CfgVehicles"); _displayNames = _configs apply {_x call BIS_fnc_displayName}; { _ctrl lbAdd _x; } forEach _displayNames; }; Also your IDD doesn't correspond with the number in the script. I don't know if a negative number as IDD is even possible. Neither do I know if this script is performance friendly since CfgVehicles has several hundred entries. Let me elaborate on your script errors: -
How to connect effect module and trigger?
7erra replied to primarine's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Right click on module >> Sync to >> Click on trigger >> ??? >> Profit -
Call doesn't work inside trigger
7erra replied to aseliot's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Looks to me as if the variable isn't defined. Check it with systemchat or diag_log. I guess that the trigger size will be 0 then and that leads to this error: beacuse you can't divide by 0. -
BIS_fnc_dynamic test character cap?
7erra replied to Mr H.'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Okay here is a script to create a credit screen. The cutRsc is taken from the BI function. /* Author: Terra Description: Credit screen Parameter(s): 0: Structured text (STRING) 1 (optional): Speed multiplier, determines how fast the text will scroll through (NUMBER) Default: 1 Example: _text = ""; for "_i" from 1 to 10 do { _text = _text +format ["Line %1<br/>",_i]; }; [_text] call TER_fnc_credits; */ disableserialization; params [ "_text", ["_speedMultiplier",1] ]; // Create cutRsc "TER_creditsLayer" cutrsc ["rscDynamicText","BLACK FADED",5]; _display = uinamespace getvariable "BIS_dynamicText"; _control = _display displayctrl 9999; _control ctrlSetStructuredText parseText "Line 0"; _oneLine = ctrlTextHeight _control; // Set text and position _text = parseText format ["<t align='center'>%1</t>",_text]; _control ctrlSetStructuredText _text; _tHeight = ctrlTextHeight _control; _control ctrlSetPosition [ 0 * safezoneW + safezoneX, (1 * safezoneH + safezoneY)+(3*_oneLine), 1 * safezoneW, _tHeight ]; _control ctrlCommit 0; // Move control _control ctrlSetPosition [ 0 * safezoneW + safezoneX, -_tHeight + (0 * safezoneH + safezoneY)-(3*_oneLine), 1 * safezoneW, _tHeight ]; _addSleep = safeZoneH/_oneLine; _commitTime = ((_tHeight/_oneLine)+_addSleep)/_speedMultiplier; _control ctrlCommit _commitTime; waitUntil {ctrlCommitted _control}; "TER_creditsLayer" cuttext ["","plain"];- 10 replies
-
- 1
-
- dynamic test
- fnc
-
(and 1 more)
Tagged with:
-
Creating Markers Not Working
7erra replied to ShadowRanger24's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Okay that was one hell of an obvious error: Change this line... _marker = createMarker ["testtest", [[14672,16625.6], 0, 13000, 3, 0, 1.0, 0] call BIS_fnc_findSafePos]; to this... _markerStr = createMarker ["testtest", [[14672,16625.6], 0, 13000, 3, 0, 1.0, 0] call BIS_fnc_findSafePos]; Notice the variable name? We used two different ones. Makes me wonder why there is no error about an undefined variable though. How are you executing the script? Another thing to keep in mind is that BIS_fnc_findSafePos returns pretty far away positions. Maybe [] call BIS_fnc_randomPos is better suited. What is DMS? -
Creating Markers Not Working
7erra replied to ShadowRanger24's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Oh yeah I forgot one thing: Put this one line above setMarkerType: _markerstr setMarkerShape "ICON"; -
How to enable Modules with Triggers?
7erra replied to Shepherd of Fire's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That depends on the OPCOM script. Normally the module only activates when the trigger is activated but I don't know about ALiVE modules. What exactly is OPCOM and what does it do? Can you post the function that is executed by the module? You can find it by Placing the module Right Click Find in configViewer search for the entry "function = 'TAG_fnc_fncName';", the entries are sorted alphabetical If you want to activate the module only when players are nearby then activation AnyPlayer might be more suitable. Making the trigger local to the server might also save performance but that depends on the function that is executed by the module. -
Creating Markers Not Working
7erra replied to ShadowRanger24's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The syntaxes are messy but it was close. Here is the correct version with comments on what was wrong. Compare it with your script. _marker = createMarker ["testtest", [[14672,16625.6], 0, 13000, 3, 0, 1.0, 0] call BIS_fnc_findSafePos]; //Don't use a local var and pay attention to closing all brackets // If you want to create more than one marker then you'll have to assign different names to them ("testtest") otherwise they won't be created _newtanks29 = [_pos, EAST, (configFile >> "CfgGroups" >> "EAST" >> "OPF_F" >> "Armored" >> "OIA_TankPlatoon")] call BIS_fnc_spawnGroup; // This function returns a group _markerstr = createMarker ["TestTest",leader _newtanks29]; // position: Array or Object - format position: Position3D, Position2D or Object // As already said but this marker might not be created with the same name _markerstr setMarkerType "ExileMissionModerateIcon"; // This is not a standard A3 marker but if it is defined then okay _markerstr setMarkerText "Test Test Charlie"; -
To clarify step 6: class RSC_NAME {// Change RSC_NAME to whatever you like. You will have to use it with ""layerName" cutRsc ["RSC_NAME","PLAIN"]; idd = IDD_NUMBER; //Insert a number here movingEnable = 0; //Decides wether you are able to move the dialog or not, you can't move a cutRsc anyway so leave it as it is onLoad = "0 = _this execVM ""GUI\onLoadHeliOverlay.sqf"""; //Script executed when the dialog is created, _this == [_dialog] duration = 1e+6; // lasts for 1.000.000s, change to 5 then you don't need the "sleep 5; "" cutFadeOut 0;" command in the onLoad script (see below) fadein = 0; // Time to fade in, also influences cutFadeOut command later on fadeout = 0; // Time to fade out class controlsBackground { // Non interactable controls go here [Background, text, (pictures)] }; class controls { // Interactable controls go here (Buttons, listboxes, edits, etc) // The later the class comes, the higher it will be placed on the interface }; }; Regarding step 7: I said it wasn't that hard but actually going back to it made me realize that it takes some practice to use. About step 8: The syntaxes of some of your commands are wrong. If you don't know some commands then it is just the regular procedure as with commands for the game. Google. Most of the commands start with "ctrl". Here is the correct script with comments: disableSerialization; // Working with GUI elements doesn't allow saving, therefore this command. It doesn't do anything gameplay wise except preventing a game error _mainDisplay = _this select 0; // The param passed as an array which contains the dialog. You could also return a normal dialog with "findDisplay IDD" but not a cutRsc. _background = _mainDisplay displayCtrl 2200; //Don't use the classes. Use the idc instead. _textCtrl = _mainDisplay displayCtrl 1100; _imgCtrl = _mainDisplay displayCtrl 1200; _text_1 = "<t color='#00CD00' font='PuristaBold' size='1.2' shadow='1' shadowColor='#000000' align='center'>= JUMP NOW =</t>"; _imgPath = "scripts\jump_system\lights_act\img\green.paa"; //The path to the image is sufficent. No need to format anything as it will be aligned with the control size. // Don't use the same variable for different values if you need it later on //how to call the image in the "image box", and the text in the text box? // Picture: _imgCtrl ctrlSetText _imgPath; //Done // Text: This will be a structured text, therefore we have to use parseText first since RscStructuredText needs text and not a string _text_1 = parseText _text_1; // Formatting is done too _textCtrl ctrlSetStructuredText _text_1; // Now, if you want to let the dialog fade out after 5 seconds everytime then you can use the duration atttribute instead of the following commands. // Remember how you created the dialog: "layerName" cutRsc ["RscName","PLAIN"]. Now take "layerName" and insert it here: sleep 5; "layerName" cutFadeOut 0; //let's the dialgog disappear
-
This is pretty complicated. I couldn't find a solution but here is what I got. Maybe somone else can find out something about this since I am really interested in setting textures on object class type dialog controls. First of all, the dialog that contains the face preview is called "RscDisplayLogin". There is also "RscDisplayNewUser" which conatains the same model ("\A3\ui_f\objects\face_preview"). You can find these either in the config viewer or under "A3\ui_f\config.bin". I debinarized it and here is the content of said class: (uinamespace getvariable 'BIS_fnc_initDisplay') contains the following code. It is always called when a new dialog is created. The most importan part here is the path to the onLoad script. And here is the onLoad script from "A3\ui_f\scripts\GUI\RscDisplayLogin.sqf": These scripts are called in the onLoad script: [_display, 601] call (uinamespace getvariable 'BIS_fnc_setIDCStreamFriendly'); _control ctrladdeventhandler ["buttonclick","with uinamespace do {['properties',_this,''] call RscDisplayLogin_script};"]; ^This is the same script as the onLoad script, just a different code block. The thing is that even when the dialog is created with createDialog "RscDisplayLogin" there is no head. After creating a test dialog which has the same structure as KK's dialog with object there is no head to be seen but the dialog is created since you can see your mouse cursor. The test dialog: This is probably my longest post and it has no added value. But I just wanted to let you know that your question didn't go unnoticed it is just not easy to answer. There is one missing piece in all the scripts that set the face and let's it rotate. Also at some point the listboxes must be filled which isn't the case when creating the dialog with createDialog "RscDisplayLogin". There is no command in the onLoad script either.
-
Possible to make specific units to ignore AddRating
7erra replied to katipo66's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Take a closer look at the discussiont below the setFriend command: Setting civillians as enemy is not good practice. -
BIS_fnc_dynamic test character cap?
7erra replied to Mr H.'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sorry wrong way of thinking by me. What I wanted to know is what your deltaY parameter is. [_strFinal,-1,-1,_duree ,-1] spawn BIS_fnc_dynamicText; With these params the text won't scroll down entirely. Change the last one to a higher number than -1 so the entire text can scroll through. The longer the text the higher (lower) the number has to be. Positive numbers will mean that the text will scroll down while a negative number scrolls up. Default value is 0 with no scrolling at all. -1 only scrolls (as I stated) to line 39 before fading out which is your "length limitation" problem. [_strFinal,-1,-1,_duree ,-100] spawn BIS_fnc_dynamicText; This will scroll through your entire text but the script will run offscreen too. If you want to find the correct value then you'll have to test a bit.- 10 replies
-
- dynamic test
- fnc
-
(and 1 more)
Tagged with:
-
addMissionEventHandler not fired on dedicated server
7erra replied to _SCAR's topic in ARMA 3 - MISSION EDITING & SCRIPTING
So diag_log works on the server when executed upon it (e.g. _var remoteExec ["diag_log",2]) therefore the problem seems to be elsewhere. Can you post the code which executes it and what kind of script it is (initServer.sqf, init.sqf, etc)? Another thing to bear in mind is, that the missionEventhandler only fires when the mission is ended with "trigger of type 'End', endMission command, BIS_fnc_endMission function or ENDMISSION cheat" (see BIKI). -
BIS_fnc_dynamic test character cap?
7erra replied to Mr H.'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
What is your first param when executing this script?- 10 replies
-
- dynamic test
- fnc
-
(and 1 more)
Tagged with:
-
addMissionEventHandler not fired on dedicated server
7erra replied to _SCAR's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Where are you executing this? Are there any if statements? What does SCAR_UCM_fnc_log do? -
BIS_fnc_dynamic test character cap?
7erra replied to Mr H.'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Can you post the text and how you call the function here? Maybe that will clear things up. Otherwise I said that I found a solution for the cap which is the 6th parameter: deltaY. This tells the function how far the text should be scrolled down. The length of the text isn't limited by either the max cap of characters a control can hold (I let my script run to 20k or sth before aborting bc of lag) and neither the size of the control which is 10000 (on line is roughly 0.06) therefore plenty enough. Here is the script I came up with: /* Author: Terra Description: Create a credit screen Params: 0: Credit text - STRING */ params ["_text"]; _lineHeight = 0.0607143; _screenLines = 24; _screenHeight = _screenLines *_lineHeight; _br = ["<br/>","<br />"]; _manipulate = _text; _manipulate = _manipulate splitString "<>"; _lineCount = {_x find "br/" != -1 OR _x find "br /" != -1} count _manipulate; _startPos = (0 * safezoneH + safezoneY)+_screenHeight; _duration = _lineCount/2; _deltaY = (-_lineCount*_lineHeight) -_screenHeight; [ _text, -1, _startPos, _duration, 1, _deltaY, 402 ] spawn BIS_fnc_dynamicText; This one is unoptimised in regards to other screen sizes. I only took my own screen into account (1920:1080) and I have no idea how it will behave with other resolutions or settings.- 10 replies
-
- dynamic test
- fnc
-
(and 1 more)
Tagged with:
-
onPlayerRespawn.sqf and InitPlayerLocal.sqf not firing
7erra replied to remasters's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The moveInCargo command needs both arguments (player and vehicle) to be local. I tried to use it a few weeks ago too but had no success. Also take a look at Note 1 from moveInCargo BIKI page. -
Hello everyone, I wanted to count the linebreaks "<br/>" inside of another string but couldn't find a way. Example: "My first line<br/>My second line<br/>Third line<br/>you guessed it, fifth line<br/>I lied that was the fourth." should return 4. With toString [10] it would be easier since you could use _lineCount = {_x == 10} count (toArray _string); but not with parts that are longer than one character.
-
That is the reason why I avoided using splitString but @das attorney's method is really simple and fast. Here are the test results: My own solution, worst of all: @Muzzleflash's solution: And the best of them all: @das attorney's script: _text = "Line<br/>"; for "_i" from 1 to 100 do { _text = _text +format ["Line %1<br/>",_i]; }; _tCount = count _text; _duration = _tCount/20; _lineHeight = 0.0607143; _br = ["<br/>","<br />"]; _manipulate = _text; _manipulate = _manipulate splitString "<>"; _lineCount = {_x find "br/" != -1 OR _x find "br /" != -1} count _manipulate; systemChat str _lineCount; _deltaY = _lineCount; [ _text, -1, 0 * safezoneH + safezoneY, _duration, 1, _deltaY, 789 ] spawn BIS_fnc_dynamicText; /* Result: 0.499251 ms Cycles: 2003/10000 */ The splitString won't be a problem since im only counting "br/" and "br /". Thanks everyone :)
-
Native Map Objects IDs changing with updates
7erra replied to Ulfgaar's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The better option is to work with nearestObjects, nearestTerrainObjects, nearestBuilding and so on. Using the ID is not viable due to the reasons @Muzzleflash mentioned. BIS tries to make the game as good as it can be by adding, removing and adjusting things, including terrain objects. This includes deletetion of flawed map objects. I remember that shortly after Tanoa was released on the stable branch there was a pier in the middle of nowhere beneath the map and could only be seen via the nearestTerrainObject command and a map marker. Stuff like that. -
BIS_fnc_dynamic test character cap?
7erra replied to Mr H.'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
So my test was finally succesful: The 6th parameter is really important when it comes to displaying more lines. If it is too low then the text just won't move any further. Here is my test code: _text = "Line<br />"; for "_i" from 0 to 1000 do { _text = _text +format ["Line %1<br />",_i]; }; [ _text, -1, 0 * safezoneH + safezoneY, 4, 1, -100, 789 ] execVM "test.sqf"; test.sqf is just a little modification of the BIS function to display some parameters with systemchat, therefore not important. When using -1 instead of -100 then the lines will go down to line 39 and then stop and fade out. Changing this param to -100 it displays all 1000 lines (really fast btw, bc of duration = 4). That's it. ~~~Own request~~~ I am now elaborating further on this to find the correct speed for the text to scroll through but I need to count the lines to find the correct deltaY param. The text should disappear from the screen completely. This is what I have in mind: _text = "Line<br/>"; for "_i" from 0 to 100 do { _text = _text +format ["Line %1<br/>",_i]; }; // _text will later on be the input text _tCount = count _text; _duration = _tCount/20; _lineHeight = 0.0607143; //count the lines and find _deltaY _deltaY = count /*lines, how?*/; [ _text, -1, 0 * safezoneH + safezoneY, _duration, 1, _deltaY, 789 ] spawn BIS_fnc_dynamicText;- 10 replies
-
- 2
-
- dynamic test
- fnc
-
(and 1 more)
Tagged with:
-
Problem with createVehicle
7erra replied to wuestenkamm II.'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
createMine is the correct command. A for-from-to loop would be easier too: _mines = 100; for "_i" from 1 to _mines do { createMine ["ATMines_Range_Mag",getPos truck]; sleep 2; }; -
Help working with ObjectsMapper Compositions
7erra replied to MitchJC's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The order of the created objects is also the same as it is in your input array. E.g. your first input will also be the first return element: _Obj = [ ["Land_Cargo_HQ_V3_F",[0,0,0],89.937,1,0,[0,0],"","",true,false], ["Land_HBarrier_Big_F",[8.04028,-1.2489,0],89.872,1,0,[0,0],"","",true,false] //... ]; _HQComp = [(_ObjPos), random 360, _Obj] call BIS_fnc_ObjectsMapper; _Land_Cargo_HQ_V3_F = _HQComp select 0; _Land_HBarrier_Big_F = _HQComp select 1; //... /* or better: */ _HQComp params ["_Land_Cargo_HQ_V3_F","_Land_HBarrier_Big_F",...]; If you want to access any specific building then it would be the best practice to place the input array at the beginning of your array. -
List of Event Handlers attached to an object
7erra replied to _SCAR's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If there are eventhandlers assigned to the object in the config you can return them via the getText. EventHandlers that are assigned during the mission can not be returned. Here is a function that returns whether there are any eventhandlers at all attached: /* Author: Terra Description: Returns true if there are any eventhandlers assigned to the object Parameter: 0: object to check (OBJECT) 1: Evenhandler type (STRING) Example: _isEHassigned = [player, "HandleDamage"] call _functionname; */ params ["_unit","_ehName"]; _isEH = if (toUpper _ehName find "MP" > -1) then { // MP evenhandler _testEhID = _unit addMPEventHandler [_ehName, {comment "TestEhMP"}]; _unit removeEventHandler [_ehName,_testEhID]; if (_testEhID > 1) then {true} else {false} } else { // Eventhandler _testEhID = _unit addEventHandler [_ehName,{comment "TestEh"}]; _unit removeEventHandler [_ehName,_testEhID]; if (_testEhID > 1) then {true} else {false} }; systemChat str _isEH; _isEH