Home   Help Search Login Register  

Author Topic: Get in vehicle again  (Read 2468 times)

0 Members and 1 Guest are viewing this topic.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Get in vehicle again
« on: 25 Aug 2010, 19:04:58 »

In my mission, the player have own squad and an assistant squad (ass. squad is lead by AI).
This assistant squad sometimes get in a Bradley and then get out etc...

Originally I used this code to get in the vehicle and the add WP to vehicle to Unload transport:
Code: [Select]
{_x assignasCargo brad1} forEach units grp1
(units grp1) orderGetIn true

_wp = bradgrp addWaypoint [getPos gl1, 0];
_wp showWaypoint "NEVER";
_wp setWaypointSpeed "NORMAL";
_wp setWaypointFormation "FILE";
_wp setWaypointType "TR UNLOAD";
(grp1 is the assistant squad, brad1 is the Bradley, bradgrp is the Bradley's group) and everything fine, the squad get in the bradley, brad1 go to gl1 and squad unload...

Then I add wp to the squad and lot of minutes after he arrived, I want to order back to the vehicle:
Code: [Select]
@not(leader grp1 in brad1)
~5
_wp = grp1 addWaypoint [getPos gl2, 0];
_wp showWaypoint "NEVER";
_wp setWaypointSpeed "NORMAL";
_wp setWaypointFormation "DIAMOND";
_wp setWaypointType "MOVE";

~3

@unitReady leader grp1

~5

{_x assignasCargo brad1} forEach units grp1
(units grp1) orderGetIn true


But nothing happened. The squad still stand where they are.

I tried to unassignVehicle the whole squad after they was unload from Brad, but doeasn't work.


Then I try and other way. I forgot orderGetIn, so I just add a simple GETIN waypoint to the squad:
Code: [Select]
_wp = grp1 addWaypoint [getPos brad1, 0];
_wp showWaypoint "NEVER";
_wp setWaypointSpeed "NORMAL";
_wp setWaypointFormation "DIAMOND";
_wp setWaypointType "GETIN";

The result is worst, because in that way, the squad didn't enter the vehicle at the begining neighter...


Please help! How can I reenter that squad to their vehicle?
Fix bayonet!

Offline zonker3210

  • Members
  • *
Re: Get in vehicle again
« Reply #1 on: 25 Aug 2010, 21:33:18 »
Do you perhaps need to use the "moveInCargo" command before using the "assignAsCargo" command?

UPDATE: Sorry...I guess that won't work out too well since it essentially causes the unit to teleport into the vehicle without any animation. If you have a sample mission showing this issues, I can try looking at the actual code to see if there's some sort of workaround for it. Sorry I couldn't help more!
« Last Edit: 25 Aug 2010, 21:38:30 by zonker3210 »

Offline Pirin

  • Members
  • *
Re: Get in vehicle again
« Reply #2 on: 26 Aug 2010, 06:56:06 »
Code: [Select]
_wp = grp1 addWaypoint [getPos gl2, 0];
 :scratch: You set the waypoint to the location of gl2, is that unit still valid at that point?  Shouldn't it read brad1?

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Get in vehicle again
« Reply #3 on: 26 Aug 2010, 07:20:46 »
@Pirin: No. The gl2 is a GameLogic where grp1 wait before they are ordered get in again. When it happened (ordered) - as you can see - I used your suggestion: _wp = grp1 addWaypoint [getPos brad1, 0];
(It is in the last code block).


@zonker3210: Now I'm at the office, but I will attach the sample mission here soon. Arrowhead is good enough? (I tested it in Arrowhead) But if you haven't OA, I can create a small sample in Utes too...



===NEWS=======================================================================


It's extremly interesting. I wanted to clear my sample mission for you and I create two mini-scripts to call it by radio Alpha and Bravo code.

The first was this:
Code: [Select]
{_x assignasCargo brad1} forEach units grp1
(units grp1) orderGetIn true

This was the second:
Code: [Select]
_wp = grp1 addWaypoint [getPos brad1, 0];
_wp showWaypoint "NEVER";
_wp setWaypointSpeed "NORMAL";
_wp setWaypointFormation "DIAMOND";
_wp setWaypointType "GETIN";

Then I tried it. I called the fist one: nothing. Then I called the second one: platoon board into the Bradley...
Restart. And first call the second one: nothing. Then call the first one: platoon board into the Bradley...

I don't know why, but BOTH need to the correck embark. Now I use this:

Code: [Select]
{_x assignasCargo brad1} forEach units grp1
(units grp1) orderGetIn true
~3
_wp = grp1 addWaypoint [getPos brad1, 0];
_wp showWaypoint "NEVER";
_wp setWaypointSpeed "NORMAL";
_wp setWaypointFormation "DIAMOND";
_wp setWaypointType "GETIN";


Can anyone explain WHY? I know, it's working, who cares, but I care... I want to understand why.

Note: before I tried this, I apply the new (1.54) patch.
« Last Edit: 26 Aug 2010, 16:52:22 by bardosy »
Fix bayonet!

Offline zonker3210

  • Members
  • *
Re: Get in vehicle again
« Reply #4 on: 29 Aug 2010, 07:50:19 »
That *does* sound really strange. Not what I would have expected, at least. I've had my own problems using scripts to tell AI squads to enter vehicles..it seemed like sometimes it would work but they'd stand around for a while first. It never occurred to me to try using a GETIN waypoint as you did...neat trick, that.

I'll have to do some tests using the script snippets you provided in your post. It's an interesting result to say the least and I, too, would love it if one of the script gurus here would share some insights as to why this is happening.