• 0

    posted a message on Cliff Edges and the Camera

    Having a similar issue. My camera remains steady but whenever I move over a cliff that rises or declines very rapidly, or a highground cliff, the unit's height position jumps around for a brief period, together with any camera that's following its position.
    Even when using the "Ignore terrain height" unit option it still jumps around even if the unit should be using world coordinates and floating in midair..

    Wish you could just ditch the built in collision detection with their height maps alltogether, this problem is making any map with vertical movement a rage inducing process

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Trigger] Utilizing the Power of Functions with GUI

    Took me ages before I realized the editor had functions haha
    There's actually a way to call functions from the GUI; have the function return boolean true after completing successfully and use a "SetVariable blnOk = myFunction(params)" to call the function.

    Posted in: Tutorials
  • 0

    posted a message on Ignoring Terrain (c_unitStateIgnoreTerrainZ)

    @rrowland: Go

    In first person it's mostly smooth, once you bring your character on screen the camera does get jerky when turning the character.
    Though I imagine you could do the same thing with issue'ing orders as long as the issue order and height offset are right after another in the game loop, I'll give it a go later

    Posted in: Miscellaneous Development
  • 0

    posted a message on Ignoring Terrain (c_unitStateIgnoreTerrainZ)

    @rrowland: Go

    Oh wow you can change that? The constant flickering from auto-adjustments was driving me nuts

    I don't know if you're doing all the movement from instant positioning or some combination of issue ordering, but if the former try reading from stored vectors/points at all times and only writing to the unit, like this:

    gameloop(){
    newposition = oldPosition + movement;
    Turn ignore Height State On
    Move unit instantly to newposition
    Set unit height to Z-value of newposition
    oldPosition = newposition
    }

    Posted in: Miscellaneous Development
  • 0

    posted a message on Passing structs as parameter, GUI & code

    @s3rius: Go

    Ah I see, many thanks. I think I'll use the array trick for my return values as well, using the index for the # of return value. That should cut down on the need for structs a lot already

    Posted in: Miscellaneous Development
  • 0

    posted a message on Passing structs as parameter, GUI & code

    Haha that's clever, thanks! Can anyone verify this method still works though? I'm getting a syntax error when using the struct in any other custom script outside of the Trigger:

    //==================================================================================================
    // 
    // Generated Map Script
    // 
    // Name:   Just Another StarCraft II Map
    // Author: Unknown Author
    // 
    //==================================================================================================
    include "TriggerLibs/NativeLib"
    
    //--------------------------------------------------------------------------------------------------
    // Library Initialization
    //--------------------------------------------------------------------------------------------------
    void InitLibs () {
        libNtve_InitLib();
    }
    
    //--------------------------------------------------------------------------------------------------
    // Trigger Variables
    //--------------------------------------------------------------------------------------------------
    trigger gt_VectorDeclaration;
    trigger gt_MeleeInitialization;
    trigger gt_VectorUse;
    
    //--------------------------------------------------------------------------------------------------
    // Trigger: VectorDeclaration
    //--------------------------------------------------------------------------------------------------
    bool gt_VectorDeclaration_Func (bool testConds, bool runActions) {
        // Actions
        if (!runActions) {
            return true;
        }
    
        return true;}
        struct Vector {
            fixed x;
            fixed y;
            fixed z;
        };
        bool Foo(){
        return true;
    }
    
    //--------------------------------------------------------------------------------------------------
    void gt_VectorDeclaration_Init () {
        gt_VectorDeclaration = TriggerCreate("gt_VectorDeclaration_Func");
    }
    
    //--------------------------------------------------------------------------------------------------
    // Trigger: Melee Initialization
    //--------------------------------------------------------------------------------------------------
    bool gt_MeleeInitialization_Func (bool testConds, bool runActions) {
        // Actions
        if (!runActions) {
            return true;
        }
    
        return true;
    }
    
    //--------------------------------------------------------------------------------------------------
    void gt_MeleeInitialization_Init () {
        gt_MeleeInitialization = TriggerCreate("gt_MeleeInitialization_Func");
        TriggerAddEventMapInit(gt_MeleeInitialization);
    }
    
    //--------------------------------------------------------------------------------------------------
    // Trigger: VectorUse
    //--------------------------------------------------------------------------------------------------
    bool gt_VectorUse_Func (bool testConds, bool runActions) {
        // Actions
        if (!runActions) {
            return true;
        }
    
        Vector myVector;
        return true;
    }
    
    //--------------------------------------------------------------------------------------------------
    void gt_VectorUse_Init () {
        gt_VectorUse = TriggerCreate("gt_VectorUse_Func");
    }
    
    //--------------------------------------------------------------------------------------------------
    // Trigger Initialization
    //--------------------------------------------------------------------------------------------------
    void InitTriggers () {
        gt_VectorDeclaration_Init();
        gt_MeleeInitialization_Init();
        gt_VectorUse_Init();
    }
    
    //--------------------------------------------------------------------------------------------------
    // Map Initialization
    //--------------------------------------------------------------------------------------------------
    void InitMap () {
        InitLibs();
        InitTriggers();
    }
    

    As far as passing structs goes, I guess I could serialize them to a string if they only contain primite types & other structs. But that's.. very messy and would probably slow things down a lot

    Posted in: Miscellaneous Development
  • 0

    posted a message on Passing structs as parameter, GUI & code

    Hello, I've been using the GUI exclusively so far and ran into some limitations passing data around using basic types. So I tried switching to using structs. However 2 problems I'm having:

    Problem1:
    struct Vector {
        fixed x;
        fixed y;
        fixed z;
    };
    
    void Vectorfrom2Points(Vector* start, Vector* end, Vector* write);
    void Vectorfrom2Points (Vector* start, Vector* end, Vector* write) {
        write->x = (end->x - start->x);
        write->y = (end->y - start->y);
        write->z = (end->z - start->z);
    }
    

    Tried using this code for saving the result of a Vector struct operation and it throws me a Syntax error on the function declaration.. same thing when I try to use the Monkey example from the website's Wiki.

    Problem2:

    Function aside, if I just leave the Vector struct there, compile and import to my MapScript.galaxy again. Then try to initialize a Vector from a Custom Script action in the GUI, I get a Syntax error, Script view pops up showing my original mapscript. I remove the code and save and boom, my imported mapscript gets overwritten by the original.

    So I'm a bit at a loss here on writing galaxy code and how to combine it with coding in the GUI. If someone could point me in the right direction that would be much appreciated. And since this is my first topic here and I don't like taking without giving, here's the code to : Link Removed: http://www.mediafire.com/download.php?rw02wll3jk2

    Posted in: Miscellaneous Development
  • 0

    posted a message on [Trigger] Writing code in pure Galaxy

    Edit: Oh god you had to press Save in the import window itself *hides in shame*

    Hi, thanks for the writeup. I'm having some issues having the editor locate my custom script, getting "Include file not found" on compilation.
    The script is stored under "Lib/Script.galaxy" in my map's folder. Also tried importing the script, still can't find it. Does it need to be in some other position not relative to your map?

    Posted in: Tutorials
  • To post a comment, please or register a new account.