Results 1 to 5 of 5

Thread: Need help/testing for this multiple group command script!

  1. #1

    Need help/testing for this multiple group command script!

    Hey guys, I've been working on a multiple group command script (mostly intended for use in tank battles) for a while, it works on the basis of OnMapSingleClick, and moves a marker to wherever you click which the corresponding selected group via the radio moves to, markers are assigned to each unit/group so the player can keep track of the units under their command more easily; though i've run into a few problems which I could do with some help in finding solutions for:

    • When a group of tanks reaches their next posistion (works by DoMove GetMarkerPos for each unit in the group) they all clump up together and can get destroyed easily before returning to their previous formation. I've tried using a variation of the Helicopter Collision script though Its not worked very well, so i need a way to keep them spaced out. Im not sure if sending units to markers is the most efficient way of doing this, maybe I should create waypoints instead?

    • Im also having problems in telling when a tank has been rendered inoperable, once a friendly tank is destroyed a sidechat message tells you which tanks gone and removes it's marker from the map, the problem is that more than half the time the tanks just get "knocked out", the crew jump out and it looks as though the tank is still alive on the map and part of the group (albeit not moving) so I'll need a way of getting that information to the player. (I was thinking maybe sending a message to the player that a tank was dead using GetDammage rather than when it is destroyed)


    heres a link (if it works)to the test mission anyway, I'd like it if people could give it a test (needs no addons) and give me some feedback/suggestions
    Last edited by POPKA; Aug 17 2010 at 10:47.

  2. #2
    to your first question, if there are multiple tanks in one group, don't give doMove to all of them, just the leader. If each group has 1 tank and you are talking about many tanks from different groups crashing on each other, don't use doMove at all. create a waypoint for each group, give it a radius of let's say 100m and then use the setWpPos command. also put something in the condition field so that it never activates or place a cycle waypoint after the first.

    to your second question, I'm guessing you are using the alive command, which is a mistake for tanks. getDammage could be useful, but canMove and canFire would be more helpful. make every tank execute a script like this:
    Code:
    [tank1,"tank'sMarker1"] exec "checkIfMyTankIsWrecked.sqs"
    here's an example of the script
    Code:
    _tank = _this select 0
    _marker = _this select 1
    _crew = units (crew tank)
    
    @(not ((canMove _tank)) or not ((canFire _tank)))
    (_crew select 0) sideChat "My tank is busted!"
    _marker setMarkerType "Marker"  (or _marker setMarkerType "Empty")
    exit
    what this should do is wait until the tank can't move or can't fire, then have the tank's marker changed and the crew use the radio to tell you, if of course anyone survived.
    didn't really have time to download and check your script, but I hope this is helpful...

  3. #3
    Gunnery Sergeant
    Join Date
    Aug 23 2003
    Location
    England
    Posts
    566
    Author of the Thread
    Quote Originally Posted by SilverRanger View Post
    to your first question, if there are multiple tanks in one group, don't give doMove to all of them, just the leader. If each group has 1 tank and you are talking about many tanks from different groups crashing on each other, don't use doMove at all. create a waypoint for each group, give it a radius of let's say 100m and then use the setWpPos command. also put something in the condition field so that it never activates or place a cycle waypoint after the first.

    to your second question, I'm guessing you are using the alive command, which is a mistake for tanks. getDammage could be useful, but canMove and canFire would be more helpful. make every tank execute a script like this:
    Code:
    [tank1,"tank'sMarker1"] exec "checkIfMyTankIsWrecked.sqs"
    here's an example of the script
    Code:
    _tank = _this select 0
    _marker = _this select 1
    _crew = units (crew tank)
    
    @(not ((canMove _tank)) or not ((canFire _tank)))
    (_crew select 0) sideChat "My tank is busted!"
    _marker setMarkerType "Marker"  (or _marker setMarkerType "Empty")
    exit
    what this should do is wait until the tank can't move or can't fire, then have the tank's marker changed and the crew use the radio to tell you, if of course anyone survived.
    didn't really have time to download and check your script, but I hope this is helpful...
    The CanMove and CanFire stuff was useful thanks! each group has four tanks, the problem is once they move to the next user defined location once they reach the marker they all try and pile onto the same spot before returning to their initial formation.

    I tried the SetWPPos command though i wasn't able to get it to do anything, I don't think it's possible to create new Waypoints in Flashpoint by command is it? I'll have another go though and see what happens

    edit: the script which checked whether or not the units were alive wasn't looping properly because of an error I made, it seems to be working fine now for checking this now.
    Last edited by POPKA; Aug 18 2010 at 14:16.

  4. #4
    I just checked your script a bit and I think I found what's wrong with it.
    inside the MoveTo.sqs
    Code:
    "_x DoMove GetMarkerPos _marker" foreach units group Leader _group
    I don't know if you've changed this, but this would cause all tanks to pile up into the same spot! you ONLY need to give the doMove command to the leader and the rest will quietly follow in formation (and if they are too stubborn to follow use the doFollow command).

    as for your other question, no you can't create new waypoints through script. the setWpPos only moves around EXISTING waypoints...

  5. #5
    Gunnery Sergeant
    Join Date
    Aug 23 2003
    Location
    England
    Posts
    566
    Author of the Thread
    Quote Originally Posted by SilverRanger View Post
    I just checked your script a bit and I think I found what's wrong with it.
    inside the MoveTo.sqs
    Code:
    "_x DoMove GetMarkerPos _marker" foreach units group Leader _group
    I don't know if you've changed this, but this would cause all tanks to pile up into the same spot! you ONLY need to give the doMove command to the leader and the rest will quietly follow in formation (and if they are too stubborn to follow use the doFollow command).

    as for your other question, no you can't create new waypoints through script. the setWpPos only moves around EXISTING waypoints...
    Yeah i think I tried giving to only the leader before, but this ended in only the leader moving to the marker. I'll try again though, maybe I could use the dofollow command for the other units. Im trying to put the scripts together in such a way that I can use them as a basic template to avoid having to individually name units and such. Thanks!

    yeah just gave it a test, what happens is the Leader of the group moves to the marker posistion though the other units in the group won't follow until he's reached the markers posistion.

    Right, I've managed to find a work around:

    Code:
    _GroupUnits = units _group
    
    (_GroupUnits select 1) dofollow leader _group
    (_GroupUnits select 2) dofollow leader _group
    (_GroupUnits select 3) dofollow leader _group
    They stay in formation now and move at the same time with no clumping up into a big target, just need to make a few more modifications with the detection scripts and invent a way of reeinforcing groups which have lost units.
    Last edited by POPKA; Aug 18 2010 at 17:15.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •