Jump to content
Sign in to follow this  
1para{god-father}

Scripted WP issue not working

Recommended Posts

Having an issue with creating a WP , not sure where i am going wrong ?

	_wptest1 = _grp1 addWaypoint [12604.7,9837.15,0.214798] ;
	_wptest1 setWaypointType "MOVE";
	_wptest1 setwaypointBehaviour "COMBAT";
	_wptest1 setwaypointcombatmode "RED" ;
	_wptest1 setWaypointSpeed "NORMAL" ;

Share this post


Link to post
Share on other sites

addWaypoint needs a position and a placement radius.

_wptest1 = _grp1 addWaypoint [[12604.7,9837.15,0.214798],10] ;

Share this post


Link to post
Share on other sites

Dear Psvialli,

ok, as far as I see it you did a mistake in the addWaypoint command. Try this:

_wptest1 = _grp1 addWaypoint [[12604.7,9837.15,0.214798], 0];

followed by the rest above.

The mistake you made is, that the arguments for the command is an array of things. You just gave a position, but the command expects am array including a position. You understand ? The 0 as the second parameter is the index for the waypoint. So you could add a waypoint also in between other existing waypoints. The zero (0) means, that this is the first waypoint in the queue which the unit has to go to. Please try and tell me if you succeded.

Here is the link to the docs in case you don't know:

http://community.bistudio.com/wiki/addWaypoint

Kind Regards and good luck !

Benbone

Share this post


Link to post
Share on other sites
That done the Job - thanks !

OK another question !

I would like VIP5 to move to his first WP then wait 60 sec then get in the car and then drive away really having issues with this he does not seem to want to do anything i am doing !?

_grp1 = createGroup RESISTANCE; 
_grp1 = group vip5; 

_wptest1 = _grp1 addWaypoint [[12604.9,9836.98,0.202789],1] ;   // move to house at this location
	_wptest1 setWaypointHousePosition 1
	_wptest1 setWaypointType "MOVE";
	_wptest1 setwaypointBehaviour "SAFE";
	_wptest1 setwaypointcombatmode "BLUE" ;
	_wptest1 setWaypointSpeed "NORMAL" ;

	sleep 60 ;
	_wptest2 = _grp1 addWaypoint [[12642.6,9832.73,0.00143433],1] ;  // get in car car is called _veh1
	_wptest2 setWaypointType "GETIN";
	_wptest2 setwaypointBehaviour "SAFE";
	_wptest2 setwaypointcombatmode "BLUE" ;
	_wptest2 setWaypointSpeed "NORMAL" ;


	_wptest3 = _grp1 addWaypoint [[12956.5,14289.9,0.00146484],1] ;  // move car to location
	_wptest3 setWaypointType "MOVE";
	_wptest3 setwaypointBehaviour "SAFE";
	_wptest3 setwaypointcombatmode "BLUE" ;
	_wptest3 setWaypointSpeed "NORMAL" ;

Share this post


Link to post
Share on other sites

_grp1 = createGroup RESISTANCE; 
_grp1 = group vip5; 

This doesn't assign vip5 to _grp1.

[vip5] join _grp1;

does.

Share this post


Link to post
Share on other sites

Ahhhh no wonder he does not move :)

Many thanks ill give that a go now !

---------- Post added at 04:56 PM ---------- Previous post was at 02:58 PM ----------

He still does not really do it - is it because he is a civilian ? - he just runs around then lye's down on the ground then stands back up bit does not go into the house nor board the car ?

Any suggestions ? - i put group as CIVILIAN but still no joy

	_destland = [12642.6,9832.73,0.00143433];
       _grp1 = createGroup CIVILIAN; 
       [vip5] join _grp1;

	///move VIP to house/////

	_wptest1 = 	_grp1 addWaypoint [[12604.9,9836.98,0.202789],1] ;  
	_wptest1 setWaypointHousePosition 1;
	_wptest1 setWaypointType "MOVE";
	_wptest1 setwaypointBehaviour "SAFE";
	_wptest1 setwaypointcombatmode "BLUE" ;
	_wptest1 setWaypointSpeed "NORMAL" ;

               ///move to car

	_wptest2 = 	_grp1 addWaypoint [[12642.6,9832.73,0.00143433],1] ;  
	_wptest2 setWaypointType "GETIN";
	_wptest2 setwaypointBehaviour "SAFE";
	_wptest2 setwaypointcombatmode "BLUE" ;
	_wptest2 setWaypointSpeed "NORMAL" ;

	////move car to wp
	_wptest3 = 	_grp1 addWaypoint [[12956.5,14289.9,0.00146484],1] ;  
	_wptest3 setWaypointType "MOVE";
	_wptest3 setwaypointBehaviour "SAFE";
	_wptest3 setwaypointcombatmode "BLUE" ;
	_wptest3 setWaypointSpeed "NORMAL" ;

