Skip to content

Author a Blueprint

Have an agent create an Actor Blueprint, give it a component, a variable and some event-graph logic, compile it and place it in the level.

Before you start

Prompt

Prompt
Create an Actor Blueprint at /Game/Hayba/BP_Lamp with a PointLight component named Light and a float variable Intensity that defaults to 5000. On BeginPlay, print "Lamp ready". Inspect the graph before you wire anything, compile it, and report any compile errors. Then place one BP_Lamp in the level at 0, 0, 200.

What the agent does

The order of calls is usually close to this. Each name links to its parameters.

  1. blueprint_create with the parent class /Script/Engine.Actor. Its package_path is the full asset path, including the name.
  2. blueprint_add_component adds the PointLight.
  3. blueprint_add_variable adds Intensity as a float with its default.
  4. blueprint_add_event adds the BeginPlay event, or returns the one already there.
  5. blueprint_add_node adds a call_function node for Print String and returns its exact pins.
  6. blueprint_inspect_graph lists node ids and pin names, so the wiring uses real names.
  7. blueprint_connect_nodes wires BeginPlay to Print String, and blueprint_set_pin_default sets the text.
  8. blueprint_compile applies the staged edits, saves, and returns any errors.
  9. actor_spawn_from_asset places the Blueprint in the level.

Things worth knowing:

Check the result