Home   Help Search Login Register  

Author Topic: Synchronization combined with setwppos command(RESOLVED)  (Read 1189 times)

0 Members and 1 Guest are viewing this topic.

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Haven't seen a mention of this yet in the search feature. Here is my scenario...

Placed an empty truck
Placed a single unit next to it and then moved it into the driver seat. The single unit has waypoints stretched out in front of it...Move(which is activated by a variable).....transport unload and getout.
I have also placed another single unit, given it a group name, given it waypoints and deleted it in its init. I then createunits from it later and move them into the trucks cargo hold during creation. Then the truck is setpositioned elsewhere, and ordered to follow its waypoints. The getout waypoint and the transport unload waypoints are synched together but the truck drives to the transport unload waypoint but the created units never get out. I have tried the unload waypoint...unsynching them and using variables to activate each waypoint but nothing seems to happen.

Does syncronization work with created units and setwppos?
« Last Edit: 04 Aug 2009, 05:29:55 by savedbygrace »

Walter_E_Kurtz

  • Guest
Re: Synchronization combined with setwppos command
« Reply #1 on: 04 Aug 2009, 02:49:21 »
Quote
... and deleted it in its init. I then createunits from it later ...
I don't think you can delete units intended as spawn points because the created units need somewhere to be born.

Keep the spawn point unit and createVehicle the other units into its group. First, test that all the waypoints work with just the spawn point unit.

Give that unit a name, eg. spawn1, and the truck also, then the script might be something like:
Code: [Select]
_type = ["OfficerWNight", "SoldierWG", "SoldierWLAW", "SoldierWLAW", "SoldierWLAW", "SoldierWMG", "SoldierWMedic", "SoldierWG", "SoldierWG", "SoldierWMG", "SoldierWAA"]

_numbr = 0
#start
(_type select _numbr) createUnit [ getpos spawn1, group spawn1, (init line), (skill), "PRIVATE" ]
~0.1
? (_i == 10): goto "out"
_numbr = _numbr + 1
goto "start"

#out
team1 = group spawn1
"_x assignAsCargo truck1" forEach team1
"_x moveInCargo truck1" forEach team1

exit
Make use of the (init line) and (skill) if you need to. "PRIVATE" is the rank for the new unit.

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Synchronization combined with setwppos command
« Reply #2 on: 04 Aug 2009, 05:25:39 »
Hey! Thanks for the interest Walter.
Actually, you can delete the unit in "his" init. Once you place the unit and the mission starts, it creates the group and when the unit is deleted, the groupname remains behind for further use. The spawnmarker is the actual unmoveable spawn point.

As you place the unit, you also give it waypoints and once you add a group name, the waypoints become inherit to future spawned units in the group. This all works great as all future units are created as ordered, setpositioned where needed and then they proceed along the existing but newly setpositioned waypoints as normal.

The problem that I think I was encountering, was that after placing the waypoints, I synchronized them with an existing trigger to be used later. Once I moved the position of the waypoints, I believe it may have broken the synchronization so that neither the transport or the units inside would ackowledge the arrival to the waypoint position thus concluding in a card game within the cargo hold of the truck.  :D

So to overcome this problem, I removed all unload and getout waypoints from both parties involved, then in the vehicles waypoint that was originally purposed for unloading I added a group action to get out and then unassigned them. I also placed a 5 second delay in that waypoint so that the truck was at a complete stop before they would dismount...the trucks next waypoint was delayed a further 10 seconds to allow the cargo time to get out before he takes off thus preventing uncertain accidents.

So, I think this topic is resolved as my theory of setwppos command and synchronization just does not work together and can be concluded.

Thanks again for your reply.