Page MenuHomeFeedback Tracker

wp waypointAttachObject objectId is not working
Need More Info, WishlistPublic

Description

According to supportInfo and the ingame help waypointAttachObject supports 2 syntaxes:
["b:ARRAY waypointattachobject SCALAR,OBJECT"]

The waypointAttachObject syntax which is using a Number (objectID) as the 2nd argument is not working - waypointAttachedObject returns a null-object (and a subsequent setWaypointHousePosition won't work, too).

Example:
on Stratis at the airport
wp = group player addWaypoint [[1907.5,5746.5,0.00144196],0];
wp waypointAttachObject 66220;
hint str (waypointAttachedObject wp);
hint shows Null-Object

But when using the alternative syntax (object as 2nd argument):
on Stratis at the airport
wp = group player addWaypoint [[1907.5,5746.5,0.00144196],0];
wp waypointAttachObject ((waypointPosition wp) nearestObject 66220);
hint str (waypointAttachedObject wp);
hint shows 23e27900# 66220: miloffices_v1_f.p3d

so
wp waypointAttachObject 66220
should just get evaluated as
wp waypointAttachObject ((waypointPosition wp) nearestObject 66220)

or if this syntax (Id as 2nd argument) isn't supported anymore the documentation/supportInfo/ingame help should get updated. {F23725}

Details

Legacy ID
1432803020
Severity
None
Resolution
Open
Reproducibility
Always
Category
Scripting
Steps To Reproduce
  1. create a waypoint
  2. use waypointAttachObject with an objectId as 2nd argument
  3. use waypointAttachedObject to check the attached object
Additional Information

Event Timeline

Master85 edited Additional Information. (Show Details)
Master85 set Category to Scripting.
Master85 set Reproducibility to Always.
Master85 set Severity to None.
Master85 set Resolution to Open.
Master85 set Legacy ID to 1432803020.May 7 2016, 6:25 PM
Master85 edited a custom field.

There's probably a similair issue with triggerAttachObject (#15750).
But there's no alternative syntax (object as 2nd argument) available.

Hello,
is the problem still valid for you? We recently made changes in objects' IDs.

still valid, tested with DEV 1.23.125330

Could you please provide a repro mission?

added a repro mission: waypointAttachObject_bug.Stratis.zip
wp is a waypoint.
use addactions to execute the 2 different syntaxes

  1. wp waypointAttachObject 66220
  2. wp waypointAttachObject ((waypointPosition wp) nearestObject 66220)

check the hint for the result of "waypointAttachedObject wp"

Maybe triggerAttachObject can be looked at as well while at it? same problem

EDIT: ah, just noticed Master85 mentioned it already :)

i can confirm the problem. and.....
after a closer look :)

for "_i" from 1 to 5 do {
_wpBInfo = _wpArray select (floor(random 4)); [[13425,2,debb6400# 202594: house_k_1_ep1.p3d],[ID,buildingposIndex,Object],...
_hausID = _wpBInfo select 0;
_wpBPos = _wpBInfo select 1;
_haus = _wpBInfo select 2;
_wp =_grp addWaypoint [(_haus buildingPos _wpBPos),_i];
_wp setWPPos (_haus buildingPos _wpBPos);
this is the essence!!!
_wp waypointAttachObject _hausID; try both
_wp waypointAttachObject ((_haus buildingPos _wpBPos) nearestObject (typeOf _haus));
last works first time for me.
_wp setWaypointHousePosition _wpBPos;
//_wp setWaypointCompletionRadius 3;
_wp setWaypointSpeed "LIMITED";
if (_i == TAC_Waypoints_group) then {

		_wp setwaypointtype "CYCLE";
				} else {
		_wp setWaypointType "MOVE";
					     };
			};

So the waypoints are (ZeusView) in center of the house, but the unit moves to the defined building position.

I am Happy now... ;)