• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

unalpha

Recruit
11 Badges
May 16, 2020
1
0
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Age of Wonders III
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Prison Architect
  • Cities: Skylines - Campus
  • Prison Architect: Psych Ward
  • Island Bound
From the paradoxwikis Lua_function_list (not allowed to link it):


Code:
____________________________________________



Object.GetNearbyObjects

    Format:

    (1) Object.GetNearbyObjects( ObjectTable, TypeName, SearchDistance )

    (2) Object.GetNearbyObjects( ObjectName, TypeName, SearchDistance )

            - Use to get the "objectName" table

    (3) Object.GetNearbyObjects( TypeName, SearchDistance )

            - Used to on the "me" table

    (4) objectTable.GetNearbyObjects( TypeName, SearchDistance )

            

    Gets a table of all entities of type TypeName that are within SearchDistance of the calling object.

    In format 4, objectTable can refer to a return object's table or the "this" table (for the object the script is running

        on). For example, this.GetNearbyObjects( "Guard", 50.0 )

    

    ObjectTable/ObjectName:     Optional. The table/name of an Object. Defaults to the object the script is running on.

    TypeName:                   Required. The type of entity to search for.

    SearchDistance:             Required. The distance from this scripted object to search within.

    

    Returns:        A table of object tables and their distance to the calling object.

                    N.B. Both name and distance values will be returned as strings.

____________________________________________



Let's say you have a scripted object, using (4) objectTable.GetNearbyObjects( TypeName, SearchDistance ) will not fetch objects of TypeName.
 
Upvote 0