Jump to content

dreadedentity

Member
  • Content Count

    1224
  • Joined

  • Last visited

  • Medals

Everything posted by dreadedentity

  1. You guys want it to be too complicated, all you have to do is put this in init.sqf: //all players run init.sqf, even JIP if I'm not mistaken player addAction ["<t color='#ff1111'>BIS Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal},[],9,true,true,'','cursorTarget isKindOf "B_supplyCrate_F"']; player addEventHandler ["Respawn", { (_this select 0) addAction ["<t color='#ff1111'>BIS Arsenal</t>", {["Open",true] spawn BIS_fnc_arsenal},[],9,true,true,'','cursorTarget isKindOf "B_supplyCrate_F"']; //whenever unit respawns this adds the action back }];
  2. Hey all, I have some code that looks (exactly) like this: _base = []; _center = createVehicle ['Sign_Arrow_Blue_F', [14641.7,16179.2,0.00144577], [], 0, 'CAN_COLLIDE']; //this area is on Altis main airfield (runway) I suggest you bring a car to help you find it easier. _bPoint = getPos _center; _base pushBack _center; _obj = createVehicle ['Land_CampingTable_F', [(_bPoint select 0) + 1.73438, (_bPoint select 1) + -1.90039, (_bPoint select 2) + -0.00128746], [], 0, 'CAN_COLLIDE']; _obj setDir 134.633; _base pushBack _obj; _obj attachTo [_center]; _obj = createVehicle ['Land_CampingChair_V2_F', [(_bPoint select 0) + 1.79492, (_bPoint select 1) + -2.60742, (_bPoint select 2) + -0.0136433], [], 0, 'CAN_COLLIDE']; _obj setDir 135.633; _base pushBack _obj; _obj attachTo [_center]; _obj = createVehicle ['Land_CampingChair_V2_F', [(_bPoint select 0) + 2.37598, (_bPoint select 1) + -1.8457, (_bPoint select 2) + 0.00235367], [], 0, 'CAN_COLLIDE']; _obj setDir 134.888; _base pushBack _obj; _obj attachTo [_center]; Creating the objects works excellently, but the objects stay at 0 azimuth. It's like the command is getting skipped over. I read everything in the BIKI, resetting position doesn't do anything. Also, there were many other threads over the years with issues relating to this command, none of the suggested fixes worked for me. Hopefully we can get this sorted out once and for all. Thanks in advance.
  3. dreadedentity

    setDir not working?

    Thanks a lot guys, worked perfectly
  4. I need to remove the display event handler I have added for a script I'm going to post soon. The problem is that not even removeAllEventHandlers works? How do I get rid of it? Thanks for the help in advance
  5. I was just repeating what you said. Out of the 4 options given by Lala14, #1 would be the easiest to do, #3 the fastest to implement.
  6. dreadedentity

    MCC Merging Problem - "Missing '}'"

    I spent the past few hours thinking about this while I worked on a new script and I realized I have no idea why it's not working.
  7. This is the answer. But for future reference, when a player respawns they lose everything, their gear, their position (unless you set it so they respawn where they died), and all script-added actions. The only thing they keep is event handlers that have been added to them. The reason they lose the action when they respawn is because you never added the action back after they respawn. player addMPEventhandler ["MPRespawn", { player enableFatigue false; _x addAction ["<t color='#ff1111'>BIS Arsenal</t>", { ["Open",true] spawn BIS_fnc_arsenal; }]; }];
  8. dreadedentity

    How do I remove a display event handler?

    Wow, I really dropped the ball this time. Thanks a lot Iceman
  9. dreadedentity

    Display EH doesn't work

    My mistake, I thought you were referring to a custom menu
  10. dreadedentity

    MCC Merging Problem - "Missing '}'"

    I believe that's an unrelated problem. I looked in some of my other mission.sqm's to get an idea of how things are set up, and they all look quite a bit different from what you posted.
  11. dreadedentity

    Display EH doesn't work

    In your GUI definition, add onLoad = "uiNamespace setVariable ['escMenu', (_this select 0)]"; Then when you try to add your display event handler you should be able (in theory) to call it with (findDisplay (uiNamespace getVariable "escMenu")) displayAddEventHandler [stuff];
  12. dreadedentity

    Display EH doesn't work

    If you're trying to get the display for the main game (right when you load the mission), that's because the game uses display 46.
  13. Should work in theory. (untested) unit addEventHandler ["HandleDamage", { if (side (_this select 3) != side (_this select 0)) then //if not the same side then set damage { (_this select 0) setDamage ((damage (_this select 0)) - (_this select 2)); }; 0; }];
  14. enableRadio. It stops all radio messages, though.
  15. dreadedentity

    MCC Merging Problem - "Missing '}'"

    Your "Groups" class is not closed. and somehow it's not indented properly.
  16. Post the script if that's possible Press F12 to take a screenshot in-game :p
  17. dreadedentity

    [Request] Need a custom base

    @oshydaka Use this instead. It can't change elevation right now, I may add that soon, but with it you can pick up and drop objects, rotate them, duplicate them, and delete them. Just read everything I've written in the post, it explains everything.
  18. Just throw some parenthesis in there to be safe, should be an easy fix. Awesome script, btw, just reading it early on helped me really understand a few things that I thought I did, but really didn't. Other than a very short excursion with UnityEngine, this is the first time I've ever worked in an environment where you can have multiple processes going on simultaneously.
  19. Hello all, Earlier today someone was asking about building a base. Being the good guy that I am I started working on something that would make it easy to build bases. Rather than making ~30 edits to the code over the course of an hour like I usually do, I got it to a point where it works then posted it. Then I lazily beefed it up a little more over the course of the past few hours. This is the ultimate result. Working in the current release of Arma 3 at the time of this posting. Copy this and paste it into the Debug Console, then click "Local Exec" actionStatus = false; { removeAllActions _x; removeAllActions player; }forEach (allMissionObjects "ALL" - [player]); { _x addAction ["Pick Up", { if (!actionStatus) then { (_this select 0) attachTo [(_this select 1)]; (_this select 0) setUserActionText [(_this select 2), "Drop"]; heldObject = (_this select 0); heldObjectDir = (direction(_this select 0)); currentAction = _this select 2; rotateEvent = (findDisplay 46) displayAddEventHandler ["keyDown", " if (_this select 1 == 51) then { heldObjectDir = heldObjectDir - 1; heldObject setDir heldObjectDir; }; if (_this select 1 == 52) then { heldObjectDir = heldObjectDir + 1; heldObject setDir heldObjectDir; }; if (_this select 1 == 207) then { detach heldObject; actionStatus = false; heldObject setUserActionText [currentAction, ""Pick Up""]; player removeAllEventHandlers ""keyDown""; }; if (_this select 1 == 211) then { detach heldObject; deleteVehicle heldObject; actionStatus = false; }; if (_this select 1 == 210) then { createVehicle [typeOf heldObject, getPos heldObject, [], 0, ""CAN_COLLIDE""]; }; false;"]; }else { detach (_this select 0); (_this select 0) setUserActionText [(_this select 2), "Pick Up"]; player removeAllEventHandlers "keyDown"; }; actionStatus = !actionStatus; },[],6,true,true,"",""]; }forEach (allMissionObjects "ALL" - [player]); player addAction ["Save to clipboard", { clipboard = ""; { if (typeOf _x != "Logic" && {typeOf _x != "Snake_random_F"} && {typeOf _x != "FxWindPollen1"} && {typeOf _x != "FxWindGrass2"}) then { pos = getPos _x; pos set [2, round (pos select 2)]; clipboard = clipboard + format["_obj = createVehicle [""%1"", %2, [], 0, ""NONE""]:_obj setDir %3:", typeOf _x, pos, round direction _x]; }; }forEach (allMissionObjects "ALL" - [player]); copyToClipboard clipboard; }]; TO USE THIS: First you need to put some things down in the editor. Place more than you need. You can delete stuff you don't want by picking it up and pressing "delete". You can also rotate objects by picking them up and pressing either < or >. They are bound like you think they would be, < rotates counter-clockwise and > rotates clockwise (like arrows pointing). Note: For some reason infantry doesn't like to be rotated, they will turn back to where they started (from what I could tell, the output is unaffected by their stupid behavior). ADDED: 2 new buttons; "Insert" will create a duplicate of the currently held object but you need to go back to the Debug Console and click "Local Exec" again (or click it a few times, I've already sorted out the issues with this) or else there won't be options to pick up the duplicated objects. "End" is an emergency drop button, I realize that for some objects you will not be able to "drop" them because the option doesn't show up. Just press "End" and the object will be dropped right where it is (I have also already sorted out the issues with this). TO SAVE: Select the "Save to Clipboard" option, then open notepad and paste the result. Press "ctrl + h" and replace all colons ( : ) with semicolons ( ; ). After that point you can then copy it again and paste the code right into your script. Wham, bam, easy peasy. A NOTE ABOUT SAVING: There are many random objects that get picked up when you use "allMissionObjects" for some reason (like snakes), I did a quick test and made a filter for a few of these items. If you are using this piece of code and you notice some random classname in the output, comment back here and I'll add it to the filter. For other scripters: For some reason, if you put a unit down, you are still able to rotate it until you pick up another unit. This is a bug due to my lack of knowledge of removing a display event handler. There is a piece of code in there that needs to be replaced, but the code still runs and without problem so I left it in as a guide on what to replace. Enjoy
  20. There actually are a couple of kinks to work out, this being one of them. There's no elevation functionality in this code, basically I was thinking you would just put the object underneath, save the code, then change elevation manually. I could easily add that tomorrow when I wake up, but there is a host of other problems with that (like how far to increment, rounding issues, etc...) Thanks for the explanation of ObjectGrabber, I thought about saving the information to the .rpt but I really don't know much about it, not even it's location in my computer's files. copyToClipboard is really basically the only other native command in A3 that can let you get information out of the game. But of course the clipboard is extremely volatile, and just accidentally copying something can make your entire base disappear :(
  21. sleep (60 * 30); It's not the same thing and AVIBIRD is confirming it. There are some weird things the engine does, one of them is breaking to a new line anytime a semicolon is encountered (even enclosed in quotation marks). That's exactly the reason why you have to copy the output for the base-building-helper script I just posted and replace all the colons with semicolons then copy it back into your script before you can use it. I'm guessing another engine quirk is after encountering an acceptable parameter for a command, everything after it is ignored. In my simple patrol script (which I'm seriously going to rewrite one day), I found this out the hard way, it's one of the reasons my code has a ton of parenthesis (also, I guess I really am old-school). My philosophy for coding is the same as my philosophy for safe sex, "when in doubt, wrap your shit up"
  22. I'm not sure what the object grabber is, but if there's a built-in tool for this I'm going to feel pretty stupid. lol... Basically, this is just some little code you run in the debug console, it'll apply a pick-up/drop action to every editor-placed and mission-spawned object on the map except for the player. You can move them about and rotate them to your hearts content then save everything. I tried filtering out the mission-spawned objects like snakes and leaves (also for some reason there's a Logic module), but I can't be sure I got them all since I didn't do much testing on that. It doesn't mess with the output very much, just a few extra createVehicles to delete :)
  23. I've been playing around with this stuff for the past few weeks, actually gotten pretty good at it. I just kind of...answer questions on the forum like a robot now. I'm wondering if anybody would like to join me, ideally I'm only looking for 1-2 other people. I do have a teamspeak server and you would be required to join it often, if not daily. Initially we could just work on our own projects, occasionally helping each other out, but shortly I'd like to start on a nice, big project. Please (at least) know how to script a little. English is the only language I know, please speak english... please PM me or respond to this thread if you're interested, we start tomorrow.
  24. You guys should all probably join chat...just saying.
  25. You're going to have to start scripting outside the editor soon. The editor is...weak.
×