Jump to content

Liberty Bull

Member
  • Content Count

    43
  • Joined

  • Last visited

  • Medals

Community Reputation

23 Excellent

About Liberty Bull

  • Rank
    Lance Corporal

Profile Information

  • Gender
    Male
  • Location
    Connecticut, USA

Contact Methods

  • Biography
    Can;t access my old profile, originally "tjzil".

Recent Profile Visitors

974 profile views
  1. https://steamcommunity.com/sharedfiles/filedetails/?id=2779018452 You take a sip of your steaming cup of black coffee as you read the note your girlfriend Anna left on the table. Its been almost a week since the invasion began and you still can't believe it. A lot of your neighbors are gone; either fled or went to join the fight. Your friend Dmitry thinks you should both re-enlist. People with prior combat experience are needed at a time like this, you think to yourself as you take another sip. That's when you notice a vehicle pulling up outside...
  2. This was also so long because I put in a disguise system that lets the player change sides and it wouldn't return my expected behavior without checking the sides. I was hoping sideEnemy or something would be able to take its place but couldnt figure it out ** Edit ** I fixed and updated the code in the post immediately above this one, and it works to convert my code from triggers to script, however upon reload i still get the blinking issue =/ *** Edit 2 *** As an experiment, I made sure to take all triggers/references to my detection script out, and execVMd the script after a save/reload and it is still blinking, even though it hadnt run the script even once yet. With this, I decided to make a new mission on stratis, copied over my script from the post just before this one, and on a reload it blinks, even without it having any other items able to effect it. Even the simple script you gave me "blinks" upon a reload. It's starting to look like this is an Arma bug with BIS_fnc_dynamicText. *** Edit 3 *** Well, today kids we learn about taking a step back and properly diagnosing. It turns out the "blinking" is caused by a mod I had running (A mod that is required by the conversion mod I am making this mission for). I had assumed that it was due to my lack of scripting knowledge i didnt even consider that a mod would cause this issue, but it seems to.
  3. I appreciate it! I actually did a dumb thing and for simplicity sake of my initial post kind of fibbed about the original function. For me I wanted there to also be a "caution" phase and arma's knowsabbout wasnt giving me the results, so I figured out a way to get it to work, rather than simple "knowsabout". Looking at your code, it definitely would have simplified things. Here is my attempt at converting my triggers to code: [] spawn { while {alive player} do { if (side player == resistance) then { var_dangerUnits = []; { if (side _x isEqualTo east || side _x isEqualTo west) then { if (_x knowsAbout player >= 1.50) then { if (((_x getHideFrom player) distanceSqr player) < 200) then { var_dangerUnits pushback _x; }; }; }; } forEach allUnits; var_cautiousUnits = []; { if (side _x isEqualTo east || side _x isEqualTo west) then { if (_x knowsAbout player >= 0.70) then { if (((_x getHideFrom player) distanceSqr player) < 2500) then { var_cautiousUnits pushback _x; }; }; }; } forEach allUnits; }; if (side player == east) then { var_dangerUnits = []; { if (side _x isEqualTo resistance || side _x isEqualTo west) then { if (_x knowsAbout player >= 1.50) then { if (((_x getHideFrom player) distanceSqr player) < 200) then { var_dangerUnits pushback _x; }; }; }; } forEach allUnits; var_cautiousUnits = []; { if (side _x isEqualTo resistance || side _x isEqualTo west) then { if (_x knowsAbout player >= 0.70) then { if (((_x getHideFrom player) distanceSqr player) < 2500) then { var_cautiousUnits pushback _x; }; }; }; } forEach allUnits; }; if (side player == west) then { var_dangerUnits = []; { if (side _x isEqualTo east || side _x isEqualTo resistance) then { if (_x knowsAbout player >= 1.50) then { if (((_x getHideFrom player) distanceSqr player) < 200) then { var_dangerUnits pushback _x; }; }; }; } forEach allUnits; var_cautiousUnits = []; { if (side _x isEqualTo east || side _x isEqualTo resistance) then { if (_x knowsAbout player >= 0.70) then { if (((_x getHideFrom player) distanceSqr player) < 2500) then { var_cautiousUnits pushback _x; }; }; }; } forEach allUnits; }; if (stance player == "CROUCH" || stance player == "PRONE") then { if (count var_cautiousUnits == 0 && count var_dangerUnits == 0) then { txtDetectionALayer = "txtDetectionA" call BIS_fnc_rscLayer; _textdetecta = parseText format ["<t align = 'center' valign = 'top' size='0.6' color='#ffb742' shadow='2'>[HIDDEN]</t>"]; [_textdetecta, 0.0,-0.25,/*durata*/ 300,/* fade in?*/ 0,0,txtDetectionALayer] spawn BIS_fnc_dynamicText; }; if (count var_cautiousUnits > 0 && count var_dangerUnits == 0) then { txtDetectionALayer = "txtDetectionA" call BIS_fnc_rscLayer; _textdetecta = parseText format ["<t align = 'center' valign = 'top' size='0.6' color='#ff432D' shadow='2'>[CAUTION]</t>"]; [_textdetecta, 0.0,-0.25,/*durata*/ 300,/* fade in?*/ 0,0,txtDetectionALayer] spawn BIS_fnc_dynamicText; }; if (count var_dangerUnits > 0) then { txtDetectionALayer = "txtDetectionA" call BIS_fnc_rscLayer; _textdetecta = parseText format ["<t align = 'center' valign = 'top' size='0.6' color='#ff432D' shadow='2'>[DANGER]</t>"]; [_textdetecta, 0.0,-0.25,/*durata*/ 300,/* fade in?*/ 0,0,txtDetectionALayer] spawn BIS_fnc_dynamicText; }; } else { txtDetectionALayer = "txtDetectionA" call BIS_fnc_rscLayer; _textdetecta = parseText format ["<t align = 'center' valign = 'top' size='0.6' color='#ffb742' shadow='2'>[DEBUG]</t>"]; [_textdetecta, 0.0,-0.25,/*durata*/ 300,/* fade in?*/ 0,0,txtDetectionALayer] spawn BIS_fnc_dynamicText; }; sleep .5; }; };
  4. That's what I figured. For most of the functions, they have the %1 and I would tell the function what to type so I only had different functions to have the text be formatted differently.
  5. Okay, I'll have to figure out something because I have a few functions that call BIS_fnc_dynamicText, this stealth indicator, a nametag function that displays the cursortarget's name while within 4 meters to them, and custom task notifications that say various things such as quests being added, completed, updated, etc.
  6. You are probably right, and honestly over the month it took to develop this mission I have learned things to the point where the earlier functions I made are alot sloppier than later efforts. This detection script is an example of one of the first things I did, and later functions didn't use triggers, so you are probably right. I am going to convert it over to script like you said and see how it goes.
  7. My original problem is that my stealth indicator blinks on reloading a save. I placed the code into my initplayerlocal.sqf. Here is a video of the issue. Note that prior to adding the code you gave, it was my [HIDDEN] stealth indicator that would be "blinking". I'm either doing something wrong or theres an arma bug, probnably the former as I am inexperienced with scripting. sleep 5; moduleName_keyDownEHId = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 20 && var_vatsstop) then {var_vatson = [] execVM 'vats.sqf'};"]; moduleName_keyDownEHId = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 20 && !var_vatsstop) then {var_vatsoff = [] execVM 'vatsstop.sqf'};"]; while {alive player} do { private _text = parseText format ["<t align = 'center' valign = 'top' size='0.6' color='#ffb742' shadow='2'>%1</t>", stance player]; [_text, 0,0,5,0,0, "layer" call BIS_fnc_rscLayer] spawn BIS_fnc_dynamicText; sleep .5; }; [] spawn { _adjustLight = { CHBN_adjustBrightness = CHBN_adjustBrightness max 0 min 1; _brightness = if (CHBN_adjustBrightness > 0) then {200 * abs (1 - (2 ^ CHBN_adjustBrightness))} else {0}; CHBN_light setLightAttenuation [10e10,(30000 / (_brightness max 10e-10)),4.31918e-005,4.31918e-005]; CHBN_light setLightAmbient CHBN_adjustColor; }; waitUntil {time > 0}; if (missionNamespace getVariable ["CHBN_running",false]) exitWith {systemChat ""}; CHBN_running = true; CHBN_adjustBrightness = missionNamespace getVariable ["CHBN_adjustBrightness",1]; // edit the level of brightness here, set to 1, can be 0.1 to however high you want it CHBN_adjustColor = missionNamespace getVariable ["CHBN_adjustColor",[0.5,0.7,1]]; if (!isNil "CHBN_light") then {deleteVehicle CHBN_light}; CHBN_light = "#lightpoint" createVehicleLocal [0,0,0]; CHBN_light setLightBrightness 1; CHBN_light setLightDayLight false; call _adjustLight; for "_i" from 0 to 1 step 0 do { _adjustBrightness = CHBN_adjustBrightness; _adjustColor = CHBN_adjustColor; waitUntil {!(_adjustBrightness isEqualTo CHBN_adjustBrightness) || !(_adjustColor isEqualTo CHBN_adjustColor)}; call _adjustLight; }; };
  8. Strange, putting your code in fixed my stealth indicator by somehow absorbing the bug, so the new text from your code indicating players stance begins blinking while my stealth indicator is okay.
  9. So as a weird developement, when the player dies the indicator starts working normally in his death scene. When an AI saw me, the "DANGER" indicator flickered and disappeared like the usual bug im trying to squash, but as soon as the AI killed me, the danger indicator re-appeared and stayed on screen.
  10. *** Edit*** Solved, this was a bug resulting from a mod. 🙄 In my mission I have a detection script that shows whether you are hidden or in danger whenever the player is crouched/proned. Works flawlessly except when saving and reloading. After reloading, when you crouch the indicator pops up for half of a second and then disappears, along with a little vignette that also pops and disappears on the edges of the screen kind of like the effect when the player is tired. Every time I try crouching again, the indicator pops and disappears. So I know the trigger is still firing, and the effect is still displaying the hidden text, but then breaks? I have a trigger set to repeat with condition to detect if player is not standing as well as if no enemys knowsabout the player. In activation I have it run my script "textdetectionhidden.sqf" with the following code: txtDetectionALayer = "txtDetectionA" call BIS_fnc_rscLayer; _texta = parseText format ["<t align = 'center' valign = 'top' size='0.6' color='#ffb742' shadow='2'>[HIDDEN]</t>", textDetectionA]; [_texta, 0.0,-0.25,/*durata*/ 300,/* fade in?*/ 0,0,txtDetectionALayer] spawn BIS_fnc_dynamicText; Now when the player is spotted, I have another trigger, similar condition but with an enemy knowsabout player >= 1,, with activation running the script "textdetectiondanger.sqf" txtDetectionALayer = "txtDetectionA" call BIS_fnc_rscLayer; _texta = parseText format ["<t align = 'center' valign = 'top' size='0.6' color='#ff432D' shadow='2'>[DANGER]</t>"]; [_texta, 0.0,-0.25,/*durata*/ .5,/* fade in?*/ .5,0,txtDetectionALayer] spawn BIS_fnc_dynamicText; I have looked in to save game not storing the state of trigger, but this is not a loop, but a trigger that activates on certain conditions, and as we see, it does still fire after a save game but is broken. I also have another gui function that displays the name of the player's cursortarget, similarly using a trigger and calling scripts but that doesn't break. I thought maybe this is because for that nametag script I wrote a function, but last night I tried turning my detection scripts into functions but it still seemed to break while the nametag did not.
  11. I've gotta go back through the mission I'm working on to find the script I was having trouble with, I found a workaround in that case, although I suspect I never had the problem with !alive but probably with a variable being false while another being true.
  12. So !alive and variable actually does work in triggers, I was trying to do this before in a script as a condition and it wasnt working there, so I falsely assumed it would be the same here. Hours of editing can make you loopy. Still not quite sur why I couldnt get it to work in a script.
  13. Liberty Bull

    JBOY Napalm FX

    This is awesome!
  14. Solved: I'm dumb and !alive && variable works in triggers with no issue. As title, in a trigger I cant seem to check if a unit is dead as well as a variable being true? In a trigger condition, var_beginprisonbattle && var_lawchoosencr works to require both variables being true before firing, and I could probably just make a variable turn true when the unit in question is !alive, but as a cleaner solution I'd love to be able to check for both !alive && variable. I've tried !alive && variable. (!alive unit) && variable; (!alive unit) && (variable); ((!alive unit) && (variable)); (!(alive unit) && (variable)); and nothing seems to get the results.
  15. Liberty Bull

    Key activated bullettime script

    Thanks for all your help. I try and learn as much as I can on my own before asking, but sometimes I get so stuck trying to make a function work that the whole mission gets put on hold while I try and get it to work.
×