Zriel 12 Posted February 25, 2015 Hi All I have trouble trying to move a single unit into a building. Specifically, the stadium building that overheads it, at [5440,15035,0]; This is the code I use: g_VIP = group st1_civ; g_VIP setFormation "FILE"; g_VIP setSpeedMode "LIMITED"; g_VIP setBehaviour "SAFE"; _building = nearestBuilding [5440,15035,0]; st1_civ doMove (_building buildingPos 1); st1_civ forceSpeed 1.5; waitUntil { (unitReady st1_civ) || (!alive st1_civ) }; if (alive st1_civ) then {doStop st1_civ;}; being "st1_civ" the name of the unit. I want it to enter the building and go up into the 1st floor. The position is just fine, tested, but the AI will dumbly walk into the wall endesly. Has anyone experiencied this issue? maybe the LOD of the building is bugged in this one? Thanks everyone Share this post Link to post Share on other sites
epicgoldenwarrior 11 Posted February 26, 2015 Have you tried just placing a unit in editor, and placing a waypoint on it, then picking position? If its selected a red square should appear. Share this post Link to post Share on other sites
Zriel 12 Posted February 26, 2015 Well, you are right. However, I'm not able to genereate a waypoint via scripting that is attached to the house so I can give a "setWaypointHousePosition". Share this post Link to post Share on other sites
epicgoldenwarrior 11 Posted February 26, 2015 Well, does it have to be scripted? I have to know so me/others can elaborate. Share this post Link to post Share on other sites
jshock 513 Posted February 26, 2015 See if taking out the forceSpeed line affects anything. Share this post Link to post Share on other sites
Larrow 2823 Posted February 26, 2015 Well, you are right. However, I'm not able to genereate a waypoint via scripting that is attached to the house so I can give a "setWaypointHousePosition". g_VIP = group st1_civ; g_VIP setFormation "FILE"; g_VIP setSpeedMode "LIMITED"; g_VIP setBehaviour "SAFE"; _building = ( getPosATL st1_civ ) nearestObject 1042600; _wp = g_vip addWaypoint [ getPosATL _building, 0 ]; _wp waypointAttachObject _building; _wp setWaypointHousePosition 5; st1_civ forceSpeed 1.5; waitUntil { currentWaypoint g_vip isEqualTo _wp }; if ( alive st1_civ ) then { doStop st1_civ; }; Tested with a civilian from the center of the stadium field. Will make him go to the tower and stand in front of the window over looking the field. Although the stadium pathing is not very good as the civilian will (instead of using the concrete stairs) walk straight up the seating area through the actual seats and barrier at the top :/ but he does get there. Share this post Link to post Share on other sites
Zriel 12 Posted February 26, 2015 g_VIP = group st1_civ; g_VIP setFormation "FILE"; g_VIP setSpeedMode "LIMITED"; g_VIP setBehaviour "SAFE"; _building = ( getPosATL st1_civ ) nearestObject 1042600; _wp = g_vip addWaypoint [ getPosATL _building, 0 ]; _wp waypointAttachObject _building; _wp setWaypointHousePosition 5; st1_civ forceSpeed 1.5; waitUntil { currentWaypoint g_vip isEqualTo _wp }; if ( alive st1_civ ) then { doStop st1_civ; }; Tested with a civilian from the center of the stadium field. Will make him go to the tower and stand in front of the window over looking the field. Although the stadium pathing is not very good as the civilian will (instead of using the concrete stairs) walk straight up the seating area through the actual seats and barrier at the top :/ but he does get there. Many thanks!! haven't tested yet, but I haven't used "waypointAttachObject" earlier, so that's probably the problem. Yeah, had to be scripted as is part of a convoy script which generates on the fly the vehicles and the civs, moves them to the stadium, makes them wait some time, then go away....at least I'm quite better and skilled doing scripts than doing things within the editor. Share this post Link to post Share on other sites