Forcing the camera to focus on a unit

Kael

Deity
Joined
May 6, 2002
Messages
17,403
Location
Paris, France
Anyone know how (through python) to force the selection, or the camera, on a unit? I have a bunch of units in a stack and I want it to display a different one than it is showing.
 
CyCamera().LookAtUnit(pUnit) perhaps?
 
snarko said:
CyCamera().LookAtUnit(pUnit) perhaps?

Thats gets the camera in the right place but doesn't pop the unit to the top. Any idea how to change the selection to a different unit through python?
 
CyInterface.selectUnit(CyUnit* pUnit, bool bClear, bool bToggle, bool bSound)

EDIT: There seems to be 2 APIs - I only just realised the other existed. I believe it's GBM's website. This one seems to have slightly more information than the other one, and is slightly more accurate as well, however I find the interface far worse. http://sthurlow.com/cvDocs/cvDoc/CyInterface.htm
 
The Great Apple said:
CyInterface.selectUnit(CyUnit* pUnit, bool bClear, bool bToggle, bool bSound)

EDIT: There seems to be 2 APIs - I only just realised the other existed. I believe it's GBM's website. This one seems to have slightly more information than the other one, and is slightly more accurate as well, however I find the interface far worse. http://sthurlow.com/cvDocs/cvDoc/CyInterface.htm

Note that I am presently using CyInterface.selectGroup(unit,false,false,false)

I'm going to find out for sure if it selects an entire group.

However, Kael, if you're looking to select a specific unit in a stack, regardless of it's group membership, use selectUnit.

I do not believe that these functions allow you to select a unit from a stack of enemies so you can target a specific one, however.
 
The Great Apple said:
CyInterface.selectUnit(CyUnit* pUnit, bool bClear, bool bToggle, bool bSound)

EDIT: There seems to be 2 APIs - I only just realised the other existed. I believe it's GBM's website. This one seems to have slightly more information than the other one, and is slightly more accurate as well, however I find the interface far worse. http://sthurlow.com/cvDocs/cvDoc/CyInterface.htm

I needed to use it as CyInterface().selectUnit(CyUnit* pUnit, bool bClear, bool bToggle, bool bSound) but it worked perfectly! Thanks!
 
Back
Top Bottom