Home   Help Search Login Register  

Author Topic: Positioning AI on balcony with setPosATL? OA  (Read 1859 times)

0 Members and 1 Guest are viewing this topic.

Offline Katrician

  • Members
  • *
Positioning AI on balcony with setPosATL? OA
« on: 21 Jul 2010, 16:44:27 »
Hello I have hard time positioning an AI at the balcony position, I tried first setPos and height with no luck; then I thought of the setPosATL but I needed an array of positions; so I used the exec.camera.sqs to get those numbers, I got myself to the balcony position and started camera, then copy/pasted the cam pos numbers to add them to the setPosATL line with no luck.

My question is what is the way to get those numbers/arrays used by setPosATL?, what would be the proper syntax for the setPosATL in the init box of the AI?

Quote
People do what they must.
rpm666 from Overclock.net

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re: Positioning AI on balcony with setPosATL? OA
« Reply #1 on: 22 Jul 2010, 00:05:19 »
Hey


So I guess the code:

Code: [Select]
this setPos [getpos this select 0, getpos this select 1, HeightToAdjust]
isn't working, then. If it's an enterable building, you could use:

Code: [Select]
this setpos (NearestBuilding BuildingPos IndexToFind) where IndexToFind is a number corresponding to one of the hard-coded pre-set building positions. It starts from 0 and can go up to 20+ depending on the type of building. Once you've retrieved the index, you can fine-tune the position since BuildingPos returns a 3D position.

If it's not an enterable building, then we'll have to enquire seriously why setPos isn't working.

Hope I got that right and it actually helps,
Igor.

Offline Katrician

  • Members
  • *
Re: Positioning AI on balcony with setPosATL? OA
« Reply #2 on: 23 Jul 2010, 14:10:22 »
Thanks Igor I did not understood your post yesterday, so today I came back and enabled my brain others cores  :P . If I understand correctly the Code would do that :

Code: [Select]
this setpos (NearestBuilding BuildingPos 10)

10 for position ten, so I just have to order an AI into a building position, that's when the choice pop up and a position label show up; that I choose which position suits me best. I will try it and report.


Later....

Ok Igor your code did not work....so I persisted with setPosASL and found what was wrong, the camera.sqs retrieve the two axis but give not the correct height, so I took the height from a BIS placed unit and put it in my unit and it worked fine.

So I think it is possible to have a script to automate things a bit, it could be based on camera.sqs as adding height in ASL (AS Sea Level), then to copy/past it to clipboard.


The advantage is not guessing AI height while positioning it in building neither others axis in 3D, as I tried the "getpos" method AI kept falling on ground, or was limited to house predetermined house position. You position yourself where exactly you expect AI to stand etc...

So if coders could make this tool this would be great, as I don't got knowledge  :whistle:
« Last Edit: 23 Jul 2010, 15:40:47 by Katrician »
Quote
People do what they must.
rpm666 from Overclock.net

Offline Pirin

  • Members
  • *
Re: Positioning AI on balcony with setPosATL? OA
« Reply #3 on: 25 Jul 2010, 10:56:19 »
Igor was just missing some ()  This works:

Code: [Select]
this setPos ((nearestBuilding this) buildingPos 10)
You can use the Virtual House Position Module to easily check where each position in a building is.

« Last Edit: 25 Jul 2010, 11:00:53 by Pirin »