Jump to content

Heeeere's johnny!

Member
  • Content Count

    899
  • Joined

  • Last visited

  • Medals

Everything posted by Heeeere's johnny!

  1. Heeeere's johnny!

    Multiple conditions for variables in hint

    You can use %1, %2 ... anywhere inside a formatted string. The <t> only becomes relevant in the parseText command. The format command sees the string just as any other string. Correct. You don't need to give functions any special name, but I give them the prefix "_fnc_" for local functions and "fnc_" for global functions respectively. That's simply a naming convention to identify them quickly as functions.
  2. Heeeere's johnny!

    Multiple conditions for variables in hint

    Use structured text to colorize your code. The color can be determined using a simple switch statement. _health = 0.7; _ammo = 23; _ammoMax = 100; _fnc_getColor = { switch true do { case (_this < 0.25): { "#ff0000" //red }; case (_this < 0.5): { "#ff8800" //orange }; case (_this < 0.75): { "#ffff00" //yellow }; default { "#00ff00" //green }; }; }; hintSilent parseText format [" <t align='left'>Health:</t><t align='right' color='%2'>%1</t><br/> <t align='left'>Ammo:</t><t align='right' color='%4'>%3</t> ", _health, _health call _fnc_getColor, _ammo, (_ammo / _ammoMax) call _fnc_getColor];
  3. Well, if you're not familiar with SQF at all, you should probably start reading up on the syntax and basic structures (for, forEach, while, if-then-else etc.): https://community.bistudio.com/wiki/SQF https://community.bistudio.com/wiki/Control_Structures For now, this is your code without the "while" loop and without the thereby unnecessary "spawn" block around it: if (!isServer OR !isNil "CountDead_fnc") exitWith {}; CountDead_fnc = { _this addEventHandler ["killed", { _side = side (group (_this select 0)); switch _side do { case west: { DeadWestCount = DeadWestCount + 1 }; case east: { DeadEastCount = DeadEastCount + 1 }; case resistance: { DeadGuerCount = DeadGuerCount + 1 }; case civilian: { DeadCivCount = DeadCivCount + 1 }; }; }]; }; DeadWestCount = 0; DeadEastCount = 0; DeadGuerCount = 0; DeadCivCount = 0; sleep 1; { [_x, "CountDead_fnc", _x] call BIS_fnc_MP; } foreach allUnits; [ format ["West units killed %1 \n East units killed %2 \n Resistance units killed %3 \n Civilian units killed %4", DeadWestCount, DeadEastCount, DeadGuerCount, DeadCivCount ], "hintSilent" ] call BIS_fnc_MP;
  4. I understand that and please don't take it offensive. I'm just trying to help. Regarding your issue: As KK pointed out, the while loop was definitely a reason why your hint did not fade. Another reason might be the fact that your trigger can be activated repeatedly and maybe something is activating it repeatedly without your notice. I'd recommend that you remove the while loop (if not already done) and set the trigger activation to "once" to test whether it's gonna fade then so you can step-by-step opt out the possible reasons for your issue.
  5. Yeah, well, that code does only work in ArmA 3 because in older ArmA versions, many things (so doors) were called differently, there were no proper namining conventions in the configs and the code, plus ArmA 2 door names do not have underscores (which the fnc_findLast function searches in that particular case). Did I? ... (clicking link ... searching post) ... oh, I did! :D No problem. There is (almost) always a solution. The question is whether you're gonna take it or respond with "If that's the solution, I want my problem back." ;) Utes is still an ArmA map, so you can search the config just as you can do in ArmA 3. You may need to know that in Czech, "door" is "dveře" and "gate" is "vrata". Hence, "dvere" and "vrata" are the words used in the configs of Chernarus buildings. I don't know what buildings are on Utes, but all you need to do is a look into the configs of a building to find out what the doors are called there. The bigger problem is that things like "string select [0, 5]" or "string find string" did not exist in ArmA 2, if that's your environment. So adapting the code requires a little more than copy-paste.
  6. Wow, this must be is very new (according to BIKI) ... and very nice!
  7. Heeeere's johnny!

    Spawned enemy won't shoot me

    Who did not make that mistake already ... ;)
  8. Assuming you removed the while loop (which was the most obvious mistake), keep in mind that your trigger fires repeatedly, so everytime it gets activated, the hint is renewed again. And please format your code. People entering this thread and seeing just a large chunk of text are rarely motived to try to understand it or even take the time formatting it in their editor to be able to read it properly.
  9. Heeeere's johnny!

    Delete Buildings in arma 3 map editor

    I've also had a hard time hiding buildings which finally made me give up and do some dirty, load, but effective workaround: _house = cursorTarget; //or wherever you grab it from _houseType = typeOf _house; _housePos = getPosATL _house; _allSurroundingObjects = nearestObjects [_housePos, [], 50]; { _x allowDamage false; } count _allSurroundingObjects; _house setDamage 1; waitUntil {(_housePos nearestObject "Ruins") distance _housePos < 5}; deleteVehicle (_housePos nearestObject "Ruins"); { _x allowDamage true; } count _allSurroundingObjects;
  10. Well, I think I understand the situation why you'd like to have this option. I'm just not sure wether such an option really belongs into this script, because all doors on the map are closed by default and if they aren't, I'd be very certain it's because of an addon. The most efficient way I could come up with is this: fnc_findLast = { //Finds the last occurance of an element in a string or array. private ["_hayStackCount", "_hayStackTmpIndex", "_indexLast"]; params [["_hayStack", [], ["", []]], ["_needle", "", ["", []]]]; _hayStackCount = count _hayStack; _hayStackTmpIndex = _hayStack find _needle; _indexLast = -1; while {_hayStackTmpIndex > -1} do { _indexLast = _indexLast + 1 + _hayStackTmpIndex; _hayStackTmp = _hayStack select [_indexLast + 1, _hayStackCount]; _hayStackTmpIndex = _hayStackTmp find _needle; }; _indexLast }; _mapRadius = worldSize / 2; _mapCenter = [_mapRadius, _mapRadius]; _doorState = 0; { _configAnimationSources = configFile / "CfgVehicles" / (typeOf _x) / "animationSources"; for "_i" from 0 to (count _configAnimationSources) - 1 do { _sourceName = configName (_configAnimationSources select _i); if (-1 != _sourceName find "Door") then { switch true do { case (-1 != _sourceName find "A_") : { //slider door _x animate [(_sourceName select [0, [_sourceName, "_"] call fnc_findLast]) + "_move", _doorState]; }; case (-1 != _sourceName find "B_") : { //slider door _x animate [(_sourceName select [0, [_sourceName, "_"] call fnc_findLast]) + "_move", _doorState]; }; default { _x animate [(_sourceName select [0, [_sourceName, "_"] call fnc_findLast]) + "_rot", _doorState]; }; }; }; }; } forEach (_mapCenter nearObjects ["House", _mapRadius * 1.2]); Called on Altis, it only takes a few seconds on my machine. I hope that helps.
  11. Heeeere's johnny!

    Some help please

    Could you specify a bit what you mean by "firing by script"? There are AI units aiming and fireing at enemies, because their AI tells them to. And there are some scripting command which force the unit to shoot its weapon (fire, doFire, fireAtTarget), which scripters can use in their scripts to make units fire at things they usually wouldn't. Or do you mean something different?
  12. Automated Doors v2.4 Download v2.4 from Armaholic Changelog: Hey guyz, I could actually find some spare time for a small update due to the recent request by (see here). You can now set custom trigger area sizes for each building class. (The easiest way is doing this in the "automatedDoors_debug.sqf".) Wide fences and bar gates will now have a default trigger area of 6 meters (mostly affects Chernarus buildings). Of course, for every other building, the trigger area size will stay as it was before. I hope, you find this useful. Have a nice Play! Johnny
  13. First of all, the script in that directory is called "fn_DoorClose.sqf". Secondly, Automated Doors is not using that script. Instead, it opens and closes doors using the animate command. But even if the door names changed (which they didn't as far as my testing revealed), the only way you would recognize it would be that Automated Doors would not work, because executing the animate command with a wrong door name does not produce any errors. So I am assuming the error you describe comes from somewhere else, probably an addon. I suggest you disable all your addons and re-enable them step by step to pin down the one which produces the error. Be aware that if this is a message which pops up in the center of the screen, you may have to restart ArmA 3 everytime again, because such messages only occur once with the first incident of that kind.
  14. Heeeere's johnny!

    GUI Editor struggles

    I personally prefer to design my GUIs "hardcore", meaning 100% in Notepad++, because once you understand how the numbers work, it's very handy, because you can use #define to relate values to each other in order for all UI elements to align if you change just one value, plus you don't get values like 0.4956234, as you would with the GUI Editor, when you actually want the value to be 0.5. For instance, if you make the size of every UI element dependent on the [x,y,w,h] values of the whole display/dialog and you simply want to make it a bit smaller, then all you need to do is change the display's overall size and all your elements align automatically. That can save a lot of development time, especially in large and complex UIs.
  15. Heeeere's johnny!

    addAction issues...

    Just for the record: Please try to avoid global variables if you can. Your first post was unnecessarily flooded with global variables, you had no local variable at all (local variables start with underscore, like in didotto's post - global variables don't have such). It happens quicker than you'd believe that one of your global variables accidently overwrites variables used by addons or other scripts, same vice versa. So, try to avoid them and if you really need them, give them a proper unique name (a custom prefix for instance) so the chances of conflicts are extremely low.
  16. Hi Lauren, well, unfortunately there's no differentiation between doors and bar gates in terms of the distance at which they open. Of course, such differentiation would be senseful as your question suggests, but the fact that I'm answering your question a week later might show how much time I can spend at the moment on scripting. EDIT: I've created a quick fix which is a bit of an overhead for just one class, but it gives you the possibility to add custom trigger area sizes to each class name (in the debug version of the script at least). Land_BarGate_F thus have a radius of 6 meters to open and close. I'm confident, there can be a better solution, but it works and has no impact on the script's performance. I'll publish it tomorrow hopefully. Best wishes, Johnny
  17. Heeeere's johnny!

    Terrorist attacks in Paris

    If you want this thread to be non-political, you should probably change the title to "condolence for the victims of Paris terror attacks" or make it even more clear by giving it the suffix "no political discussion". Because things like this always evolve into political discussions, because there is always people having their own opinion on the incident and raging about who or what to blame for it. ...and let's not forget the trolls:
  18. Heeeere's johnny!

    Terrorist attacks in Paris

    Thanks for pointing that out, I seemingly responded too quickly. I updated my statement accordingly.
  19. Heeeere's johnny!

    Terrorist attacks in Paris

    You cannot understand, because of the world you live in, that the only reason this is "our Europe", is because we had the luck to be born here. And I am still not sure whether you are honestly believing what you write or whether you are just trolling. So, for the sake of being able to sleep tonight, I'd rather believe, you are trolling, because otherwise you would obviously be so blinded by your fear and hate, that you are not willing to think about a single bit of what I wrote up there. That is why I will end this conversation here.
  20. Heeeere's johnny!

    Terrorist attacks in Paris

    Nothing against you, oxmox, just about the message by Reuters: The problem I have with news like this the very problem you pointed out by marking that sentence: If sombody prepares for a terror attack or even a suicide mission, why would he bring his passport to the scene? And why would he even bring his own passport and not a faked one? And how does a piece of paper on the body of a suicide bomber survive the explosion which killed several people around him? The assassins at Charlie Hebdo also had passports on them which already made me raise the first two questions.
  21. Heeeere's johnny!

    Terrorist attacks in Paris

    There is just so much I would like to understand about what you wrote, vilas, because I simply cannot. This comparison lacks of sense, because it asserts that wolves are evil by definition. A wolve is not an evil creature, he kills other creatures to eat them, because that is what he has to do to survive. It is painful for his victim, but there is nothing evil in it, that's life. Humans do a similar thing with the creatures they kill to eat, only on a massive industrial scale. So, does that make everyone eating meat evil? Secondly, you are attempting to devide the world in "Good" and "Evil", but that is not going to work. There are people who do horrible things for whatever reason, just like those who attacked Charlie Hebdo or those who did the massacre yesterday, no doubt about that. But believing there was only "the evil doers over there" and "us innocent victims over here" is simply naive. You ignore that we as "the civilized western world", the "Good", did and are still doing a lot to enforce hatred upon us. France was the first nation to rattle their saber when it came to bombing Libya, causing thousands of innocent deaths and injured, let us not forget that. Since I am not polish, I am curious to know what polish people fear more: A new USSR, a new Nazi-Germany or the vast neo-fascist movement in Poland, represented by statements like this. I am glad you quoted this and did not say it yourself, because "we must use force and we cannot hesitate" sounds to me like from a time where the german people were afraid of a jewish minority which Hitler later counted as "paracites" to his country, which - as he thought - would over time suck out the country and thus be a real threat to the german people. You cannot honestly believe that it would be possible to extinguish an ideology. This statement is music in the ears of those who are justifying everything they do to take your freedom and would continue to do so until the final point where noone on this planet has any freedom or privacy anymore, all in the name of security. 1984 says hello. If someone bombs your house, killing your whole family, because he thought there were terrorists in that house - do you cry and ask why, or ... you get the point, right? What exactly are "non-native cultures"? How many generations of a person have to had lived in Europe to be called "native"? How much of a "foreign culture" must someone have in his genes to be called "foreigner"? 1/4, 1/8, 1/16, 1/32? I believe you see yourself that this is point-blank discrimination, if not rascism, right there. In the past, we Europeans performed colonization, slavery and exploitation in many parts of the world, primarely Africa. To put it simple: We are rich, because they are poor and now we wonder why these people are rushing to Europe. At this point, I recommend watching a movie called "The March" which depicted 25 years ago what is happening now: Before quoting such statements, please inform yourself about how many muslims live in Europe, how many live in your country and ask yourself how far they are a bigger threat to western people's lifes than the "War on Terror" you are so keen to enforce. To give you some numbers: Western coalition soldiers killed in Afghanistan - statista.com Now, I begin to believe you are either trolling very well or you are just so full of hate like the ones you blame in this whole hate sermon of yours. Do you know the meaning of the word "freedom"? It does not mean, "freedom for those who do not follow belief XYZ". Neither does it mean, being allowed to do what you want. I personally think that "freedom" means, not having to do what you do not want to do. That counts for you and me as people who do not want to pray to "Allah", but it also counts for the very people who do, as long as they do not violate the law. This has nothing to do with rascism, but with the very values politicians never get tired to point out we are defending around the word, namely that we as a society do not act arbitrarily, but instead follow rules we call "the law". That is why as long as somebody follows the law, you cannot simply arrest him just because he is doing or saying something you do not like. And to be honest, if you would say the things publicly which you are writing here and you ment them, there is a lot of people who would want to see you arrested for that. Fighting terror with terror is a never ending spiral of violence, because there are always innocent victims which will turn against you and in the end, there will be no "winner", only death on each side. You will always have enemies, like it or not, there is no perfect world. Probably there will be more terror in our part of the world in the near future, but you would have to be blind to believe we are the ultimate innocent in this. However, we can prevent some terror by NOT killing innocents by bombing other countries and by NOT selling weapons to war regions, like currently the Middle East, to mention just to things that could be done. Nevertheless, freedom needs courage, even in times of terror. If you give up freedom for security, you will lose both and die as an unfree hateful coward.
  22. Heeeere's johnny!

    Terrorist attacks in Paris

    I'm talking mass media here, not a website which obviously aims to prove a discriminatory point mixing up a religion with people's actions. Because OBVIOUSLY, if somebody kills in the name of a religion, not only the killer, but the religion as a whole is bad, regadless whether that makes sense or not. (That sentence was sarcasm, for those who didn't get it.) If some US-guy shooting people at a school would shout "Amen!" or "For you, Jesus!" on every shot, would you blame the massacre on Christianity? Please, don't follow the dull path of mixing some people's actions with other people's belief.
  23. Unfortunately, HitPart seems to be the only of the four EHs which works with granades (and hopefully IEDs). Even HandleDamage only returns an empty string when the damage is dealt by a granade. So, I'll have to work with HitPart somehow.
  24. Since the "Killed" EH does not provide the weapon/object which killed the unit, I was looking through the other possible EHs (Dammaged, HandleDamage, Hit, HitPart), only to find that each one of these is either fireing multiple times for each damaged/hit part or potentially NOT fireing at all. So, if I wanted to print a single line to the log, mentioning the killing weapon/object, which would be the most senseful (most efficient) way of doing that? Best wishes, Johnny
  25. Heeeere's johnny!

    Terrorist attacks in Paris

    I can barely agree more on something like this statement. When bombs explode in a central european country, the message speads around the world within minutes, it is in all news channels almost around the clock, in all newspapers, politicians around the world are expressing their condolence, empathy and support for the affected country. Yet, if such things happening just a few thousand kilometers south east of central europe, like a massacre with over 40 deads, such incidents are a 4 liner in the news media which gets not more than 2 minutes of attention. Why is that? Because we got so used to such terror in other parts of the world that as long as we are not affected, we care as much as we care about the countless people starving in Africa every day, which do not even get a mentioning in the news anymore, because this has become "normality". And on the other hand, people (at least in Germany) go bananas when rediculessly small things occur in our countries, like rising taxes, rising gas prices, children not being able to have their sport courses, because other people are sleeping in the gyms, because they fleed from terror, violence and death in their country. Maybe some day, I will understand it, but that day is far in the future, if at all. My condolence go to the victims and the bereaved people of those who got killed and injured that night.
×