Jump to content

dreadedentity

Member
  • Content Count

    1224
  • Joined

  • Last visited

  • Medals

Everything posted by dreadedentity

  1. I'm certain that colors in description.ext (specifically for dialogs) use RGBA format
  2. Sure, people could use a tool that someone else wrote for them (I realize you made this tool), but what's the point if you don't understand the underlying concept? With the information I just posted, people will be able to write their own tool, rather than just use someone else's
  3. Great work! Just a warning, this post is not meant to overshadow your work, I just want to explain a little about Arma's color system. So as we know, Arma uses the RGBA color system that stands for RedGreenBlueAlpha. In RGB and RGBA, 8 bits are used for colors, meaning a total of 256 shades (0 - 255). That decimal number is then converted to hexadecimal (like what you see when you want to color words in your forum posts, for example) You can very clearly see this if you color some words in the forum: #FF0000 #00FF00 #0000FF However, in the arma engine, you define colors using an RGBA array such as {0,0,0,0}, where 0 represents no color, and 1 represents maximum color. For example, the same colors as above would be represented as: {1,0,0,1} {0,1,0,1} {0,0,1,1} What does this mean? Well that means it's actually extremely simple to go to any RGB color picker website, such as this (just some random website) and convert the colors to use in Arma. Let's take Brown for example (#663300) (I didn't use the forum color picker btw, I manually wrote the forum code so I'm not sure if it'll show up properly). Now you have 3 elements here, the red element, the green element, and the blue element (RGB) all in hex so you need to convert that to decimal. Hexadecimal is the same as binary, except, instead of counting 1 then resetting that bit and incrementing another one, hexadecimal can count all the way from 0 to 15. Now, obviously 15 uses two digits, so it's actually more accurate to say that hexadecimal can count from 0 to 9 and A to F (A-F representing 10,11,12,13,14,15). Anyway, back to our conversions: HEX = DECIMAL 66 = 102 33 = 51 00 = 0 Alpha would obviously be at the maximum in this case (which is 255) So now we have an array that looks like this {102, 51, 0, 255} but wait, this isn't very useful because it can't be read by Arma! Don't worry, this is the easiest step in the entire ordeal, all you have to do is divide each number by the maximum value (again, which is 255, FF = 255) So now you have {0.4, 0.2, 0, 1}, which is brown! So one last time, not trying to steal your thread, I just wanted everyone to understand how colors work within the engine. I'm not sure you can find any of this information on the wiki other than "Arma uses RGBA" Enjoy! EDIT: How to convert hexadecimal to decimal without using an online converter: Take the first digit and convert it to decimal, then multiply by 16, then take the second digit and convert it to decimal, then add them together. This is an extremely simplified explanation and only covers hex that is 2 digits (FF, for example), but that's all you'll ever need for Arma.
  4. dreadedentity

    Anyone managed to get snow working?

    Cool script KK Anyway it was fun to write a small check that will see if the player is inside a building (though it's a bit wonky because the bounding boxes are huge, larger than the actual building): []spawn { while {true} do { _building = nearestBuilding player; _buildBox = boundingBoxReal _building; _position = _building worldToModel getPosATL player; if (_position select 0 > ((_buildBox select 0) select 0) && {_position select 0 < ((_buildBox select 1) select 0)} && {_position select 1 > ((_buildBox select 0) select 1)} && {_position select 1 < ((_buildBox select 1) select 1)} && {_position select 2 > ((_buildBox select 0) select 2)} && {_position select 2 < ((_buildBox select 1) select 2)}) then { hintSilent "Player is inside building"; }else { hintSilent "Player is not inside building"; }; }; };
  5. I see that you got it to work, but just so it's actually written down somewhere so that people in the future who stumble on this thread will see it, script handles are required in the initialization lines in the editor. Otherwise you get that error. Also, if you don't really care to save the script handle you can just use '0 = [] execVM "myscript.sqf"' the game will let you do this, but since numbers can't be variables, it is not overwritten and the script handle is not saved at all.
  6. Your "CODE_lvl5" should be quadruple double quotes. This is because to have/use double quotes inside a string, you need to use 2 double quotes. Alternatively, you can use single quotes because they are still recognized as string definitions, but does not have the same restriction as double quotes regarding nested strings. For example: hint "Hello world"; //puts a box on screen with Hello World hint """Hello world"""; //puts a box on screen with "Hello world" hint "'Hello world'"; //puts a box on screen with 'Hello world' Alternatively, it could even look like this: CODE_lvl1 "CODE_lvl2 ""CODE_lvl3 """"CODE_lvl4 """"""""CODE_lvl5"""""""""""""""
  7. dreadedentity

    Few more questions

    #1 what is the error you get? #2 In this case, it might be beneficial for you to learn about publicVariable's. In the condition field of addAction, you can then check if a certain variable has a certain value. Example: _obj addAction ["Arm Bomb", { GLOBAL_bomb = "DEFUSE"; publicVariable "GLOBAL_bomb"; }, [], 6, true, true, "", "GLOBAL_bomb == 'ARM'"]; _obj addAction ["Defuse Bomb", { GLOBAL_bomb = "ARM"; publicVariable "GLOBAL_bomb"; }, [], 6, true, true, "", "GLOBAL_bomb == 'DEFUSE'"]; Make sure you put GLOBAL_bomb = "ARM" in init.sqf #3 You can try doing something with triggers and keeping it attached to the truck: if (isServer) then { this spawn { while {true} do { _this setPosATL (getPosATL myTruck); }; }; };
  8. dreadedentity

    Single player mission generator??

    DUWS was pretty fun to play, before I started scripting and actually played.
  9. dreadedentity

    PVP alive unit counter/ indicator

    F2k noticed that my brackets were messed up. I forgot to close the count loop. I edited that post and it should work now
  10. dreadedentity

    infinite enemy respawn...?

    A while ago I made a Simple Patrol Script that does what I think you want
  11. dreadedentity

    player list in a dialog

    You might be interested in playableUnits if you only want players to show up in your menu. Also, disabledAI for description.ext
  12. Is this a host 'n play server or dedicated server?
  13. dreadedentity

    PVP alive unit counter/ indicator

    [] spawn { _objects = playableunits; while {true} do { hintSilent format ["West: %1\nEast: %2",{(alive _x) && {_x in list trig_counter} && {side _x == west}} count _objects,{(alive _x) && {_x in list trig_counter} && {side _x == east}} count _objects]; }; };
  14. Waltenberg, I just thought of a cool idea you could add to the next version. I think it would be pretty cool to add some kind of "safezone/sandbox" feature, that would be enabled by default. It would read the input code, and prevent infinite loops from being run. Of course, you would have to add some way to disable the sandbox "for advanced users" :p
  15. dreadedentity

    [Guide] Coding Basics

    Great! I love seeing more resources become available to beginners (check my sig for proof). I've actually been thinking of starting a scripting tutorial series on youtube, even. Is it okay if I add a link to this page in my sig?
  16. dreadedentity

    PVP alive unit counter/ indicator

    [] spawn { _objects = allMissionObjects "Man"; while {true} do { hintSilent str ({alive _x} count _objects); }; };
  17. Sometimes it's hard to get the debug console to show up in multiplayer, also if I'm not mistaken, this version also has an option to execute code globally.
  18. Nobody does. And half of them don't. Oops shots fired, better go hide :868:
  19. Making a GUI itself is pretty complicated, actually, at least before you have some experience. I recommend to start.Luckily, our very own Iceman77, whose pdf tutorial is referenced in the video, is very active on the forum, so I'm sure he'll see this thread and be able to answer any questions. I've even made a dialog or two in my day :p
  20. I think using displayAddEventHandler "KeyDown" would be the most efficient way, it only fires when the user presses a key. Still, onEachFrame could be a viable alternative. The problem with using that, though, is even though you'll be running that code every frame, which automatically locks up a certain % of system resources. For example: Let's say that your onEachFrame code uses 5% of system resources. That's 5% less power every machine has that runs your code every frame. Now let's say your display EH uses 6-7% system resources because of the extra code you have to add but for about half of the mission, the user will not be pressing any keys, making overall system load ~3% That's just how I see things...Anyway you guys will probably be happy to know that I found out which actions go with GPS's, "minimap" and "minimapToggle" Hope that helps
  21. I wouldn't even know where to look in the wiki. Basically, I'm looking for a command that simulates a player double-tapping alt and being able to look around freely using the mouse. Thanks in advance.
  22. There may be some locality issues in your mission for MP. But I don't know, you might just have to wait for Shay to see this and help you out.
  23. I was making a cruise control script and I wanted to disable players from controlling their vehicle with the mouse. I've resolved the issue that caused me to look for a way to toggle freelook, but it would be nice to know if it's possible some way.
×