.agents/skills/galaxy-points-regions-geometry/SKILL.md
Points, regions, geometry, pathfinding, and map coordinate helpers in Galaxy script. Use when working with point creation, distance calculations, offsets, region checks, PointWithOffset, PointWithPolarProjection, region creation, or testing if a unit or point is inside a region.
npx skillsauth add KimPlaybit/Ultrasikism galaxy-points-regions-geometryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Resource | URL | |---|---| | Native function reference | https://mapster.talv.space/galaxy/reference | | Galaxy syntax definition | https://github.com/Talv/vscode-sc2-galaxy/blob/master/syntaxes/galaxy.json | | SC2-IngameDevTools (PRIMARY — #1 codebase) | https://github.com/abrahamYG/SC2-IngameDevTools/tree/main/DevToolsIngame.SC2Mod/Script | | SSF codebase (secondary style) | https://github.com/Cristall/SC2-SwarmSpecialForces/tree/main/SwarmSpecialForces.SC2Map/scripts | | SC2 editor guides | https://s2editor-guides.readthedocs.io | | SC2Mapster wiki | https://sc2mapster.wiki.gg/ |
A point is a 2D (or 3D with height) map coordinate.
point lv_p = Point(16.5, 32.0); // x, y
point lv_p3 = libNtve_gf_PointFromXYZ(16.5, 32.0, 4.0); // x, y, z
// Named point from map (placed in editor)
point lv_named = PointFromName("StartLocation1");
// Move a point in place
PointSet(lv_p, 20.0, 40.0);
// Set facing angle on a point
PointSetFacing(lv_p, 90.0);
// Set height
PointSetHeight(lv_p, 2.0);
fixed lv_x = PointGetX(lv_p);
fixed lv_y = PointGetY(lv_p);
fixed lv_facing = PointGetFacing(lv_p);
fixed lv_height = PointGetHeight(lv_p);
fixed lv_dist = DistanceBetweenPoints(lv_a, lv_b);
fixed lv_angle = AngleBetweenPoints(lv_a, lv_b); // degrees, from lv_a toward lv_b
// Create new point offset by x/y
point lv_offset = PointWithOffset(lv_origin, lv_dx, lv_dy);
// Move in a direction (polar)
point lv_ahead = PointWithOffsetPolar(lv_origin, lv_distance, lv_angleDegrees);
// Step from A toward B by a distance
point lv_step = libNtve_gf_PointOffsetTowardsPoint(lv_a, lv_b, lv_dist);
// Add Z offset (above terrain)
point lv_above = libNtve_gf_PointWithZOffset(lv_p, 2.5);
// Point at the facing angle of another point
point lv_front = libNtve_gf_PointFacingAngle(lv_p, lv_range);
fixed lv_h = WorldHeight(lv_p); // terrain height
string lv_tex = TerrainTexture(lv_p); // terrain texture id
int lv_cliff = CliffLevel(lv_p); // cliff height level (int)
fixed lv_cliff2 = PointPathingCliffLevel(lv_p); // cliff level (fixed)
bool lv_pass = PointPathingPassable(lv_p); // is ground passable?
bool lv_conn = PointPathingIsConnected(lv_a, lv_b); // are pts connected?
int lv_cost = PointPathingCost(lv_a, lv_b); // pathing cost
A region is an area shape (rectangle, circle, polygon) that can be placed in the editor or created in code.
region lv_all = RegionEntireMap(); // the whole map
region lv_play = RegionPlayableMap(); // playable area only
region lv_emp = RegionEmpty(); // zero-size region
region lv_named = RegionFromName("MySpawnRegion");
// Rectangle (from two corners)
region lv_rect = RegionRect(lv_minPt, lv_maxPt);
// Circle
region lv_circle = RegionCircle(lv_center, 8.0);
// Add/subtract regions
RegionAdd(lv_dest, lv_addRegion);
RegionRemove(lv_dest, lv_removeRegion);
point lv_center = RegionGetCenter(lv_region);
point lv_min = RegionGetBoundsMin(lv_region);
point lv_max = RegionGetBoundsMax(lv_region);
fixed lv_width = PointGetX(lv_max) - PointGetX(lv_min);
fixed lv_height = libNtve_gf_HeightOfRegion(lv_region);
bool lv_in = RegionContainsPoint(lv_region, lv_point);
point lv_rand = RegionRandomPoint(lv_region);
// Fire when a unit enters or leaves
TriggerAddEventUnitRegion(myTrigger, null, lv_region, true); // enter
TriggerAddEventUnitRegion(myTrigger, null, lv_region, false); // leave
// Inside handler
unit lv_ent = EventUnit();
region lv_reg = EventUnitRegion(); // which region triggered
// Does a line cross a cliff edge?
bool lv_cross = CrossCliff(lv_from, lv_to);
// Pathing type constants (returned by PathingType)
c_pathingTypeAny
c_pathingTypeGround
c_pathingTypeAir
c_pathingTypeWalkable
// Reveal area for a player (removes FoW)
VisRevealArea(lv_player, lv_region, 0.0, false);
// Explore (permanent reveal without sight)
VisExploreArea(lv_player, lv_region, true, false);
// Check if a point is currently visible
bool lv_vis = VisIsVisibleForPlayer(lv_player, lv_point);
// Enable/disable FoW
VisEnable(lv_player, false); // disable fog of war for player
// FoW alpha (0 = fully transparent)
VisSetFoWAlpha(0.5);
VisResetFoWAlpha();
// Revealer (persistent vision source at a point)
VisRevealerCreate(lv_player, lv_point, 12.0);
revealer lv_rev = VisRevealerLastCreated();
VisRevealerEnable(lv_rev, true); // enable/disable without destroying
VisRevealerDestroy(lv_rev);
// Check if Zerg creep is present at a point
bool lv_hasCreep = CreepIsPresent(lv_point);
// Add or remove creep in a radius
CreepModify(lv_point, 5.0, true, false); // add creep (spread = false)
CreepModify(lv_point, 5.0, false, false); // remove creep
PingCreate(PlayerGroupAll(), lv_point, 5.0, ColorWithAlpha(1.0, 0.0, 0.0, 1.0), "");
ping lv_ping = PingLastCreated();
PingSetDuration(lv_ping, 8.0);
PingDestroy(lv_ping);
PingDestroyAll();
Display floating text above a map location:
TextTagCreate();
int lv_tag = TextTagLastCreated();
TextTagSetText(lv_tag, StringToText("+50"), 14, false, PlayerGroupAll());
TextTagSetColor(lv_tag, ColorWithAlpha(1.0, 0.9, 0.0, 1.0), PlayerGroupAll());
TextTagSetPosition(lv_tag, lv_point, 1.0, false);
TextTagSetVelocity(lv_tag, 0.0, 45.0, 0.5, false); // float upward
TextTagSetLifespan(lv_tag, 2.5); // disappear after 2.5s
TextTagSetFadeTime(lv_tag, 1.0); // fade last 1s
TextTagShow(lv_tag, true, PlayerGroupAll());
// Attach to a unit (floats with the unit)
TextTagAttachToUnit(lv_tag, lv_unit, 1.0, false);
testing
SC2 Data Editor — Wizards for automating complex or repetitive data creation/modification in XML. Use when creating .BlizWiz XML files to define templates for generating catalog entries (units, abilities, effects, actors, etc.) with user inputs, conditions, validations, and macros. Covers wizard elements (input, entry, condition, validate, macro), string evaluation (tokens, catalog references, arithmetic), and file placement. Always reference the Data Wizard Documentation for syntax. Do not use for direct data editing (use other sc2data-* skills) or Galaxy scripting.
data-ai
SC2 Data Editor — Units, Abilities, Movers, Turrets, Requirements, and Races in XML. Use when creating or modifying units (CUnit/CUnitHero), abilities (CAbilEffectTarget, CAbilEffectInstant, CAbilResearch, etc.), movement (CMover), turrets (CTurret), or tech requirements in GameData XML files. Always consult the catalogsData.xsd schema for exact fields and structure — do not assume unsupported fields exist. Do not use for Actors/visuals (use sc2data-actors-visuals), damage/effects (use sc2data-effects-weapons), or Galaxy scripting (use the galaxy-* skills).
data-ai
SC2 Data Editor — Effects, Weapons, Upgrades, and the damage chain in XML. Use when creating or modifying CEffect* (damage, search, apply behavior, launch missile, set), CWeapon, CUpgrade, or the full chain from weapon through to damage application. Also covers TargetFind, TargetSort, and Footprints. Always consult the catalogsData.xsd schema for exact fields and structure — do not assume unsupported fields exist. Do not use for actors/visuals (sc2data-actors-visuals) or unit/ability containers (sc2data-units-abilities).
testing
SC2 Data Editor — Behaviors (buffs, debuffs, auras, timers) and Validators (conditional tests) in XML. Use when creating or modifying CBehavior* (buff, attribute modifier, unit tracker, reveal) or CValidator* (unit type, unit order, comparison, combine) entries. Also covers behavior stacking, duration, Vitals modification, and how validators gate effects, abilities, and behaviors. Always consult the catalogsData.xsd schema for exact fields and structure — do not assume unsupported fields exist. Do not use for applying a behavior via an effect (use sc2data-effects-weapons) or actor visuals tied to a behavior (use sc2data-actors-visuals).