Jump to content

neokika

Former Developer
  • Content Count

    1160
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by neokika

  1. Hi alarm9k. Ideally, you would detect when the vehicle locality is changed and act accordingly. You have Local event handler available that allows for this already. Then you could, for example, stop the script on current machine, in case "!local _vehicle" is not true anymore. And within the event handler, you start the new instance of the script to where the object changed locality to.
  2. neokika

    New update, new disaster!

    Not entirely true, we do not want to break existing content, so backwards compatibility is always in mind. (Official, community content). Ofc, it is not always possible to avoid it. We do plan for campaign improvements/fixes along the way. ;)
  3. neokika

    How far does "exitWith" actually exit?

    Hi there, Like others have said, it only exists the current scope, a few examples: In the following example, exitWith will exit the whole script! // Script scope if (true) exitWith {}; // Never happens In the following example, exitWith will exit only the while loop // Script scope while { true } do { // While loop scope if (true) exitWith {}; // Never happens }; // Will be executed In the following example, exitWith will exit only the foreach loop // Script scope while { true } do { { if (true) exitWith {}; // Never happens } forEach (_this nearEntities ["Man", 100]); // Will be executed }; // Will be executed
  4. Hello, What are you trying to achieve? There are two types of dialog, a normal display that when open you can interact with it, and RscTitles, which is a type of display that does not receive any input from the player, an example of the later would be the weapon status when player is controlling a unit that has a weapon. Hope this helps.
  5. Yes, in that exact case, it would be exactly the same, possibly a misunderstanding from the scripter. So where would the use of Spawn make sense? Within event based environment or when you want a script to start in parallel. When a script is started with execVM, execFSM or spawn, this script instance will run in parallel/independent from the previous, or caller instance. Note that code within these non event based script threads is conditioned by the Script Scheduler, which makes sure such scripts do not slow down the simulation. When executing code on a event based environment, the use of sleep is not allowed, and loops are limited to something like 10.000 iteration. This is because the Engine will execute this code within the same frame (What the above method avoids). In the script you posted, we can see that it already should be running on a non event based environment (or scheduled env) because it already makes use of sleep command. To give you a practical example, when you add an event handler to a unit, when that event is triggered, it is executed in a non scheduled environment, where you cannot use sleep (for example), so let's say you want to show a hint, 5 seconds after a unit dies: _unit addEventHandler ["Killed", { _this spawn { sleep 5; hint format ["%1 has died 5 seconds ago", name (_this select 0)]; }; }];
  6. You can lerp/interpolate vectors, for example: // Some parameters private ["_object", "_slowdownTime"]; _object = [_this, 0, objNull, [objNull]] call BIS_fnc_param; _slowdownTime = [_this, 1, 10, [0]] call BIS_fnc_param; // Store initial time private "_initialTime"; _initialTime = time; while { time - _initialTime <= _slowdownTime } do { // The current and target vectors private ["_vectorCurrent", "_vectorTarget"]; _vectorCurrent = velocity _object; _vectorTarget = [0,0,0]; private ["_x", "_y", "_z"]; _x = linearConversion [_initialTime, _initialTime + _slowdownTime, time, _vectorCurrent select 0, _vectorTarget select 0]; _y = linearConversion [_initialTime, _initialTime + _slowdownTime, time, _vectorCurrent select 1, _vectorTarget select 1]; _z = linearConversion [_initialTime, _initialTime + _slowdownTime, time, _vectorCurrent select 2, _vectorTarget select 2]; // Lerp _object setVelocity [_x, _y, _z]; // Delay sleep 0.01; }; Not tested. :P
  7. Sorry, did not notice you are parsing the String. Text is different data type then String, try the following: private ["_unitValue", "_textvehicle"]; _unitValue = [_this, 0, 0, [0]] call BIS_fnc_param; _textvehicle = [_this, 1, parsetext "", [parsetext ""]] call BIS_fnc_param;
  8. neokika

    Init.SQF Optimization

    Hi there, This might be, because the rendering is still being loaded. Try: // Add event handler that fires once all systems (rendering, simulation etc) have been loaded and player is in control of character ["BIS_introPreload", "onPreloadFinished", { // Remove event handler ["BIS_introPreload", "onPreloadFinished"] call BIS_fnc_removeStackedEventHandler; // Flag missionNamespace setVariable ["BIS_readyForIntro", true]; }] call BIS_fnc_addStackedEventHandler; waitUntil { !isNil { missionNamespace getVariable "BIS_readyForIntro" }; }; // YOUR CODE GOES HERE
  9. Why complicate it? :P private "_hour"; _hour = date select 3; private "_DayPhase"; _DayPhase = switch (true) do { case (_hour >= 4 && _hour < 8) : { "Dawn" }; case (_hour >= 8 && _hour < 19) : { "Day" }; case (_hour >= 19 && _hour < 22) : { "Dusk" }; case (_hour >= 22 && _hour < 4) : { "Night" }; }; hint _DayPhase;
  10. Hello, You seem to be processing the array wrongly: fn_addMoney.sqf private ["_unitValue", "_textvehicle"]; _unitValue = [_this, 0, 0, [0]] call BIS_fnc_param; _textvehicle = [_this, 1, "", [""]] call BIS_fnc_param;
  11. neokika

    WaitUntil {trueVar}

    Not entirely correct. Loops, are only limited to 10k iterations within a Non-Schedule Environment, for example, code running within a event handler. Also, see Threads for more information about the Scheduled / Non-Scheduled Environment. Also, waitUntil does not run every frame, because it is also caught within the Scheduled Environment. Going back to initial question, it should still work, should not be dependent on time after mission start. Although, what you are trying to achive, should be done though a public variable event handler. /** Server */ // Some variable TAG_myVariable = false; // The public variable event handler, that will execute, everytime defined variable is modified over the network "TAG_myVariable" addPublicVariableEventHandler { // Log the variable name and it's new value ["Variable (%1) has changed and is now (%2)", _this select 0, _this select 1] call BIS_fnc_logFormat; }; /** Client */ // Set a new value to the variable we added a event handler to TAG_myVariable = true; // Broadcast value over to the server, causing the event handler to execute and log the name and new value of the variable publicVariableServer "TAG_myVariable";
  12. Define your "G_fnc" function properly, within the Description.ext, CfgFunctions. I believe that the problem is, server is sending packet to JIP client before he defines "G_fnc". Example: // Description.ext class CfgFunctions { class BIS { class MyAmazingMission { class myAmazingFunction { file = "functions\fn_myAmazingFunction.sqf"; }; }; }; }; // Anywhere [] call BIS_myAmazingFunction; Defining functions within CfgFunctions will allow you, for example, to access those same functions on the init expression of objects (for example), something that doing in init.sqf won't work.
  13. You can link the FSMEditor to a text editor, such as Notepad++. Go to Edit > External Editor > Full Path and for example, I'm linking Notepad++ > C:\Program Files (x86)\Notepad++\notepad++.exe. Then, while editing in the FSMEditor you can click Edit (Bellow text window) and it will open current state/condition code in Notepad++.
  14. neokika

    Campaign Radio

    Hello, Look into sideChat, vehicleChat, directSay. Or, you can use the kb system, kbTell, kbAddTopic, which is a little more complex and is the one we use. Although, you can perfectly simulate this system in a more simpler way using the above commands combined with say3D.
  15. First you are trying to access local variable _rescuer out of it's scope: _rescuer = unitBob; _dropActionID = _unit addAction ["Drop","G_Drop.sqf",[],1.5,true,true,"", "(_this == _rescuer)"]; //_rescuer is not defined in the condition field, different scope So, using the variable unitBob would solve this issue: _dropActionID = _unit addAction ["Drop","G_Drop.sqf",[],1.5,true,true,"", "_this == unitBob"]; Or: _rescuer = unitBob; _dropActionID = _unit addAction ["Drop","G_Drop.sqf",[],1.5,true,true,"", format ["_this == %1", _rescuer]];
  16. I seem unable to reproduce this, could you, please, give me repro steps? Thanks for the feedback.
  17. Sorry about this. FPDR Fix will be available in the Development Branch at around 15pm (CET).
  18. Thank you for reporting, this should be fixed in the upcoming dev branch update.
  19. Arma 3 PhysX Playground Created by _neo_ Use your new super powers wisely. Installation: Decompress file and place it at your Documents\Arma 3 Alpha\missions folder and access it through the editor. Use action menu to change properties. Press F to spawn object and apply forces. Press E to Push nearby objects. Press Q to Pull nearby objects. Have fun! Download _neo_
  20. Yes, the chopper in the first mission, the one that lands and then takes you to Rogain, is scripted. See BIS_fnc_unitCapture/BIS_fnc_unitPlay functions under the functions viewer in the Editor.
  21. neokika

    Dedicating a GPU to PhysX

    PhysX particles are being looked at. But it is not something that can be done from night to day, needs Program, Art and Design time/effort. :)
  22. A team leader will issue "Area is clear" when it changes (automatically) it's behavior from Combat to non-Combat.
  23. neokika

    AI Discussion (dev branch)

    Sorry, but no, AI should not ignore such animals.
×