From the paradoxwikis Lua_function_list (not allowed to link it):
Let's say you have a scripted object, using
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