Home   Help Search Login Register  

Author Topic: change the location of a waypoint  (Read 748 times)

0 Members and 2 Guests are viewing this topic.

tOzzY

  • Guest
change the location of a waypoint
« on: 17 Nov 2003, 21:31:48 »
Hi there,
I want to make a medic run to the player when he executes a radiocommand.

The medic is near and halted by a waypoint synchronised to the radiocommand trigger. He has a second waypoint and I want this waypoint to move to the position of the player, as he calls for help.

I tried playing around with the getPos and setPos commands, but then I found that waypoints can't be named (in the editor) so you can't say:

Code: [Select]
wp setPos[(getpos aP select 0), (getpos aP select 1), (getpos aP select 2)]
Now does anyone know how to do this, or maybe work around the waypoint idea.
I searched actions and such, but they only include 'heal at medic', but not something like 'move to soldier'. I also searched other peeps scripts, but that only helped me find out how the setPos and getPos stuff works..

please, can someone help me out?
.tOzz


m21man

  • Guest
Re:change the location of a waypoint
« Reply #1 on: 17 Nov 2003, 23:31:45 »
The command for setting a waypoint's position is:

Quote
[group,#] setwppos [2DPos]
group - The group that this waypoint affects.
# - Numerical position of this waypoint in a list of all the waypoints used by the waypoint's group.

2DPos is a position in [x,y] format.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:change the location of a waypoint
« Reply #2 on: 17 Nov 2003, 23:41:32 »
Won't a Support Trigger work for this type of thing?


Planck
I know a little about a lot, and a lot about a little.

tOzzY

  • Guest
Re:change the location of a waypoint
« Reply #3 on: 22 Nov 2003, 18:35:08 »
what's a support trigger???

Thanks m21man, I get the idea, but I think I'm still doing something wrong.

I have the player (aP) and the medic (medGuy)
a trigger is activated by the player, which is synced to medGuys' first WP (index 0) this WP is placed directly on the start position of medGuy.

The second WP of medGuy (index 1) is just placed somwhere on the map.

Now, in the 'on activation' field of the trigger i've put:
Code: [Select]
[meds,1] setWPPos [getPos aP select 0, getPos aP select 1]
medGuy moves, but only towards the original position of WP 2 (index 1).

How can I fix this??
.tOzzY

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:change the location of a waypoint
« Reply #4 on: 22 Nov 2003, 19:16:10 »
Sorry, a typo, what I meant of course is a:

Support Waypoint

If your medic has a vehicle, even better.

Give him a Support waypoint and he should wait there till called on for support.


Planck
I know a little about a lot, and a lot about a little.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:change the location of a waypoint
« Reply #5 on: 22 Nov 2003, 23:22:07 »
Planck is right, a support waypoint is a better way of accomplishing what you want to achieve.    

As for your script, two points.    Firstly, in this case you don't need to split out the components of aP's position.   It's more elegant to write:-

setWPPos getPos aP

which conveys the same information in less code.    

Secondly, I suspect that what is happening is that when the switch trigger is fired the medic moves towards his new waypoint position.     The waypoint is not being moved until after he has started out, and presumably when the setWPPos command is used a group heading towards the old position do not change direction.    
Plenty of reviewed ArmA missions for you to play

8 Ball

  • Guest
Re:change the location of a waypoint
« Reply #6 on: 23 Nov 2003, 09:35:42 »
The problem your having is with the indexing of your waypoints.

[meds,1] setWPPos getPos aP

should actually be

[meds,2] setWPPos getPos aP

The 1 in the code string should be a 2
This is because the starting position of the unit is considered to be the first waypoint of the unit and has an index of 0.

So the first waypoint you put on the map for that unit would be index 1, the second waypoint index 2, and so on.

So all you have to do is change the 1 to a 2, and it should work.

tOzzY

  • Guest
Re:change the location of a waypoint
« Reply #7 on: 24 Nov 2003, 20:27:13 »
Yeah, the support waypoint worked.... gees... sometimes things are so straight forward, you just overlook them.. Thanks lads!

By the way, I still didn't get waypoints to move, but I'll keep trying.  ;)

.tOzz