Stranded Alien Dawn Mod Utility Helpers

Explore the extensive functions of Mod Utility Helpers in Stranded Alien Dawn. Our guide provides detailed insights into their features and functions!

In Stranded Alien Dawn, Mod utility helpers contain a lot of functions. Therefore, the mod description is not enough to explain all the details and functions. In this Stranded Alien Dawn Mod Utility Helpers guide, you will learn the functions you need in full detail!

This is the guide injto4ka it was created by. You can find the author’s link at the end of the guide.

Stranded Alien Dawn Mod Utility Helpers

As the mod utility helpers contain too many functions, the mod description is not enough to describe them. Therefore this Stranded Alien Dawn Mod Utility Helpers guide has been made.

Mod link: https://steamcommunity.com/sharedfiles/filedetails/?id=3018711913

Data Extractors

ExtractHierarchyInfo

  • function ExtractHierarchyInfo(obj)

Extracts available hierarchy information from the object, including attached objects (e.g., weapons, clothing, etc.), parent object (if attached), contained objects (e.g., a wall made of several wall slab objects), container object (if contained), and child objects (e.g., scavenge sites).

Arguments:

  • obj – The object to be extracted. (Optional, default value is the selected object).

ExtractEntityInfo

  • function ExtractEntityInfo(obj)

Extracts useful object entity data, including spots, states, and other entity-related information.

Arguments:

  • obj – The object to be extracted. (Optional, default value is the selected object).

ExtractMaterialInfo

  • function ExtractMaterialInfo(obj_or_material)

Extracts entity material information. This is a separate procedure due to potentially large data.

Arguments:

  • obj_or_material – The object to be extracted or the material name. (Optional, default value is the selected object).

ExtractClassInfo

  • function ExtractClassInfo(obj_or_classname)

Extracts class hierarchy information.

Arguments:

  • obj_or_classname – The object to be extracted or the class name. (Optional, default value is the selected object).

ExtractCommonAncestors

  • function ExtractCommonAncestors(objs)

Extracts common ancestor classes shared between multiple objects.

Arguments:

  • objs – Multiple objects. (Optional, default value is the selected objects).

GetObjectByHandle

  • function GetObjectByHandle(handle)

Get a reference to an object with the specified handle. Used to pass an object to functions expecting objects as arguments.

Arguments:

  • handle – A unique number used to identify an object.

ExtractTranslation

  • function ExtractTranslation(mod_title_or_id)

Searches for a mod with a given title or id and extracts the strings for translation from it. The tool is now officially supported.

Arguments:

  • mod_title_or_id – Mod title or id.

Debug

These functions are designed for debugging purposes and are invoked in the game console. They work by default with the selected object.

DbgAddText

  • function DbgAddText(text, pos_or_obj, color, font_face)

Places text on a specified map position.

Arguments:

  • text – Any value that can be converted to text.
  • pos_or_obj – A valid map position or map object.
  • color – Color in format ARGB. Default is white (0xFFFFFFFF).
  • font_face – The font name to use.

Test code on a selected object:

  • DbgAddText(SelectedObj.class, SelectedObj)

DbgAddPoly

  • function DbgAddPoly(poly, color)

Places a polyline connecting all provided points.

Arguments:

  • poly – A list of points or objects.
  • color – Color in format ARGB. Default is white (0xFFFFFFFF).

Test code on multiple selected objects:

  • DbgAddPoly(Selection, yellow)

Test code on a moving unit:

  • DbgAddPoly(SelectedObj:GetPath(), cyan)

DbgAddVector

  • function DbgAddVector(origin, vector, color)

Places a line in a vector direction.

Arguments:

  • origin – Where the vector is starting.
  • vector – Vector direction or a number indicating only a Z direction.
  • color – Color in format ARGB. Default is white (0xFFFFFFFF).

Test code on a moving unit:

luaCopy code

DbgAddVector(SelectedObj, SelectedObj:GetVelocityVector(), red)

DbgAddSegment

  • function DbgAddSegment(from, to, color)

Places a segment connecting two points.

Arguments:

  • from, to – Points.
  • color – Color in format ARGB. Default is white (0xFFFFFFFF).

Test code on a selected object:

  • DbgAddSegment(SelectedObj, GetTerrainCursor())

DbgAddTriangle

  • function DbgAddTriangle(pt0, pt1, pt2, color)

Places a triangle.

Arguments:

  • pt0, pt1, pt2 – Points.
  • color – Color in format ARGB. Default is white (0xFFFFFFFF).

DbgAddCircle

  • function DbgAddCircle(center, radius, color)

Places a circle.

Arguments:

  • center – Center position or object.
  • radius – Radius value.
  • color – Color in format ARGB. Default is white (0xFFFFFFFF).

Test code on a selected object:

  • DbgAddCircle(SelectedObj, SelectedObj:GetRadius(), green)

DbgAddSphere

luaCopy code

function DbgAddSphere(center, radius, color)

Places a sphere. Same as DbgAddCircle.

DbgAddBox

  • function DbgAddBox(box, color)

Places a box.

Arguments:

  • box – Box to show.
  • color – Color in format ARGB. Default is white (0xFFFFFFFF).

Test code on a selected object:

  • DbgAddBox(SelectedObj:GetObjectBBox(), blue)

DbgClear

  • function DbgClear(once)

Clears all placed debug visuals. Uses the Clear Screen shortcut (F9).

Arguments:

  • once – Clear only once per millisecond. Useful to avoid clearing visuals placed in a loop.

DbgSetVectorZTest

  • function DbgSetVectorZTest(enable)

Changes the Z test checks (occlusion) when drawing debug visuals.

Arguments:

  • enable – Boolean.

DbgBreak

  • function DbgBreak(value, silent)

Simulates a debug breakpoint. Stops the game, prints the argument, the call stack, and the local variables in the debug output. The execution will continue after unpausing the game. If not silent, displays a message on the screen with the contents of the argument.

Arguments:

  • value – Value to be displayed.
  • silent – No message on the screen.

Notes

  • Analyzing Data: These functions are invoked in the game console and work by default with the selected object. If the mod “Map Editor” is installed, it greatly enhances the readability of the output of the extractor functions. For example, type ~ExtractEntityInfo() to trigger the inspector and open an in-game UI window to inspect the extracted data.
  • Extracting Data from Child Objects: If the object of interest is a child object, it cannot be selected directly. Therefore, a handle is attributed to each object to obtain the
Written by injto4ka

Leave a Comment

Your email address will not be published. Required fields are marked *