• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Galaxy Editor Generated Names

Status
Not open for further replies.
Level 9
Joined
Nov 28, 2008
Messages
704
You may notice (if trying to use the custom script section) that the editor automatically appends prefixes to things.

Here is a cheat sheet for myself:

GUI Function Parameters: you can set the name, but it will ALWAYS be prefixed by "lp_". Its not a long pointer, wonder what it stands for.

Creating Non-Library Function in GUI: You can set the name for scripts, but it will prefix in "gf_". Global function, obviously.

Library Functions In GUI: You can set name, but prefixed with "lib1_" or something you cant seem to change (Blizzard needs to fix that), followed by "gf_".

Triggers: You can set name, but prefixed by "gt_".


-----------


I don't know if this will help anybody, but if you find anything I'm missing, please help. There are basically no help sites or tutorials at this point for working through the generated code for GE and using custom scripts in it.

All of this was figured out from:

Code:
//==================================================================================================
// 
// Generated Map Script
// 
// Name:   Just Another StarCraft II Map
// Author: Unknown Author
// 
//==================================================================================================
include "TriggerLibs/NativeLib"

//--------------------------------------------------------------------------------------------------
// Library: Random Left Out Functions
//--------------------------------------------------------------------------------------------------
// Function Declarations
unitgroup lib1_gf_GetUnitsWithinRange (point lp_where, fixed lp_radius);

// Functions
unitgroup lib1_gf_GetUnitsWithinRange (point lp_where, fixed lp_radius) {
    // Implementation
    return UnitGroup(null, -1, RegionCircle(lp_where, lp_radius), null, 0);
}

//--------------------------------------------------------------------------------------------------
// Library Initialization
//--------------------------------------------------------------------------------------------------
void lib1_InitLib () {
}

//--------------------------------------------------------------------------------------------------
// Library Initialization
//--------------------------------------------------------------------------------------------------
void InitLibs () {
    libNtve_InitLib();
    lib1_InitLib();
}

//--------------------------------------------------------------------------------------------------
// Global Function Declarations
//--------------------------------------------------------------------------------------------------
int gf_DoNothing ();

//--------------------------------------------------------------------------------------------------
// Trigger Variables
//--------------------------------------------------------------------------------------------------
trigger gt_UntitledTrigger001;
trigger gt_UntitledTrigger002;

//--------------------------------------------------------------------------------------------------
// Global Functions
//--------------------------------------------------------------------------------------------------
int gf_DoNothing () {
    // Implementation
    int a = 2;
    return a + a;
}

//--------------------------------------------------------------------------------------------------
// Trigger: Untitled Trigger 001
//--------------------------------------------------------------------------------------------------
bool gt_UntitledTrigger001_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    UnitGroupLoopBegin(lib1_gf_GetUnitsWithinRange(Point(EventMouseClickedPosXWorld(), EventMouseClickedPosYWorld()), 10.0));
    while (!UnitGroupLoopDone()) {
        UnitKill(UnitGroupLoopCurrent());
        UnitGroupLoopStep();
    }
    UnitGroupLoopEnd();
    return true;
}

//--------------------------------------------------------------------------------------------------
void gt_UntitledTrigger001_Init () {
    gt_UntitledTrigger001 = TriggerCreate("gt_UntitledTrigger001_Func");
    TriggerAddEventMouseClicked(gt_UntitledTrigger001, c_playerAny, c_mouseButtonLeft, true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Untitled Trigger 002
//--------------------------------------------------------------------------------------------------
bool gt_UntitledTrigger002_Func (bool testConds, bool runActions) {
    // Actions
    if (!runActions) {
        return true;
    }

    UIDisplayMessage(PlayerGroupAll(), 1, IntToText(DoNothing()));
    return true;
}

//--------------------------------------------------------------------------------------------------
void gt_UntitledTrigger002_Init () {
    gt_UntitledTrigger002 = TriggerCreate("gt_UntitledTrigger002_Func");
    TriggerAddEventMapInit(gt_UntitledTrigger002);
}

//--------------------------------------------------------------------------------------------------
// Trigger Initialization
//--------------------------------------------------------------------------------------------------
void InitTriggers () {
    gt_UntitledTrigger001_Init();
    gt_UntitledTrigger002_Init();
}

//--------------------------------------------------------------------------------------------------
// Map Initialization
//--------------------------------------------------------------------------------------------------
void InitMap () {
    InitLibs();
    InitTriggers();
}

Where I defined the DoNothing function to return 4, and also created a library called "Random Left Out Functions", which seems to have become lib1_ as a prefix. This is VERY annoying, because I cant seem to use libraries in custom scripts due to this, without defining some sub functions used which takes a lot of wasted time.
 
Level 9
Joined
Nov 28, 2008
Messages
704
Has anyone decided on a standard for that yet? I used MFpr, first two identifying author, last two the type of library, but that seems like it would run out of space fast. Maybe Hex codes would be easier, I dont know.
 
Status
Not open for further replies.
Top