Jump to content
Sign in to follow this  
matjoa

What i'm doing wrong with setwppos?

Recommended Posts

If I'm right, the setWPPos is used to construct a Waypoint dinamically, isn't it?

I wrote that script activated by a trigger:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

patrol1 = group unit1

[unit2] join patrol1

[patrol1,0] setWPPos getpos gl1

[patrol1,1] setWPPos getpos gl2

<span id='postcolor'>

Where gl1 and gl2 are two GameLogic.

Well they join a group correctly but don't move to the first WP. They are there stopped and waiting I don't know what.

What is wrong in my script? or maybe I'm missing anything?

TIA

JF.

Share this post


Link to post
Share on other sites

You can't creat waypoints with setWPPos, you can only move them.

Why not use the domove command?

RED

Share this post


Link to post
Share on other sites

Thank you, I didn't know that.

So I have to use domove comand but I've found two doubts:

1. I need move a whole group, and this command is only for units. Do I need to use dofollow or foreach commands ?

2. Why the group setspeedmode "LIMITED" doesn't work when I use domove? On the other hand, It works using waypoints.

TIA.

JF.

Share this post


Link to post
Share on other sites

1. The domove command is for 1 unit. The move command is for a group.

2. Group setspeedmode "LIMITED" should work with the move command.

RED

Share this post


Link to post
Share on other sites

Thank you.

I've tried with the move command and it works.

JF.

Share this post


Link to post
Share on other sites

Use this instead of your original script:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">patrol1 = group unit1

[unit2] join patrol1

[patrol1,0] setWPPos getpos gl1<span id='postcolor'>

Place one WP close to gl1, make it one of the type 'HOLD'. In it's init.-field, put:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">[patrol1,0] setWPPos getpos gl2<span id='postcolor'>

You move around the same WP, which will never be finished because it's of the type 'HOLD' which never finishes.

I think this should work, haven't tested it.

Share this post


Link to post
Share on other sites

Thank you, but I think that the command move works and it is enough for my mission.

Only a question. If I put three move commands all in a row in a script:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

patrol1 move getpos gl1

patrol1 move getpos gl2

patrol1 move getpos gl3

<span id='postcolor'>

Where will "patrol1" go? are they going to pass one by one or just will they move to the last point?

In the command ref., for the move it says:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Description:

Creates waypoint move on given position (format Position) and makes it actual group waypoint.

<span id='postcolor'>

JF.

Share this post


Link to post
Share on other sites

I am almost 100% sure that they will just go to gl3, to make sure they only go to the next waypoint you can use the unitready command.

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

patrol1 move getpos gl1

@unitready (leader patrol1)

patrol1 move getpos gl2

@unitready (leader patrol1)

patrol1 move getpos gl3

<span id='postcolor'>

RED

Share this post


Link to post
Share on other sites

Thank you.

You are right. They went to the last point. With the @unitready command they go point by point like an editor WayPoint.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×