Jump to content

dreadedentity

Member
  • Content Count

    1224
  • Joined

  • Last visited

  • Medals

Everything posted by dreadedentity

  1. I believe what you're looking for is a Controls Group. I think that's how SaMatra made his shop dialog. I wish I could offer more help with this because I love doing dialogs these days, but I'm working on a few other things at the moment and I haven't been able to play around with the controls group yet
  2. Unfortunately, functions are compiled and ran after the mission starts. I believe it happens after the briefing but before the screen fades in from black
  3. dreadedentity

    ListBox Auto-Width

    I didn't have any problems with EtelkaMonospace, refer to this video (it is kinda old though) You can see that 'i's and 'w's seem to line up just fine
  4. dreadedentity

    init.sqf executed for jip

    init.sqf is always run by every player when they join, and on the server once when the mission starts
  5. saveStatus and loadStatus may be what you're looking for
  6. This example is for classes that are within description.ext, but you only have to modify 1 line to make it work with any config _wheelVariables = []; _config = missionConfigFile >> "mycar" >> "Wheels"; _wheels = _config call BIS_fnc_getCfgSubClasses; { _wheelVariables pushBack (getNumber (_x >> "myVariable")); }forEach _wheels;
  7. EDIT: DISREGARD THIS POST. I DID NOT DIG DEEP ENOUGH BEFORE POSTING. THE SOLUTION IS TO USE THE configProperties COMMAND INTRODUCED IN VERSION 1.36. My apologies for resurrecting this old thread. I am currently running into the same problem as IP. I need a way to get an array all of the attributes (not classes) within a class. I could work around this by replacing each attribute with a class with a single attribute inside and use existing commands, but that solution is mega-extreme-nastiness and I know I would instantly regret forcing my fingers to type such a coding abomination. I know about BIS_fnc_getCfgDataPool[/url; however, since this command loads and returns the actual data of all the attributes rather than an array of names that I can manually use in code, this is not an ideal solution (I expect each attribute to be at least 200 characters long, and it is necessary that an unlimited amount of attributes can be added to the parent class for this project) I'm very interested in the solution you were working at before changing directions, Pete.
  8. dreadedentity

    _x is undefined in a forEach loop?

    These functions work fine for me... [west, position player, 0] call AUSMD_spawn_group; [east, position player, 0] call AUSMD_spawn_group; //both working As MDCC said, the problem is with the _units array. Somewhere in your code you've probably put a string for the "side" parameter. Or you've misspelled something causing the interpreter to look for an undefined variable. Check your code for "weast" ;) I know I've typed that plenty of times by accident.
  9. Even I'm not sure how that's supposed to work, that snippet was taken directly from the original posted script. Although please be aware that the mission should have a headless client somewhere and (apparently) you're supposed to put "HC" in the description field (I have no idea how that's useful at all).
  10. Hello, That script is mega-nasty. I want to pour gasoline on my computer and watch it go up in flames after reading that. The allUnits command returned array can get huge if you have a mission with many, many ai. Trying to loop this onEachFrame is not an ideal solution by a longshot. A better name for this script would be "fps_massacre.sqf". I would just like to change 1 line from his original description: "This script will move ANY ai (ie: zeus-spawned, etc) to the headless client, while raping your frames-per-second" There are a few simple solutions, however. I don't know how you are spawning units, whether they be from a Zeus player or through scripts, but it's not an issue because there is a solution for both. For our Zeus units, we will be using 2 Curator-only event handlers, CuratorGroupPlaced and CuratorObjectPlaced. Copy this into the INIT box for the curator, or you can put this into a script and run it if you know how. this addEventHandler ["CuratorGroupPlaced", { _HC = owner "HC"; _check = (_this select 1) setGroupOwner _HC; if (_check) then { systemChat "Group was successfully transferred to Headless Client."; } else { systemChat "Group was not transferred to Headless Client."; }; }]; this addEventHandler ["CuratorObjectPlaced", { _HC = owner "HC"; _check = (group (_this select 1)) setGroupOwner _HC; if (_check) then { systemChat "Object was successfully transferred to Headless Client."; } else { systemChat "Object was not transferred to Headless Client."; }; }]; Now for units that are spawned through script, make sure you add this code to initServer.sqf: transfer_group_to_headless = { _HC = owner "HC"; _check = _this setGroupOwner _HC; if (_check) then { systemChat "Group was successfully transferred to Headless Client."; } else { systemChat "Group was not transferred to Headless Client."; }; }; And every time your script spawns units make sure you run this code right after the units are spawned: _myGroup call transfer_group_to_headless; So basically that should all work or something, I have no idea.
  11. setName does not create a variable, it only sets a "name" variable for the object (I'm unaware of the exact internal details of how this is done). If I am correct in assuming this is an editor-based mission, then you'll need to put something in the "NAME" field for the unit. When done from the editor itself this will create a variable with the same name as what you entered, as well as setting the objects name (I assume by using the setName command)
  12. dreadedentity

    Scripting Etiquette?

    1. Programmers choice - Doing this seperates the code into obvious blocks that can be debugged faster and easier. Aids in code readability for programmers who have never seen the code before. 2. Programmers choice - Doing this can make it more obvious that everything in that code block is a variable declaration, and everything below is the "meat" of the code. 3. Programmers choice - I don't know of anyone that does this. I do know, however, that when you post your code here in the forum using the php tag, spaces are (incredibly annoyingly) added to the end of every line. There is no benefit to this, it literally only increases filesize and preprocessing time. 4. Programmers choice - I don't know of anyone that does this either. However, I have occasionally left a few newlines at the end of some of my old scripts if I planned to keep adding to them but never got around to it. 5. Programmers choice - Having a folder named "functions" that you drop all your scripts into keeps your project organized. 6. Programmers choice - I personally perfer to camel case everything, including scripting commands. If you've ever downloaded one of my scripts, you'll notice that. Not using camel case has no effect whatsoever on the speed or functionality of a script. This will not make you a better programmer, it will make you a worse programmer. Please write this on a sticky note and attach it to your computer monitor. All of those things are for ease of the programmer to put his project down, wait a month, come back and still be able to add on to it without breaking it instantly. Whitespace (spaces, tabs, newlines) are purely for humans, when a file is preprocessed all whitespace is removed. It doesn't matter if you use 1 space to seperate 2 commands or 100 newlines, the computer will remove all of them during preprocessing (although you may suffer from a slight delay from the computer having to read a ton of extra characters and then remove them). I hope that clears some things up, if you think of any of the other things you wanted to ask, feel free to shoot; that's why we're here.
  13. Dead enemies cannot do "actions", like getout. You have to actually move the object position like Joe98 suggested. Check this post I made a while ago for a video and some working code. Many improvements can be made, but I feel like this is a step in the right direction
  14. dreadedentity

    Arma 3 Actions

    restart the server
  15. dreadedentity

    Coding anti-Cheat

    I'm not very familiar with script injectors (nor would I feel comfortable downloading one, if I even knew where to), but you can "watch" a variable with code similar to this: "myGlobalVariable" spawn { while {true} do { _temp = missionNamespace getVariable _this; waitUntil {(missionNamespace getVariable _this) != _temp}; //check if change was legitimate //if change was not legitimate either warn player and incriment warning count or end mission for player }; }; Of course, this only works for global variables and specifically for the reason why global variables are recommended to be used sparingly (global vars are available in all scopes)
  16. I really wanted to help, that's why I'm in this thread in the first place. The idea is very cool, and I'd like to see at least a semi-functioning prototype (even if I have to write most of the code myself). But MFW I clicked on that pastebin link ---> @__@ "this is impossible to debug"
  17. I think this is extremely confusing. Consider using the Functions Library to clear up space in your script by putting each function in it's own file. Tbh, right now, this script is little more than a clusterfuck
  18. You guys still love your complicated scripts/functions. DE_calcElapsedTime = { _startDate = _this; _elapsedTime = []; { _elapsedTime pushBack (_x - (_startDate select _forEachIndex)); }forEach (date); _elapsedTime; }; That's all you need right there. It's small, it's light, it's cpu-friendly. Example usage: startTime = date; player addAction ["Calculated Elapsed Time", { hint str (startTime call DE_calcElapsedTime); }, [], 6];
  19. dreadedentity

    Trying to create array

    Remember to close every statement with a semicolon ( ; ). Otherwise, this is the correct way to create a variable in .sqf. The problem with this code, however, is that if you intended to store the names tom, dick, and harry, they will not be stored because you actually referring to variables named tom, dick, and harry. If you were trying to actually store the words themselves, you'd need to enclose each word with double quotation marks. These are known as strings sq1 = [tom, dick, harry]; //variables sq1 = ["tom", "dick", "harry"]; //strings
  20. dreadedentity

    Trying to create array

    When you create a variable with an underscore as the first character, it is a local variable. Creating a variable without an underscore makes it a global variable that is accessible to all scripts/everything in the mission. Local variables are not allowed to be used in the editor.
  21. dreadedentity

    MP respawns & Equipment problems

    1. You need to create a file and put it in your mission folder called description.ext. When you open that file in a text editor, you can use everything on that webpage I posted. Here is an example description.ext that I just pulled out of a random mission (Luckily, this particular description.ext was being used to experiment with multi-line #define's to create variable classes): You have 2 choices regarding how you want to make the respawn work, you can use respawn type "GROUP" or "BASE". If you choose to have respawn type "BASE" you will need to create a marker called "respawn_west", and to make sure you respawn at the leader you should also have a background loop running that keeps setting the marker position to the group leader position (NOTE: I have no idea what will happen if the group leader dies). The "GROUP" type respawn seems to just respawn you somewhere near the group, but not necessarily the leader, but it's a lot easier to implement. Then you can set a respawn timer of 10 seconds using the "respawnDelay" attribute. Here's an example: author = "gadjr114"; respawn = "GROUP"; respawnDelay = 10; 2. It's just a weird bug that's always been in the game (and probably always will), the "drop-to-ground" solution is the only way I've found to pick up those bugged items.
  22. dreadedentity

    MP respawns & Equipment problems

    1. description.ext 2. Your friend needs to drag the items from the body to the "ground" tab, then pick them up from there
  23. dreadedentity

    how Get data from listbox

    BIS_fnc_objectVar might be useful to you
  24. dreadedentity

    No Text In GUI From Editor?

    It's not a color issue. "sizeEx" is an attribute that deals with text size. I see "1 * GUI_GRID_H" but I don't see GUI_GRID_H defined anywhere. It's probably being default to 0 and since 1 * 0 = 0 you have text with no size. I recommend to either define a static size with sizeEx or create a #define for GUI_GRID_H
  25. dreadedentity

    If then else stament

    Can you post the full script and also the script that calls it? Those 3 if statements are syntactically correct. The only problem that I saw was that the last if statement will never, ever (in millions of years) be run because you set the condition to false right before it.
×