Edited by psvialli
added full code

Share this post


Link to post
Share on other sites

Let's do it without waypoints :

vip5 setbehaviour "SAFE";
vip5 domove [12604.9,9836.98,0.202789];
sleep 60 ;
vip5 assignAsDriver name_of_the_vehicle;
[vip5] orderGetIn true;
@unitready vip5;
vip5 domove [12956.5,14289.9,0.00146484];

Edited by ProfTournesol

Share this post


Link to post
Share on other sites
Let's do it without waypoints :

vip5 setbehaviour "SAFE";
vip5 domove [12604.9,9836.98,0.202789];
sleep 60 ;
vip5 assignAsDriver name_of_the_vehicle
[vip5] orderGetIn true
@unitready vip5
vip5 domove [12956.5,14289.9,0.00146484];

LOL it must be me as that does not work ? also as soon as the guy sees me he hits the ground !

Share this post


Link to post
Share on other sites
Let's do it without waypoints :

vip5 setbehaviour "SAFE";
vip5 domove [12604.9,9836.98,0.202789];
sleep 60 ;
vip5 assignAsDriver name_of_the_vehicle;
[vip5] orderGetIn true;
@unitready vip5;
vip5 domove [12956.5,14289.9,0.00146484];

This won't work because of @unitready. That's .sqs code. Try waitUntil {unitready vip5};

Share this post


Link to post
Share on other sites
This won't work because of @unitready. That's .sqs code. Try waitUntil {unitready vip5};

OK getting a little further now, if I watch from far away it works , but if i am near the guy he just stops and watches me ?

never thought it would be this hard to get a man to walk to a house then get in a car and drive away via script :(

Share this post


Link to post
Share on other sites

I feel your pain!. I have been there too! ... and seems that I'm there again... now! The civilians have a mind of their own. Lol!.... they seem to get a bit confused when there's men with guns around.

I've been trying to get him to move once he is in the car and it's really quite bizarre... some commands simply don't seem to work anymore. I am using the latest beta.

Unless I'm terribly misguided or have missed some change to the way things work.... doMove, moveTo and commandMove now seem useless!!!??? They certainly are useless here!

Here is the code for the little test I did....as well as a demo mission here!

test.sqf:-

_man = _this select 0;
_veh = _this select 1;
_mkr = _this select 2;

_man setbehaviour "CARELESS";

_man domove position _veh;

waituntil {unitready _man};

_man assignAsDriver _veh;

[_man] orderGetIn true;

waituntil {vehicle _man != _man};
//waituntil {unitready _man};

hint "man in vehicle";

//*** all of these don't work anymore????? *****
//_man domove (getmarkerpos _mkr);
//_man moveto (getmarkerpos _mkr);
//_man commandmove (getmarkerpos _mkr);

//giving a waypoint to _man's group works fine
group _man addWayPoint [getmarkerpos _mkr,10];

Call it with:-

nul = [man,vehicle,marker_to_move_to] execVM "test.sqf";

All quite strange... really!

EDIT: I see there's a ticket for some sort of bug with domove etc. https://dev-heaven.net/issues/28311

Edited by twirly
Added stuff

Share this post


Link to post
Share on other sites

Domove and CommandMove work but you need to issue the command after the Civ has entered the vehicle and it needs a slight delay or it seems to miss the command.

waituntil {vehicle _man != _man};
sleep 1;

_man domove (getmarkerpos _mkr);
_man commandmove (getmarkerpos _mkr);

Share this post


Link to post
Share on other sites
Domove and CommandMove work but you need to issue the command after the Civ has entered the vehicle and it needs a slight delay or it seems to miss the command.

waituntil {vehicle _man != _man};
sleep 1;

_man domove (getmarkerpos _mkr);
_man commandmove (getmarkerpos _mkr);

You are dead right.... doMove works now with the sleep. Hmmmm! Cheers for that.

Share this post


Link to post
Share on other sites
You are dead right.... doMove works now with the sleep. Hmmmm! Cheers for that.

Thanks guys for all your efforts in this it is now working! :yay:

Those pesky civilians!

Share this post


Link to post
Share on other sites
This won't work because of @unitready. That's .sqs code. Try waitUntil {unitready vip5};

Damn sqf :pet1:

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  

×