Home   Help Search Login Register  

Author Topic: Moving a unit after it leaves its group.  (Read 1009 times)

0 Members and 1 Guest are viewing this topic.

smiller

  • Guest
Moving a unit after it leaves its group.
« on: 26 Jul 2005, 18:51:40 »
G'day

An APC has left it's group but the editor doesn't know that so I can't give it it's own waypoint. How do I make it move to a position after it leaves it's group?

Sam
« Last Edit: 26 Jul 2005, 20:31:17 by bedges »

Dane

  • Guest
Re:Moving a unit after it leaves it's group.
« Reply #1 on: 26 Jul 2005, 18:56:57 »
You can use the "move" command: group this move getPos gamelogic, vehicle, loon or objectID or getMarkerPos "markername".

smiller

  • Guest
Re:Moving a unit after it leaves it's group.
« Reply #2 on: 26 Jul 2005, 19:01:18 »
Was that one big command? I'm a noob when it comes to scripting.

Sam

Dane

  • Guest
Re:Moving a unit after it leaves it's group.
« Reply #3 on: 26 Jul 2005, 19:04:16 »
group this move getPos gamelogic
group this move getPos vehicle
group this move getPos loon
group this move getPos objectID
group this move getPos getMarkerPos "markername"
 ::) ;)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Moving a unit after it leaves it's group.
« Reply #4 on: 26 Jul 2005, 19:05:53 »
easiest way would be to place a game logic - it's in the unit menu in the editor - give it a name, in the 'name field', and then use

Code: [Select]
group_name move getPos gamelogic_name
as dane has suggested.

smiller

  • Guest
Re:Moving a unit after it leaves it's group.
« Reply #5 on: 26 Jul 2005, 19:14:06 »
Sorry to keep asking bone questions, how do I trigger the gamelogic thing?

Dane

  • Guest
Re:Moving a unit after it leaves it's group.
« Reply #6 on: 26 Jul 2005, 19:19:20 »
No need to trigger it you find the gamelogic in the units meny like bedges said and place where you want on the map and give it name, and no need to be sorry we all had to start somewhere.

smiller

  • Guest
Re:Moving a unit after it leaves it's group.
« Reply #7 on: 26 Jul 2005, 19:21:53 »
What makes it head to the waypoint though? Or will it do this automatically once it leaves the group?

Sam

Dane

  • Guest
Re:Moving a unit after it leaves its group.
« Reply #8 on: 26 Jul 2005, 19:27:13 »
Once the loon has left the group give the loon a groupname (like this: groupname=unitname) in a trigger or script and after that simply write in script or a triggers activation field groupName move gamelogicName.
« Last Edit: 26 Jul 2005, 20:31:32 by bedges »

smiller

  • Guest
Re:Moving a unit after it leaves its group.
« Reply #9 on: 28 Jul 2005, 18:49:00 »
Loon?

So just clarify, I need to give the unit a new name once I use:
[A1] join grpNull
then {,} then change the groupname? Can't I just use A1 instead? Once that is done I put:
group_name move getPos gamelogic_name
in another trigger to send it to the gamelogic that I've set up.

Is that right?

Also, what have I got to do to switch off the enginein the APC once it reaches this point? I don't want it flailing around.

Thanks again guys,
Sam



Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Moving a unit after it leaves its group.
« Reply #10 on: 28 Jul 2005, 18:57:37 »
ok, here's the syntax for all of it:
Code: [Select]
[A1] join grpnull
group_A1 = group A1
group_A1 domove getpos game_logic
@A1 distance game_logic <= 1
A1 action ["engine off"]

then all you would do is have a game logic unit where you wanted A1 to move to, named game_logic
no waypoints need, just what i wrote ^

smiller

  • Guest
Re:Moving a unit after it leaves its group.
« Reply #11 on: 29 Jul 2005, 08:27:17 »
Score! He's moving to the game_logic (GL1) but the bugger won't switch his engine off, instead he just spins around.

Sam

Dane

  • Guest
Re:Moving a unit after it leaves its group.
« Reply #12 on: 29 Jul 2005, 09:37:11 »
Try it using a bigger distance like 10
@A1 distance game_logic <= 10

If A1 cant get to the exact spot for some reason he'll keep driving around.
If you want the loon to move to the exact spot make sure nothing is in the way.
« Last Edit: 29 Jul 2005, 09:47:37 by Dane »

smiller

  • Guest
Re:Moving a unit after it leaves its group.
« Reply #13 on: 29 Jul 2005, 09:53:15 »
Wahey!

Thanks Dane, for the recrod domove didn't work. It returned this.

Error domove: Type Group, expected Array, Object.

move got the job done.

Thaniks for your help everyone!