Arzok Posted October 18, 2008 Share Posted October 18, 2008 I want to move 5 trucks to make a convoy The player has to protect this convoy. I use runcommand ( unit , 404 , move , array , "Array01" ) for the first truck. Array is made of rectangles. I have try with points, but when a truck is destroyed at the point, it blocks all others trucks. But with rectangle, 50% of the trucks stops without reason in a rectangle (not the first, not always the same) I think rectangle are wide enough Have you some idea ? Link to comment Share on other sites More sharing options...
Arzok Posted October 18, 2008 Author Share Posted October 18, 2008 I have checked with getcurrentcommand Strangely, when the truck stops, getcurrentcommand replies "defend". It explains why the truck stops, but I don't send this order "defend", and it appears randomly Link to comment Share on other sites More sharing options...
Sneaksie Posted October 20, 2008 Share Posted October 20, 2008 Try to separate commands for each truck with delays for 10secs each (less chance for blocking the way) and use points. Link to comment Share on other sites More sharing options...
Arzok Posted October 20, 2008 Author Share Posted October 20, 2008 Thank you for the answear. I tried for an other map with points and tanks (and attack) It worked fine, except the fact that when a tank is destroyed just at a point, the others will stay blocked just before. So I tried this time with rectangle, but with truck and move. And sometimes, the truck stops (with no apparent reason, like trees...), and return "defend" order instead of move. I use a delay of 30 seconds between trucks. Link to comment Share on other sites More sharing options...
JohnW Posted November 24, 2012 Share Posted November 24, 2012 I want 4 vehicles to follow a road. My understanding from Sneaksie is to use points instead of an array. It that correct? Link to comment Share on other sites More sharing options...
Arzok Posted November 25, 2012 Author Share Posted November 25, 2012 Yes, sometimes, with array, vehicules stop with no reason. So runcommand move must be used with point, but the point is comming from an array In fact, the best wat is to re-use an already existing trigger by 1C, like move_tank. For exemple, I adapt this one for the mission UC_Sud_04 /////////// PARAM IN @unit PARAM IN @path PARAM IN @army SET @Check_Point = 0 SEt @element_of_array = 0 SetWorkArmy ( Army , @army ) SET @Array_len = ArrayLen ( @path ) label begin Delay ( 108 ) Set @point_ofpath = ArrayGetElementName ( @path , @element_of_array ) SET @unit_live = GetNUnits ( UNIT , @unit , spg , "OK_ENGINE" , "NOT_EMPTY" , "OK_WEAPON" ) If ( @unit_live = 0 ) Then firemode ( UNIT , @unit , free ) halt EndIF If ( @element_of_array < @Array_len ) Then RunCommand ( Unit , @unit , STORM , point , @point_ofpath ) Else set @element_of_array = 0 runcommand ( unit , @unit , defend ) halt ENDIF label wait delay 20000 SET @unit_live = GetNUnits ( UNIT , @unit , spg , "OK_WEAPON" , "OK_ENGINE" , "NOT_EMPTY" ) If ( @unit_live = 0 ) Then firemode ( UNIT , @unit , free ) halt EndIF RunCommand ( Unit , @unit , STORM , point , @point_ofpath ) Set @Dist = Distance ( Unit , @unit , point , @point_ofpath ) If ( @Dist < 15 ) Then ADD ( @element_of_array , 1 ) goto begin Else goto wait ENDIF Halt /////////// In this trigger, the IA checks regularly the distance between the point and the vehicule. When the distance is lower than 15 meters, the IA uses the next point. you have to adapt it, replace spg by car, and storm by move. You have to launch this trigger for each vehicule with : delay 10000 Set @army = 3 Set @unit = 481 RunTriggerInstance ( "move_spg" , @unit , @unit , @path , @army ) delay 10000 Set @army = 3 Set @unit = 482 RunTriggerInstance ( "move_spg" , @unit , @unit , @path , @army ) and so on for each truck. Link to comment Share on other sites More sharing options...
JohnW Posted November 27, 2012 Share Posted November 27, 2012 Merci beaucoup Arzok! Link to comment Share on other sites More sharing options...
Recommended Posts