Results 1 to 9 of 9

Thread: TR UNLOAD not working. Unassignvehicle not working.

  1. #1
    CWR² Developer Jakerod's Avatar
    Join Date
    Jul 29 2002
    Location
    Chicago, IL, USA
    Posts
    4,055

    TR UNLOAD not working. Unassignvehicle not working.

    Below is a script. The point is for it to create a group of BMPs with seperate infantry groups in the back. The BMPs are supposed to get waypoints and follow them. One of these waypoints is supposed to be a "TR UNLOAD" waypoint so the infantry will disembark and then go to their own waypoint. However, I have been unable to get the TR UNLOAD waypoint to work. So I tried using unassignvehicle. The infantry gets out of the BMP if I change the script so that the unassignvehicle part is outside of a waypoint but fails to work if I change it so that they should get out at the waypoint.

    Putting them in the same group is an undesirable option for many reasons with the most important one being that they will drop their men into the water if they are going through water and spot an enemy. The most desirable option is for TR UNLOAD to work but for whatever reason it doesn't when put inside a script.

    Code:
    _bmpcharge = ["bmps","bmps",4,"LINE",false,0,"wp0","MOVE","wp1","MOVE","wp2","MOVE","wp3", "TR UNLOAD","wp_inf","MOVE"] execVM "jsp_cwr2_soviet_attack.sqf"
    Spoiler:

  2. #2
    Master Gunnery Sergeant twirly's Avatar
    Join Date
    Sep 13 2010
    Location
    Gods Own (NZ)
    Posts
    1,302
    Funnily enough I was also trying to get a scripted "TR UNLOAD" to work last night.... no joy. Tried for hours and eventually gave up. I ended up using this as the Waypoint Statements and it worked well enough for my purposes.

    Code:
    _wptext = "{unassignvehicle _x;[_x] ordergetin false} foreach (assignedcargo vehicle (thislist select 0))";
    _wp setWaypointStatements ["true", _wptext];

    "Learn by doing!" - Quoted from a post by Imutep

    OUTERRA - OUTERRA - OUTERRA - OUTERRA - BLOWMIND!

  3. #3
    CWR² Developer Jakerod's Avatar
    Join Date
    Jul 29 2002
    Location
    Chicago, IL, USA
    Posts
    4,055
    Author of the Thread
    Quote Originally Posted by twirly View Post
    Funnily enough I was also trying to get a scripted "TR UNLOAD" to work last night.... no joy. Tried for hours and eventually gave up. I ended up using this as the Waypoint Statements and it worked well enough for my purposes.

    Code:
    _wptext = "{unassignvehicle _x;[_x] ordergetin false} foreach (assignedcargo vehicle (thislist select 0))";
    _wp setWaypointStatements ["true", _wptext];
    Thanks I'll try that.

    EDIT: Okay I got twirly's code working for the lead BMP. But for some reason the other two BMPs won't unload their troops. I even copied the _wptext thing two more times and changed the 0 at the end to 1 and 2. Shouldn't that work or am I misunderstanding it?

    The thing that really pisses me off is this:

    I put a mechanized infantry group down. Took the bmp out of the group. Put this in the init field: bmpgrp = group this;
    I put this in the init field of the infantry: {_x moveInCargo bmp} forEach units this
    I put in a radio Juliet trigger with this: wpi = bmpgrp addwaypoint [getMarkerPos "wp0",20]; wpi setWaypointType "TR Unload"; wpi setWaypointSpeed "Full";

    That works perfectly. The BMP goes to the marker wp0 and drops off the troops. But when I use TR Unload in a script it doesn't work.
    Last edited by Jakerod; Jun 10 2012 at 17:10.

  4. #4
    It must be your script it seems to work for me unless I'm not reading it right.

    I have it set like this

    Vehicle named BMP
    init : bmpgrp=group this;null=[] execvm "out.sqf"

    Group named Blue
    init : blue = group this;{_x moveincargo bmp} foreach units blue

    Script "out.sqf"
    Code:
    sleep 2;
    wpi = bmpgrp addwaypoint [getMarkerPos "wp0",20];
     wpi setWaypointType "TR Unload"; 
     wpi setWaypointSpeed "Full";
     
     wpi = bmpgrp addwaypoint [getMarkerPos "wp1",20];
     wpi setWaypointType "move"; 
     wpi setWaypointSpeed "Full";
    
      wpinf = blue addwaypoint [getMarkerPos "wp2",20];
     wpinf setWaypointType "move"; 
     wpinf setWaypointSpeed "Full";
    I have three markers named wp0, wp1 and wp2

    The BMP moves to wp0 and units getout and BMP then moves to wp1, infantry move to wp1.


    I have run into a problem when trying to get multiple groups to work.
    The vehicles work and the units get out but for some reason the infantry stay put and don't move to waypoints.
    For this I have to name the leader of the group and then use this line wpinf = group _grp addwaypoint [getMarkerPos "wp2",20];

    Updated script :-
    Spoiler:
    Last edited by F2k Sel; Jun 10 2012 at 18:06.

  5. #5
    CWR² Developer Jakerod's Avatar
    Join Date
    Jul 29 2002
    Location
    Chicago, IL, USA
    Posts
    4,055
    Author of the Thread
    Quote Originally Posted by F2k Sel View Post
    It must be your script it seems to work for me unless I'm not reading it right.

    I have it set like this

    Vehicle named BMP
    init : bmpgrp=group this;null=[] execvm "out.sqf"

    Group named Blue
    init : blue = group this;{_x moveincargo bmp} foreach units blue

    Script "out.sqf"
    Code:
    sleep 2;
    wpi = bmpgrp addwaypoint [getMarkerPos "wp0",20];
     wpi setWaypointType "TR Unload"; 
     wpi setWaypointSpeed "Full";
     
     wpi = bmpgrp addwaypoint [getMarkerPos "wp1",20];
     wpi setWaypointType "move"; 
     wpi setWaypointSpeed "Full";
    
      wpinf = blue addwaypoint [getMarkerPos "wp2",20];
     wpinf setWaypointType "move"; 
     wpinf setWaypointSpeed "Full";
    I have three markers named wp0, wp1 and wp2

    The BMP moves to wp0 and units getout and BMP then moves to wp1, infantry move to wp1.


    I have run into a problem when trying to get multiple groups to work.
    The vehicles work and the units get out but for some reason the infantry stay put and don't move to waypoints.
    For this I have to name the leader of the group and then use this line wpinf = group _grp addwaypoint [getMarkerPos "wp2",20];

    Updated script :-
    Spoiler:
    What happens if you have the BMP spawn though using createunit? Does it still work? I'm wondering if that might be the problem. Because I can get it to work with a BMP and group that starts out in the mission but not ones created using createunit it seems.

  6. #6
    It does work using the bis_fnc_spawnvehicle but spawning does complicate things a little. It all seems to come down to the name of the BMP/Group.

    Here's an example
    http://www.sendspace.com/file/ntmg9v

    I haven't spawned the actual groups just the vehicle with crew.

  7. #7
    CWR² Developer Jakerod's Avatar
    Join Date
    Jul 29 2002
    Location
    Chicago, IL, USA
    Posts
    4,055
    Author of the Thread
    Quote Originally Posted by F2k Sel View Post
    It does work using the bis_fnc_spawnvehicle but spawning does complicate things a little. It all seems to come down to the name of the BMP/Group.

    Here's an example
    http://www.sendspace.com/file/ntmg9v

    I haven't spawned the actual groups just the vehicle with crew.
    Nothing really happens in that mission. The guys just run to the sides of the runway.

  8. #8
    You perhaps need the function module placed on the map. I Use the CBA addon so it's not needed.

  9. #9
    CWR² Developer Jakerod's Avatar
    Join Date
    Jul 29 2002
    Location
    Chicago, IL, USA
    Posts
    4,055
    Author of the Thread
    Quote Originally Posted by F2k Sel View Post
    You perhaps need the function module placed on the map. I Use the CBA addon so it's not needed.
    Okay. Thanks. I'll take a look.

Similar Threads

  1. ArmA Has Stopped Working (ArmA - Gold Not Working After Initial Install)
    By Anthropoid in forum ARMA - TROUBLESHOOTING
    Replies: 2
    Last Post: Jun 22 2012, 09:32
  2. Briefing not working and Im matching a working Briefing.
    By Eaglezero6205 in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 5
    Last Post: May 22 2012, 16:15
  3. addscore working in host not working on dedicated
    By braincrush in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 12
    Last Post: Sep 21 2010, 19:22
  4. Working/non-working specs comparison thread
    By Mathias_Eichinger in forum ARMA - TROUBLESHOOTING
    Replies: 14
    Last Post: Jun 21 2007, 20:30
  5. unassignvehicle
    By Clavicula_nox4817 in forum ARMA - MISSION EDITING & SCRIPTING
    Replies: 3
    Last Post: May 18 2007, 11:27

Posting Permissions

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