Jump to content

DarkViper98

Member
  • Content Count

    8
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About DarkViper98

  • Rank
    Private

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Alright, big thanks for help!
  2. thank you! Worked xD. So the problem was, because the function was called before it was even ready to be executed???
  3. Hello, everyone! Got some problems with creating a function. So, the idea is to add little dialogue for the units i need when player comes close to them. So, i am defining a function in my init.sqf: function_talking = compile preprocessFile "Talking.sqf"; This code inside Talking.sqf: private ["_unit"]; _unit = _this select 0; waitUntil {sleep 0.5; player distance _unit < 5}; ["SOLDIER", "Want my nuts?"] spawn BIS_fnc_showSubtitle; sleep 2; ["PLAYER", "No thanks!"] spawn BIS_fnc_showSubtitle; And this what i put in soldier's initialization field: [this] call function_talking; And nothing works xD what i did wrong? Having no errors it .rpt Thank you for helping!
  4. DarkViper98

    help with eventHandler please!

    But is there a way to count how many times did EH executed? Like f.e. to count how many shots did the player, like is it's more that 3, to execute the code... Thank you!
  5. DarkViper98

    help with eventHandler please!

    okayyy, also, never seen this: if (count _unitsSuppress isEqualTo 1) then { if (random 100 >= 75) then { (_unitsSuppress#0) spawn TAG_fnc_suppressSound; }; }; _unitsSuppress#0 is this #0 instead of this select 0 or what? Like we are selecting soldier 1 from group array ? Thank you!
  6. DarkViper98

    help with eventHandler please!

    Thank you very much for help, I am a beginner, that's the code i was able to write myself using a little amount of knowledge of sqf))) Some explanations: _soldiersWESTarray = allUnits select {side _x == WEST}; {_soldierWEST = _x;} forEach _soldiersWESTarray; i write it to make the game understand to call the event handler if enemies from side WEST shooting, cus it can be called if _soldiers guys are shooting also. But you find more logical decision like : if (side _soldier isEqualTo side _firer) exitWith {false}; That's very cool )) Thank you!!! Also about cheking the _firer weapon, i just forgot to remove that, cus after i read the EH again i got that. Want to ask some questions about this: _lockoutTime = group _soldier getVariable ["TAG_fnc_suppressLockout",-10]; if (time < _lockoutTime) exitWith {false}; group _soldier setVariable ["TAG_fnc_suppressLockout",time + random [6,8,13]]; So this code gets variables TAG_fnc_suppressLockout from soldiers group but what is -10 here? Is it like seconds? Next line is: if time is less than _lockoutTime then stop the code. - OK last: setting the variable with time (is this like a timer that counts? like it's said on wiki: Returns time elapsed since mission started (in seconds).). So we pick here a random time cooldown? Please explain how's that work, can't catch that a bit ((( Thank you!
  7. Hello, could someone help me to get the idea how to do this: so, the problem is when I add event handler to a unit, f.e. FiredNear, it gets executed everytime someone is shot near and as it's said in Arma 3: Event Handlers page, also when unit fired itself. So how can i compensate that, to make a delay with some seconds to prevent unit spamming the code, which is inside the event handler? Or how can i use the time in event handler, because it's not working there, only if i use [] spawn function inside, but even using this method i can't get what i am needed. So this is the code: The sence is when someone is fired near it plays sound, but the problem is that when Ais are shooting a lot this is spammed incredible amount of times, how can i make a delay here, or a cooldown to prevent that... Or like this can be executed once for 15 seconds and so on... Thank you so much for help
×