Jump to content

JSD

Member
  • Content Count

    65
  • Joined

  • Last visited

  • Medals

Everything posted by JSD

  1. I just tested, this: _locations = []; { if (str _x find "grave" != -1) then { _location = getPos _x; _locations pushBack _location; }; } forEach nearestObjects [player, [], 500]; hint str _locations; copyToClipboard str _locations works fine for me. I teleported myself into a graveyard and it gives me a bunch of locations for graves. Or probably better for you: { if (str _x find "grave" != -1) exitWith {hint "there's a grave near"} } forEach nearestObjects [player, [], 50]; Should only give the hint if there's a gravestone within 50m
  2. This might be useful; a little script I used to get the locations of all items of a certain model _locations = []; { if (str _x find "busstop_01_shelter_f" != -1) then { _location = [getPos _x select 0, getPos _x select 1]; _locations pushBack _location; }; } forEach nearestObjects [player, [], 50000]; hint str _locations; copyToClipboard str _locations You'd replace "busstop_01_shelter_f" with " Land_Grave_ ". And the 50000 with whatever distance you want.
  3. JSD

    weapons and ammo info

    You can get them without using an event handler if that suits you better. "currentweapon player" will get you the classname of the weapon, if you need display name you can use ((configFile >> "CfgWeapons" >> currentWeapon player >> "displayName") call BIS_fnc_GetCfgData) magazinesAmmo might be useful for getting magtypes and ammo of all mags on player, currentMagazine just gets you the magazine class, and player ammo currentWeapon player; will give you the ammo count for the player's current weapon. To get the display name of the current magazine use: ((configFile >> "CfgMagazines" >> currentMagazine player >> "displayName") call BIS_fnc_GetCfgData) If you copy any of these into the debug "watch" bit, it'll give you the result Hope that helps you out (:
  4. Your dialogs.hpp works for me, if I copy it into one of my missions and put createDialog "mainSpawnMenu" in debug this is what shows for me: So it should just work. Might be worth making sure the paths in your description.ext are correct but other than that I wouldn't know.
  5. This question still going? You could maybe try something with addWeaponTurret or addMagazineTurret. Not sure if that would work with grenades though, it works with other weapons.
  6. Ah yeah, well like I said the idea is to calculate the Alpha using the map zoom zo it fades away when you zoom in, but as the whole thing wasn't working I added the _mrkRGB = [1,1,1,1] bit to just make sure the colour wasn't messing it up, I removed the line now so it actually calculates the alpha properly. Too bad the zoom increments are a bit too big to notice a nice fade effect.
  7. I'm trying to learn some scripting and decided to try and create map markers that fade when you zoom in on your map, but I can't get it to work at all with how I'm trying to do it, and it seems to give no errors. It would be awesome if anyone is able to point me in the right direction. I'll copy my files down here: init.sqf JSD_Fnc_Drawmapicons = compile preprocessFileLineNumbers "JSD_Fnc_Drawmapicons.sqf"; execVM "JSD_Drawmapicons_Icons.sqf"; findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { _this call JSD_Fnc_Drawmapicons_Test; }]; JSD_Drawmapicons_icons.sqf JSD_Drawmapicons_Icons = [ [ "TOP", "Saint Louis", JSD_Icon_Empty, [1,1,1], [7132.977,8963.188], 0, 0, 0.1, "PuristaBold", "center", 2], [ "TOP", "La Trinite", JSD_Icon_Empty, [1,1,1], [7240.061,7929.14], 0, 0, 0.1, "PuristaBold", "center", 2] ]; JSD_Fnc_Drawmapicons.sqf //_map = _this select 0; { _mapScale = ctrlMapScale (_this select 0); _layer = _x select 0; _mrkTxt = _x select 1; _mrkIcon = _x select 2; _mrkRGB = + _x select 3; _mrkPos = _x select 4; _mrkW = _x select 5; _mrkH = _x select 6; _mrkTxtSize = _x select 7; _mrkFont = _x select 8; _align = _x select 9; _shadow = _x select 10; _mrkA = switch (_layer) do { case "NONE": { 1 }; case "TOP": { 1 - (_mapScale -1.45 ) ^30 }; case "MID": { 1 - (_mapScale * 18 ) ^10 }; case "LOW": { 1 - (_mapScale * 4 -115 ) ^40 }; }; _mrkRGB pushBack _mrkA; _mrkRGB = [1,1,1,1]; _mrkTxtSize2 = _mrkTxtSize/ctrlMapScale (_this select 0); if (_mrkA > 0) then { _this select 0 drawIcon [ _mrkIcon, // icon _mrkRGB, // color: [RGBA] _mrkPos, // position [X, Y] _mrkW, // width _mrkH, // height 0, // angle _mrkTxt, // text _shadow, // shadow _mrkTxtSize, // textSize _mrkFont, // font _align // align ]; }; } forEach JSD_Drawmapicons_Icons; Thanks in advance!
  8. I seem to have fixed it. I had: _mrkIcon = "";, changing that to a texture (I used "a3\ui_f\data\map\vehicleicons\iconman_ca.paa";) made the text show properly. It seems like it needs a texture to show anything. I should have probably gathered that from AgentRevolution's comment on the drawIcon wiki page: "If you want only text with no icon, you can use "#(argb,8,8,3)color(0,0,0,0)" as texture.". Seems like I was just being a dummy as usual, apologies and thanks for the help!
  9. I don't think I completely understand your question. The idea with calculating the _mrkA that way is so that markers would fade in/out when you'd zoom in and out. But as it isn't working I decided to add "_mrkRGB = [1,1,1,1]" there so it'd just take that for the colour until I've fixed the calculations for _mrkA. It might be a good one to mention I've also removed the following bit after copying it over here: if (_mrkA > 0) then { drawIcon etc.. }; As the _mrkA never seems to go above 0.
  10. Nope, but I'll give it a shot, thanks. I did try a "waituntil {!isnull (finddisplay 46)};", but that didn't work. I added "waituntil {!isnull (finddisplay 12)};" right before adding the EH, that didn't do it though. I tried replacing all the variables in the drawIcon to regular ones which didn't work either. After some more testing it shows the calculations I use for _mrkA are a bit off, fully zoomed out it's 0, and zooming in it goes down to -67927.4 rapidly. The calculations I used should look like this: where X is the _mapScale (1 is zoomed out 0 is zoomed in) and y would be the _mrkA. But even without calculating the _mrkA it won't work (that's also what I was trying a the time I copied over the files). going back to the regular values (except _mrkA) and adding a hint: hint format ["Text: %1 \nIcon: %2 \nRGB: %3 \nPos: %4 \nW,H: %5, %6 \nTxtSize: %7 \nFont: %8 \nalign: %9 \nshadow: %10", _mrkTxt, _mrkIcon, _mrkRGB, _mrkPos, _mrkW, _mrkH, _mrkTxtSize, _mrkFont, _align, _shadow]; shows that all values are what they're meant to be and that the EH does its thing on the map properly:
  11. There is a SetObjectMaterial (and global variant), which uses the regular hidden selections. That might work.
  12. JSD

    Help with array

    Now I'm very new to this so this might not be the case but wouldn't your "Deleteunit.sqf" wait until the first unit in "ARRAY_UNIT" dies, then delete it from the array and then proceed to the next unit in "ARRAY_UNIT"? So I don't think i'll check all the units in the array. If this is the case it might be better using the "Killed" event handler (link). so you'd get something like { _x addEventHandler ["Killed", {ARRAY_UNIT deleteAt (ARRAY_UNIT find (_this select 0)}]; } forEach ARRAY_UNIT; (Not 100% sure, haven't done much with event handlers at all) Again I'm very new so It'd be good for someone to confirm this.
  13. ah I copied the wrong one, init.sqf is meant to be: JSD_Fnc_Drawmapicons = compile preprocessFileLineNumbers "JSD_Fnc_Drawmapicons.sqf"; execVM "JSD_Drawmapicons_Icons.sqf"; findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { _this call JSD_Fnc_Drawmapicons; }]; I made a new one to see if redoing it would work, it didn't . JSD_Fnc_Drawmapicons_Test and JSD_Fnc_Drawmapicons are the same thing.
  14. fixed it by redoing the entire thing, still not sure what was wrong though.
  15. I'm trying to make a simple gamemode where an Opfor zeus defends a point and Blufor players try and capture it. For this the zeus has to be able to place units inside the zone and nowhere else. I added an editing area for the zeus by adding the following to initServer.sqf: OpforZeus addCuratorEditingArea [1, (position OpforHQ_Point ), 125]; this adds the area properly, but for some reason my zeus defaulted to only being able to edit outside of areas, to counter this I tried adding the "Set Editing Area Type" module in the editor, putting the correct assigned Zeus in there and setting it to "Inside Areas". This did not fix it. Next I tried adding to the initServer.sqf: OpforZeus setCuratorEditingAreaType true; But that doens't fix it either. I'll put the full initserver.sqf under here too Initserver.sqf I'm kinda lost and have no idea what I could try to fix this, thanks in advance for anyone able to help me.
  16. JSD

    Adjusting Vehichle Weapons

    this should work: https://community.bistudio.com/wiki/removeMagazine
  17. What's not working and what do you want it to do?
  18. JSD

    Problem with ingame map

    I believe you can via the EXPORTNOGRID thing, not sure if it actualy does a sat img though. https://community.bistudio.com/wiki/ArmA:_Cheats
  19. Hi, after learning how to get simple models into arma I wanted to learn how to animate parts of my objects, though I am now running into a problem where the action to open a fence gate (simple model I made to try and learn this) doesn't show up in game. In the models memory LOD I have: "Fence_Button" (Place where the button is meant to be, so the action should be here too) "SlidingFence_axis" (axis for the fence to slide) my config.cpp and my model.cfg It could be a very stupid simple little thing, but I can't figure it out.
  20. oh my god that was it, I would have gone insane before realising that xd. Thanks so much dude.
  21. oh god I missed that completely, thanks. there is some problem with steam for me and arma wont start at all so I'm going to have to test it later.
  22. yeah, I tried again when you posted that though just to be sure but it didn't work.
  23. I had already tried that, but put it back to the way it is now because that's how it works with the door. The way I worded my problem feels a bit weird so here's a little GIF which shows what I mean: imgur wont work for some reason, but I uploaded it to google drive: https://drive.google.com/open?id=0ByvOOeCeZTt6d1FDOEZvNHZRQ1k
  24. Right so that all works, but I can't do the animation properly. I want the fence to slide smoothly but when I use it in game it kind of jumps to the place where it needs to go. I've tried changing all the animPeriod things, but that did not change much. It confuses me because the model has a door too, and that works fine but the fence does not. current Config.cpp current Model.cfg is anyone able to tell me what causes this and how to fix this?
  25. You can filter to specific releases on this page https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3 At the top there's a load of icons with version numbers, click those. For example this is the one for 1.62 https://community.bistudio.com/wiki/Category:Introduced_with_Arma_3_version_1.62
×