No announcement yet.

Avgani, OPX buildings and nearestBuilding

  • Filter
  • Time
  • Show
Clear All
new posts

  • Avgani, OPX buildings and nearestBuilding

    So -

    Basically, I have a script to loop through a group and randomly place them in building positions.

    Problems however -

    1. nearestBuilding only looks for class "house", which are only vanilla buildings

    2. The glorious makers of OPX Buildings seem so kind as to NOT put all buildings with positions them all in an overarching class name; so nearestObject /w classname is useless.

    So - I've resorted to using nearestObject with the actual ObjectID of the buildings. This works.

    My question -
    is there a method in script to get the ID of an object? Or ANY easy way?

    Right now I have to get the ID as follows -
    1. Create a MOVE waypoint on the building and specify a position and unique name
    2. Save the mission
    3. Alt+tab out
    4. Open mission.sqm
    5. Find the waypoint and staticId is the ID of the building
    6. NOW I can call nearestObject with that hardcoded ID and setPos into it

    ideally, I'd like to do this via script - I want my UrbanPatrol script to allow them to take cover in OPX buildings when heavily engaged. Right now, my only idea is to manually make an array of ALL buildingID's in the town, and call nearestObject on the array (find closest). This array tho would take hours to make.

    Task Force Proteus

    The very existence of flamethrowers proves that sometime, somewhere, someone said to themselves, You know, I want to set those people over there on fire, but Im just not close enough to get the job done."

  • #2
    Re: Avgani, OPX buildings and nearestBuilding

    Show ID button in the editor? Might work.




    TeamSpeak 3 Server




    Twitter Feed