Jump to content

ghandolhagen

Member
  • Content Count

    33
  • Joined

  • Last visited

  • Medals

Community Reputation

11 Good

About ghandolhagen

  • Rank
    Private First Class
  1. ghandolhagen

    Inconsistent commands?

    @whiztler Thanks very much, that actually makes a lot of sense. It never occurred to me before. Thanks for the clarification, I'll watch out for this in the future.
  2. I have recently encountered some odd behavior in one of my scripts. I thought I had a pretty good grasp of this command but it has stopped behaving in the usual way. consider the following: {_x setUnitPos "UP"}forEach units group squad1; In the past and indeed up until a few minutes ago in my script, this yielded the expected behaviour of each member of squad 1 standing up. Then I got a typerror . Type group, expected object. So then I removed the word group from the command: {_x setUnitPos"UP"}forEach units squad1; And NOW it works again. Does anyone know what is going on with this? Thanks for the help.
  3. Further Update. I removed the follower vehicle's way points and instead assigned the lead vehicle the waypoints. Then in each of those onAct I just update the currPos with a getPos on the lead vic and then also tell the follower vic to move to currPos. By spacing out the waypoints and playing with the speed of the lead vehicle, the following vehicle can move along at a good clip as it is always playing catch up with the lead. Not perfect but it is serviceable. Thanks everyone for the assistance. This community is awesome! A note: two vehicles works pretty good, three or more and it gets dicey.
  4. Just wanted to update. I modified my script a bit and I got a solution that seems to work mostly. I give the following vehicle it's own series of waypoints but at each waypoint activation I run this and what seems to happen is that it recalculates the lead vehicles position at each waypoint. There is a slight stop or slow down of the following vehicle at each way point, but I think i can live with that. :D : VIC2 disableAi "Move"; while{alive VIC1}do{currPos = getPos VIC1;}; dist = VIC2 distance VIC1 > 10; while{dist}do{ VIC2 enableAi "MOVE"; VIC2 doMove currPos; VIC2 setSpeedMode "LIMITED";};
  5. jshock, Oh so it is just an index in an array. So does the script in Arma treat every variable as an array?
  6. Thanks everyone for the responses! nikiller, I have not encountered canMove before, so thanks for the education! :D One other thing. I have seen this select 0 before, but what does it refer to? That concept is fuzzy for me.
  7. Hello I am attempting to have one vehicle follow a lead vehicle's current position whenever the distance between them is greater than 10 metres. Here is my first stab which doesn't work. The second vehicle does move to where the first vehicle WAS but then stops. It is as if the code is not updating the current position of the lead vehicle. Any ideas? Cheers! while{alive VIC1}do{currPos = getPos VIC1;}; dist = VIC2 distance VIC1 > 10; while{dist}do{VIC2 doMove currPos; VIC2 setSpeedMode "LIMITED";};
  8. Greetings. I had a question. Is the Random Patrol Module functional? Or am I using it wrong? Here is how I attempted to use it: First I have a squad called squad1, then I put down a civilian called c1 and give him several move waypoints. Next I place a random patrol module down and in the first array I put squad1. In the second array (the one that pulls the waypoints) I place c1. Finally I synchronize the squad and the civilian to the module and test it. So far so good the squad moves to all the way points that were given to the civilian. Neat but not random so now it is time to add more civilians with different move waypoint paths. I place more civilians down assign waypoints and add their names c2, c3, c4 to the array in the module. I synchronize them to the module. As I understand it at this point the module will choose one of those civilians and assign its waypoints to the squad. What happens instead is sometimes the squad is removed leaving a civilian to follow the first civilian's waypoiints and other times I test it, the squad is there but will always go to only the first civilian's waypoints. I must be doing something wrong. Any ideas? Thanks very much :D
  9. ghandolhagen

    RHS Escalation (AFRF and USAF)

    The problem I seem to be having is the Mi-24s don't work. They instantly run out of fuel, even when I try to do a hack like setFuel 1; or some kind of recursion that keeps setting fuel to 1. They just won't fly. The other Russian choppers seem to work fine. Really great mod in general just wish the Hinds would fly
  10. I too am looking to check the distance between a unit named DUDE and a marker. Everything works fine until the conditional at which point it throws an error and says that I am missing a '{'. Doesn't look like it to me so something else must be going on. Any thoughts? private ["_this", "_rWP", "_wps", "_wpPos", "_wpDist"]; _wps = ["wp1", "wp2", "wp3"]; _rWP = _wps call BIS_fnc_selectRandom; _wps = _wps - [_rWP]; _wpDist = DUDE distance getMarkerPos _rWP; DUDE doMove getMarkerPos _rWP; hint _rWP; if(_wpDist <= 0) then { hint _rWP + " reached!"; };
  11. ghandolhagen

    Need a syntax check...

    Thanks for the tip .kju
  12. ghandolhagen

    Need a syntax check...

    good to know :P I will check it out. also for the sake of thoroughness here is an example conditional I was playing with but it doesn't work either: if((speed _this == 0) && (_this distance _currentWP < 5)) then{ _currentIndex = _currentIndex +1; _nextWP = _patrolPath select _currentIndex; _currentWP = _nextWP; {_x doMove getMarkerPos _currentWP} forEach units group _this; };
  13. ghandolhagen

    Need a syntax check...

    Hey Champ-1, thanks for chiming in again. Still no dice. they just stand still and don't move at all. In my original script (the one where I was trying to write the whole thing from scratch) The logic I was following was, 1. randomize waypoints 2. store random wps in an array 3. Conditional to see if the units were moving or not. If yes then continue to current way point , if not then go to the next wp in the array via something like a currentIndex variable or something unless they were at the end of the wp chain....
  14. ghandolhagen

    Need a syntax check...

    Thanks for the suggestion, unfortunately, setting a search and destroy waypoint only results in them wandering around the initial waypoint until they have determined it is clear then they stop moving. Ignoring all the other waypoints in the chain . This is a tricky one but i do appreciate all the feedback and support. Cheers :D
  15. ghandolhagen

    Need a syntax check...

    Just a quick follow up. I tried the code and the group moves to a random waypoint (the first one) just fine, however they stop when they get there they don't move to the next in the series. I appreciate the feedback and the code snippets. A lot less intimidating to work with than my madness :D I'll keep crunching on it and post an update if I get a breakthough. Cheers!
×