Jump to content

gc8

Member
  • Content Count

    2122
  • Joined

  • Last visited

  • Medals

Everything posted by gc8

  1. lbSetData can only save strings as data. What you can do is create seperate array and get the UAVs from there. You could just make the _UAVarray global: UAVarray then use that example: UAVarray = []; { if (side _x == _vehicleside) then { UAVarray pushBack _x; } } forEach allUnitsUAV; Then: _index = lbCurSel 25502; _uav = UAVarray select _index;
  2. Hi I'm working on my explosive door breach script, which I know some existing ones are around but I want to code my own , for my needs.. What I haven't been able to figure is how to detect if player places claymore on ground? I have used "Fired" EH but currently don't know how to figure if it's claymore and not handgrenade or bullet player addEventHandler ["Fired", { params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; }]; Another thing I'm trying to figure is how to get the angle of a door? I can get position but not angle. The reason for this is because I want to place the explosive on the door thx for any help!
  3. Ok I got some kind of solution for the door angle, it's not perfect but in my tests worked on takistan building doors. Here's the code: private _pos = _bldg selectionPosition format ["Door_%1", _doorIndex]; private _posTrigger = _bldg selectionPosition format ["Door_%1_trigger", _doorIndex]; private _posAxis = _bldg selectionPosition format ["Door_%1_axis", _doorIndex]; _doorAngle = _posTrigger getdir _posAxis; // Get door angle but it varies depeding on which side the door handle is _closestDist = 100000; _doorFrontPos = []; { // Create 2D vector (engine solution for this?) _distFromDoor = 0.05; _tryAngle = _doorAngle + _x; _x = sin _tryAngle * _distFromDoor; _y = cos _tryAngle * _distFromDoor; _vec = [_x,_y,0]; _checkPos = _posTrigger vectorAdd _vec; _checkPos = _bldg modelToWorld _checkPos; _dist = _checkPos distance2D player; if(_dist < _closestDist) then { _closestDist = _dist; _doorFrontPos = _checkPos; }; } foreach [90,-90]; _chargepos = _doorFrontPos; _projectile setposAtl _chargepos; What it does it checks two different angles from the surface of the door to player and selects the closer one. This way player should always place the charge on the right side of the door This script could set the projectile (charge) direction properly facing on the door but I don't know how to get the vector math for that
  4. Hmm hard to say, maybe syntax error. hope someone can help you
  5. Well assuming you are using the task module in editor to start your task then you should also define the "task ID" in the task module properties. Then you put that "task ID" to the code I posted. and then you put the code I posted to triggers "on activation" field so if your task ID is: myTask then your code is: [myTask,"CANCELED"] call BIS_fnc_taskSetState;
  6. yea I believe so I haven't used much triggers and task modules because I always put everything in script files :) but hopefully some one can help you there
  7. yes, with: [yourTaskIdHere,"CANCELED"] call BIS_fnc_taskSetState;
  8. @stburr91 Thanks for your thought. I can right now place/move the charge to center of the door but right angle would be nice to make it look better when the charge is on the door
  9. Yeah I did study the params but problem is finding what different attributes does the claymore have vs handgrenade. I don't want to do list of "supported" explosives but rather have script to detect that on the fly - mod compatibility in mind
  10. can't you use: _x isKindOf "Man" instead
  11. Hi Is it possible to detect when player opens the supports menu? (0-8) I could check that with commandingMenu but then I'd need to check it like each frame. An event handler would be better.. thx!
  12. Thx Larrow. I thought I probably forgot something :)
  13. Well I hacked in this code: #include "\a3\ui_f\hpp\definedikcodes.inc" waituntil { !isnull (findDisplay 46) }; findDisplay 46 displayAddEventHandler ["KeyDown", { params ["_display","_key"]; if(commandingMenu == "RscMenuReply") then { if(_key == DIK_8) then // About to open support menu { systemchat "Opening support menu..."; showCommandingMenu ""; // Deny opening (Close the whole menu) }; }; }]; You can also return true from the EH to ignore the key presses
  14. yeah I know the EH just don't know how to write the code.... maybe check that last two keys are 0 & 8 but not sure if that's the best way
  15. Not sure how to go about doing that but it might be one option
  16. @opusfmspol Tried that one already but didn't work. I think it's only for the scroll actions. thx :)
  17. hi phronk. I downloaded the demo (from Google Drive I think) but I get some script file missing error
  18. Hi I wanted to play the radio listening animation on player but only got it working with the AI. Here's my code: listenToRadioAnim = { params ["_man"]; _man playMove "Acts_listeningToRadio_In"; _man playMove "Acts_listeningToRadio_Loop"; _man playMove "Acts_listeningToRadio_Out"; }; rm call listenToRadioAnim; When rm is AI it works but when I try to run this code on player the player just puts his weapon on back Anyone know whats wrong? thx! Btw, can you make the animation play when unit is kneeling so that the stance doesn't change?
  19. I tried those commands you suggested but I get same results. And _man playAction "handGestureRadio"; does nothing
  20. Have you tried removing the AGLToASL in your code? I think addwaypoint likes ATL positions more
  21. Hi I ran to this weird coding dilemma which I basically solved but the result was so bizarre I wanted to ask you guys if you knew a better/correct way of doing this. Here's my code: myTestFnABC = { systemchat "Teeeest!"; }; // Construct the above function name _test = "ABC"; private _fnName = format["myTestFn%1", _test]; if(!isNil _fnName) then // Does the variable exist? { // Weird two calls code call call compile _fnName; }; As you can see I am construction the function name string and then compiling it and calling twice to get the myTestFnABC executed. Surely there has to be other way than two calls? (Without changing the fact that I need the function name constructed like above) thx for your thoughts
  22. that a bit over my head
  23. Yep that's what is happening. i was also thinking the same, have the other call in string to clean it up a bit I'm giving it a string variable, that worked for me
  24. @marceldev89 I think that code wont work and myTestFnABC is not called. Hence I ended up doing two calls
×