Jump to content
Sign in to follow this  
RazorX

How to make a person go to a precise location

Recommended Posts

This one's a bit annoying.

I want a person to go to a precise location [x,y] (I've tried already by using DoMove, MoveTo, CommandMove), but the person always stops about a meter away from that position. How can I fix that (except teleporting him to that position).

Share this post


Link to post
Share on other sites

Are you sure? doMove seems to be pretty dead on (different AI sent to the same location seem to stand "on top" of eachother, aka "inside" eachother). Have you tried using [x,y,z] instead of just [x,y] maybe?

Share this post


Link to post
Share on other sites

I want the unit to go to a building's door, and then it will disappear, but the problem is that it disappears a meter or sometimes two away from the door. I'm using the GetMarkerPos to get coords and UnitReady to check wheter the unit has stopped, and the marker is set very precisely.

Edited by RazorX

Share this post


Link to post
Share on other sites

What about just "move" him where you want? in conjunction with buildingPos

this move (building buildingPos 1)

Edited by =Odin=
include example

Share this post


Link to post
Share on other sites

He said he wants the person to disappear when he reaches that position, so apparently it's something a player might be looking at.

Share this post


Link to post
Share on other sites

Well he could either just

DeleteVehicle unitname;

or

unitname setPos (getPos SomeobjectFarAway);

Both ways work in that fashion just deleteVehicle means he is gone forever

Sorry just saw you don't want them teleported.

Edited by =Odin=
Read the post a bit better

Share this post


Link to post
Share on other sites

He also doesn't seem to have any problem deleting him, the problem is to delete him right when he reaches the exact location. Imagine the door as a portal, and you want to simulate the guy going through the portal. What currently happens is that he walks towards the portal and then stops 1-2 meters before it and then gets deleted (because the script deletes him as soon as he reaches his destination, which was supposed to be the portal).

Share this post


Link to post
Share on other sites

i imagine the door way location is just a few meters off most the time, you might have to adjust the cords a few meters to make them get to the door. shouldnt be hard, just change the x or y by one or two and it should be fine, well hopefully lol

Share this post


Link to post
Share on other sites

In ALICE civs can move right to the door, then there's entering animation and poof... they disappear. When I tell them to move to the door by doMove to the marker, they stop. The position where they stop seems to be the bounding box of the building model. Maybe I have to move them to the indexed building position (buildingPos)? I'll try it and see the result.

Edited by RazorX

Share this post


Link to post
Share on other sites

Color me not clear on what you are doing, but, if everything is working exactly as you want except for the unit disappearing 1 meter too soon, then have you tried moving the marker 1 meter further back away from where you want him to disappear? I am assuming you are using the maker as his point to disappear? Also, have you tried a trigger, too, or, a trigger instead of a marker?

Share this post


Link to post
Share on other sites

When I move the marker more "inside" the building the unit stops when reaching the marker's nearest position adjecent to (I think it is) the bounding box of the building model. There are no indexed positions of non enterable buildings so I can't use them either.

The question is how ALICE's civs can move right to the door and mine can't? There's no problem with spawning them at the door, but returning there seems to be much more problematic.

Found it!

ALICE creates an empty vehicle called "BIS_alice_emptydoor". When created in game on the position of a marker, the unit must be assigned as cargo to it and ordered to get in. The unit then walks to the door end enters the vehicle right where I want it to enter :D

Edited by RazorX

Share this post


Link to post
Share on other sites

Thanks for sharing your discovery, I've run into the bounding box myself with AI movement, never found a good solution. I will try the ALICE empty door next time :)

Share this post


Link to post
Share on other sites

Old thread, but relevant!

Glad to see you got this working for buildings. On things like vehicles, try using:

_annoyingObject enableSimulation false;

on the object in question and your unit will ignore the bounding box and move precisely where he needs to go.

I had this problem with helicopters. Their bounding box is massive (due to the blades) and if you order a unit to it like:

_unit doMove getPos _chopper;

or

_unit doMove (_chopper modelToWorld [ -3 ,0 ,0 ]);

they will go to the North East (relative to chopper direction) corner of the bounding box.

Using

_chopper enableSimulation false;

allows you to specify positions within the bounding box for your units to go to :)

Share this post


Link to post
Share on other sites

I never new that thanks, but it set me thinking as enableSimulation false; stops the roters ect.

I tried using attachto but that didn't help then I remembered we now have a new command in betas and 1.60

 unitname disableAI "FSM";

it works perfectly.

just place it in the soldiers init box or in a waypoint close to the vehicle.

Share this post


Link to post
Share on other sites

Good find!

I'm having trouble making this work though. I've tried putting it in the init fields of troops in my squad and I don't notice any difference.

Eg:

this disableAI "FSM";

I thought it might have something to do with the units being in the players squad, so I also tried it with units in an AI only squad, but they still stay in formation and move around bounding boxes.

I'm running 1.60.86882 if that helps. Any ideas where I'm going wrong?

Share this post


Link to post
Share on other sites

As always BIS giveth with one hand and take away with the other, it seems that when the engines are running it overrides the FSM.

I was only trying it with engines off as there was too much dust, units will move to the chopper when the engines are off anyway, using disableAi "FSM" only seems to make the leader remain there.

I've also just noticed that chopper enableSimulation false; only seems to work at removing the bounding box when it's placed in the units init, in a trigger it has no effect and units walk to the outer edge of the box.

Edited by F2k Sel

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  

×