Jump to content
Sign in to follow this  
TrenchClub

How do I execute multiple instances of deletevehicle?

Recommended Posts

Figured instead of scripting markers to act as waypoints I'd just add a bunch of waypoints into a bird's nest and delete the ones which aren't relevant to the specific trigger being used by using the deletevehicle command.

But I can only use that once before I start getting weird error messages.

How do I set up a trigger to on act deletevehicle wp1, wp2, wp3, wp5 but not wp4?

Share this post


Link to post
Share on other sites

What I want are forked waypoints

But since for some stone dead retarded reason we're only ever able to chain waypoints in a sequential fashion my only alternative is to delete the parts of the bird's nest which aren't relevant to the trigger activated, or just straight up go for execvm thanksbohemia.sqf

http://i.imgur.com/Y6fTiHS.jpg (241 kB) (241 kB)

How do I get this working?

Share this post


Link to post
Share on other sites

well as the error msg says you are providing 3 elements and only 2 is expected:

1. the group name of the waypoint owner

2. the waypoint index which you like deleted

deleteWaypoint [groupName, index]

Maybe if you describe what you are trying to do mission wise we can help you better.

Share this post


Link to post
Share on other sites

I already did

I need a way to delete an assload (but not all) of a selected unit's waypoints as a workaround for the lack of triggered waypoint forks.

what is a waypoint index? the number of the waypoint in its sequence? Can there be more tha one number? How would that look like?

Share this post


Link to post
Share on other sites
what is a waypoint index? the number of the waypoint in its sequence? Can there be more tha one number? How would that look like?

index is the order of waypoints starting at 0 being where you're at now, 1 being your first uncompleted waypoint, and so-on. When you use addWaypoint, it returns a waypoint type, which is the form of [groupName, index], you can use that return in deleteWaypoint, you don't need to type out the array everytime. currentWaypoint returns the index of the currentWaypoint.

if you figure out which waypoints are which, index wise, rather than delete waypoints, you can have your onact skip waypoints to your next expected waypoint, and that waypoint does the same, so rather than delete w1,w2,w3,w5, setCurrentWaypoint to w4, and when completed, setCurrentWaypoint to w6

---

for general reference: Scripting Command Group - Waypoints [https://community.bistudio.com/wiki/Category:Command_Group:_Waypoints]

Edited by dr_strangepete

Share this post


Link to post
Share on other sites
what is a waypoint index? the number of the waypoint in its sequence?
Yes although it is not the same number you see in the add waypoint dialog in the editor ('waypoint order').

When a unit is placed in the editor it is automatically given an invisible waypoint at index 0 at its starting position.

When you add a waypoint in the editor the first one you add will say 0 in the dialog ('waypoint order') but its actual index in the units waypoints is 1.

For instance place the player down in the editor, add a waypoint (notice in the waypoint dialog it says waypoint order 0)

Preview and open the debug console...

In one of the watch lines type count waypoints player ... count will return 2.

waypointPosition (waypoints player select 0 ) is the same as the player starting position ( getpos player ).

Share this post


Link to post
Share on other sites

Example:

grp1 = group unitTarget; 
wp = grp1 addWaypoint [getMarkerPos "position1", 1]; 
wp = grp1 addWaypoint [getMarkerPos "position2", 2]; 
wp = grp1 addWaypoint [getMarkerPos "position3", 3]; 
grp1 setCurrentWaypoint [grp1, 1]; 
deleteWaypoint [grp1, 2];

Now unitTarget will move to marker "position1" then to "position3"

Share this post


Link to post
Share on other sites

trigger

activation independent

present

on act

deleteWaypoint [test1, 1, 2]

All I get is the same damn error.

I'm not using scripts to add waypoints (and would rather not) what I'm using is the editor, and the editor doesn't work with what you're giving me.

---------- Post added at 01:47 ---------- Previous post was at 01:35 ----------

Got it working with the setcurrentwaypoint command.

But why do units move before they have been activated by a trigger?

Share this post


Link to post
Share on other sites

Try this:

1. place yourself (player)

2. place a rifleman

3. put a "move" waypoint on rifleman (wp1)

4. put another "move" waypoint on rifleman (wp2)

5. put yet another "move" waypoint on rifleman (wp3)

6. put following in the riflemans init field: (group this) setCurrentWaypoint [group this, 1]; deleteWaypoint [group this, 2];

Now the rifleman should move from spawned position(editor placed position) to wp1 and then to wp3.

But why do units move before they have been activated by a trigger?

Because you placed the waypoints in the editor so they are executed upon mission start?

Also instead of deleting the waypoint just set another one active with setCurrentWaypoint.

If you describe exactly what you would like to do in your mission we might be able to help you with a proper solution.

Edited by JW Custom

Share this post


Link to post
Share on other sites

To make life easier on yourself so your not having to manage waypoint lists and to make editing easier try it like this.

Place your group that you want to follow a trail of waypoints.

Place another temporary unit (make sure its ungrouped) place a trail of waypoints. Name it wp1

Place another temporary unit (make sure its ungrouped) place a trail of waypoints. Name it wp2

In your original groups init field place this code

wps =[wp1, wp2] call bis_fnc_selectRandom;
(group this) copyWaypoints (group wps);
deleteVehicle wp1;
deleteVehicle wp2;

On loading the code will select a random unit between wp1 or wp2, it will then copy all the waypoints from the choosen unit to your actual unit. It will then delete both the temporary units wp1 and wp2.

wps_post.png

click for larger image

TEST MISSION multiple branching waypoints

Edited by Larrow
  • Like 2

Share this post


Link to post
Share on other sites

Neat solution but I don't think it fits my needs Larrow, unless you're able to waypoint something that isn't an AI controlled unit.

Doesn't work so well when it's the n'th fork in a chain.

Edited by TrenchClub

Share this post


Link to post
Share on other sites
unless you're able to waypoint something that isn't an AI controlled unit.
If its not AI/Logic then it has no waypoint ability as far as i know.
Doesn't work so well when it's the n'th fork in a chain.
Why (explain)? Did you try the test mission?

The first two AI are fine as they are deleted immediatley on mission start but any Nth chains need to have the AI hidden and disabled. Again check out the test mission.

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  

×