Jump to content

tryteyker

Member
  • Content Count

    1164
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by tryteyker

  1. Just an idea, does the AI look after assigned doMove commands when in the air? Maybe issuing a doMove command towards an invisible object could get them to move to something specific.
  2. Hey, I'm currently working on an Evac script and I've run into multiple issues when using flyinheight. waitUntil {_evachelopilot distance _unit < 300}; _evachelopilot setspeedmode "LIMITED"; flying = true; _evachelopilot flyinheight 10; hintsilent "flyin low"; while {flying} do { _height = (getposATL _evachelo select 2); hintsilent format ["%1",_height]; if (_evachelopilot distance _unit <= 100 && (getposATL _evachelo select 2) <= 50) then { _evachelopilot flyinheight 0; flying = false; hintsilent "stopped"; }; sleep 0.2; }; This is what I have so far. (Obviously only the relevant part) The issue here is that apparently, flyinheight 10 is equal to a height of 50. When the helo stops completely and is flyinheight at the height flyinheight issued (which is 10), the hintsilent returns 50. I've adjusted the height requirement accordingly, but even issuing a flyinheight 0 leaves the helo at a height of 50. I tested this on a street which should absolutely be no problem for the AI (atleast what I know of) but apparently it is. Also, I've tested a for loop, but that didn't work out too well and I'd rather not test that again. I'm wondering if it's an issue with flyinheight or if the AI just doesn't want to land (I've so far only tried this way, but I'll certainly try creating an invisible HPad and tell the helo to land there if this does not work out) on a street. There are some trees nearby, but the AI shouldn't have an issue, even when landing in their weird way.
  3. Just thought I'd throw this in here: _pos is already a position, so there's no need to define the position again (since you used "position _pos"), using "_pos" is enough.
  4. I've switched to creating an empty HPad at the players position when he calls for extract. _evachelopilot is basically the pilot of _evachelo, which is an empty Mi17 created mid-mission. So far land seems to work, so I'm not using flyinheight anymore either. You have an interesting point about setWind, and I'll definitely play around with that.
  5. Why don't you use BIS_fnc_spawnGroup instead? Just an idea, instead of using foreach and createUnit.
  6. how did i miss exitWith honestly... :S Thanks, I'll try it out.
  7. Title should say it all, my script is going balls to the wall here, if I can put it that way. I'm trying to terminate a script when a certain condition is met (namely, if player is not in vehicle anymore) This is my loop: while {flying} do { if (vehicle player != uh1h) then { ["TRPickup1","failed"] call SHK_Taskmaster_upd; terminate trtask1; nul = [] execVM "tasks\dynamictasks.sqf"; flying = false; }; sleep 0.5; if (uh1h distance (getmarkerpos "pickupzone") < 200 && (getposATL uh1h select 2) <= 2) then { {_x moveincargo uh1h} foreach units opforgrp; flying = false; }; }; terminate causes a CTD. And I've doublechecked the handle, it's correct. If I do not use terminate the script keeps running, only the loop gets terminated. I probably messed this up really hard and didn't notice it yet. :L Help is appreciated though.
  8. Nice work, I had a mission idea where I'd need such a concrete wall box, helps immensely, thanks alot.
  9. tryteyker

    Loops not looping

    Move basically creates a waypoint for the group and that group moves there. (I actually thought about moveTo, which is a low-level command for a unit which basically tells that unit to move to given position with radio messages) doMove is the exact opposite of moveTo, it basically overrides every move order and forces the unit to move to the position, without radio messages. Once the unit reaches that position though, it returns to the original group formation. Since you're only using 1 BlackHawk though it isn't much of a problem.
  10. tryteyker

    Tank (ir) smoke

    When you pop the JAV round at it it's already too late. The smoke in tank is used to PREVENT missiles from firing at it when for example covering something and when the tank is stationary. The smoke tanks use is not identical to a flare. It only prevents people from aiming at the tank but it does not deflect already incoming missiles.
  11. tryteyker

    Loops not looping

    You have to either use call or execVM to execute sqf. You've also added a sleep of 5 seconds, and that's quite a lot. If you constantly want the unit to move to the group try adding a sleep between 0.1 and 0.5. Also, the script needs an identifier (or variable, I just call it identifier), so for example: nul = [] execVM "somescript.sqf"; else it will return an error. Also it is unnecessary to use (group _chaser), because you've already selected the leader of the group. Try out this _chaser doMove (position _chased); sleep 0.1; This should continously move the group towards the position of the chased object.
  12. The only issue I'm running into (fairly often that is) is that Notepad++ automatically seems to change my line of code into a comment when I edit it. That IS annoying, especially because I always try to spam other line of codes with sdsdsdsd and these get commented out aswell. Just something I feel I could add about that.
  13. I've tested selectRandom a couple of times now (roughly 10-15 times) and it seems to select the last array fairly often, atleast more often than 2. I'm not starting at 0 though so I ran into problems using floor random 4 since sometimes he gets up to 4 and I don't have a case for that (I'm using 1,2,3). I'll retry starting at 0 though. //Edit Okay, I've changed it to start at 0 and used floor random 3 for 0,1,2. Selection seemed to be even, and looked like this (I only tested up to 10 times though so that may or may not say too much): 0 got select 3 times 1 got selected 3 times 2 got selected 4 times During selection things seemed to be fairly even aswell, with 1 and 2 going up to 3 before 0 got up to 2 and so on, so one case didn't get too much of an "advantage" over the others so to say, but again, this has only been tested 10 times and thus it doesn't say much about even selection.
  14. Weird, Arma 2 library says Stryker MGS and it's labeled Stryker MGS. But I also saw an MG mounted ontop of the one described in the library and the one in the editor doesn't have one, so it seems you're right. :S
  15. As far as Notepad++ plugins go, I'm using this one currently: http://forums.bistudio.com/showthread.php?91939-Notepad-SQF-syntax-highlight/page3 And I can only recommend it. Includes about everything currently available and even has autocorrect. I personally have no idea about the vehicle spawn stuff, my only idea would be to use a rectangle marker to cover the whole town up and then use that.
  16. I was testing this via editor. The Stryker MGS is in US -> Armored and then all the way down. moveInGunner didn't work, but moveInCommander did. AFAIK every vehicle with only 2 slots has the gunner as Commander, see for example HMMVV.
  17. Well, needless to say that helped me quite a bit. Thanks, Mattar.
  18. If I wanted to call a function, does that function have to be within the same script or can I call it from an external script. I know that BIS functions work external but I'm not entirely sure if it works for custom-made functions awell. Any advice?
  19. IMO selectRandom is useable, but not with huge arrays. We're choosing numbers from 1-3 and I see no problem in the randomization (although honestly I did not pay that much attention to it, as in, I didn't note down any results. This is just from observing). This is different with huge arrays though, as Iceman described above.
  20. What kind of object are you placing? Where are you placing it? Some additional info would certainly be useful here.
  21. Why don't you do the counting server-side only? WHY did I even comment here.. :( What I meant is why don't you just cut out all the publicvariable stuff? I don't know anything about that so my comment here is kinda misplaced but my guess would be that deaths = deaths + 1 and then publicvariable causes deaths to add 1 once again. I don't know anything about that though.
  22. Mind showing the part of code where you create the units and move them into the vehicle? If you're using MoveInCommander instead of MoveInGunner and that doesn't work there has to be something else, since this works, I've tested it myself.
  23. Alright thanks, guess I'll have to look further as to why Taskmaster doesn't work then.
  24. You're using CAN_COLLIDE on units, and the purpose of CAN_COLLIDE is simply that the object ignores other objects, and that's kinda useless with units since as soon as they get stuck inside something they die. As for the pre-configured groups, I have no idea. About the Stryker MGS though, the gunner counts as commander, so you can't move anyone inside it with moveInGunner (only works with moveInCommander)
  25. createUnit array doesn't support "CAN_COLLIDE" and it seems unnecessary since CAN_COLLIDE simply tells the object to ignore other objects so you can eg. spawn it inside a rock. I'll take a look at the Stryker, but moveInGunner should work. Try "NONE" as special property. //Edit: Use "MoveInCommander" instead. The gunner position is the commander since there are only 2 seats in the MGS.
×