• 0

    posted a message on Script load failed: Syntax error when map starts?

    Oh right XD I haven't told you what the spell is suppoed to do yet, haha :P

    It's like Blink, you teleport to the target, and deal some damage :D Simple spell, which I know can be done in the Data Editor, but I feel more comfortable with triggers, and I can't seem to understand the Data Editor much so it's simpler like this ;)

    And also, I have the MapInit function which is supposed to output a message at map initialization, which it still doesn't... :(

    But thank you so much for all your help so far :) Just need a little more and then I'll have a working map to start coding a bit more with.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    Ok, so your map doesn't work for me :( Or at least the spell doesn't work, and the MapInit message isn't showing either...

    I'll upload all my files with the galaxy script in them here, and also your map (with some changes by me).

    https://rapidshare.com/files/3736379486/Testing_-_Helped.SC2Map

    https://rapidshare.com/files/4059450669/BurningStep.galaxy

    https://rapidshare.com/files/1902007730/Debug.galaxy

    https://rapidshare.com/files/877631424/First_script.galaxy

    https://rapidshare.com/files/3697056212/Globals.galaxy

    https://rapidshare.com/files/3478523590/MainScript.galaxy

    https://rapidshare.com/files/563003663/MapInit.galaxy

    The file "First script" is the one I later rename to MapScript.galaxy after I've imported it ;)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    Ok, thank you soo much :D But it's still a bit weird that you had to go to such lengths to make this work :S It shouldn't be like this, right ?

    And what compiler spewed out errors? The default Galaxy compiler? What were the unexpected return values? Those questions are just to make me understand the whole process more :D You don't have to answer them :P

    Anyways, thank you all so much for helping me with this ;)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    Hmm, now that I opened the map myself, there were no files imported at all :S I'll upload it again XD (Still doesn't work btw :S)

    https://rapidshare.com/files/2449216894/Testing.SC2Map

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    Sure :D No problems, since it's just a test map :D

    Here it is ;)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    Ok, well I still removed all requires from all other triggers except MapScript and MainScript, but still no results... And I made all trigger-methods/functions bool, and added two bool parametres to them also :S

    Dunno what else it could be...

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    I've worked quite alot with triggers (JASS/vJASS) in WC3 before, so I know alot of the mechanics in triggers and such, but thanks anyway :D But in WC3 you could include (requires/uses/needs were the commands then IIRC) the same script as many times as you wanted, in different triggers of course. But here you only need to include them in the first file then, MapScript, since they all en up in the same file anyway, right?

    And for the bool MyTrigger instead of void MyTrigger, I got errors in Galaxy+ + when I did the bool thing, which is weird since I know it should work that way, but I decided that I would just go with void instead. But I'll try bool again ;)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    First, thanks, didn't see that... And I now convert it from string to text, but now nothing in the triggers happen when I start the game, not the "I has init" string or anything. (Not that it did so before, but now there isn't the "Syntax error" text at least).

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    The syntax error says nothing... It only says "Script load failed: Syntax error", that's it.

    But I'll try out that solution, and that means taking away the "include Globals.galaxy" line in those other files, except in the "MainScript.galaxy file, or what?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Script load failed: Syntax error when map starts?

    Hello!

    I just started scripting in the Galaxy language and I'm having some trouble with importing the files with the script inside it. I followed this tutorial to try and start, but I also made my own trigger for a spell I had in mind (just a Blink spell with some AoE damage) and I used Galaxy + + to check the syntax of the code, and there were none. And then I imported the files, and renamed it MapScript.galaxy (and then after I saved it dissapeared from the Import palette) and then I start the game, and red text appears in the bottom left saying "Script load failed: Syntax error"... ( And of course noting happens with the spell :( )

    //==================================================================================================
    //
    // <Your Map> MapScript
    //
    // Name:   <Your Map>
    // Author: <Your Name>
    //
    //==================================================================================================
    
    include "MainScript.galaxy"
    
    //--------------------------------------------------------------------------------------------------
    // Map Initialization
    //--------------------------------------------------------------------------------------------------
    void InitMap () {
        Main();
    }
    
    //==================================================================================================
    //
    // <Your Map> MainScript
    //
    // Name:   <Your Map>
    // Author: <Your Name>
    //
    //==================================================================================================
    
    include "TriggerLibs/NativeLib"
    include "Globals.galaxy"
    include "MapInit.galaxy"
    include "BurningStep.galaxy"
    include "Debug.galaxy"
    
    //--------------------------------------------------------------------------------------------------
    // Trigger: Initialization
    //--------------------------------------------------------------------------------------------------
    
    
    void InitTriggers () {
        
        //====================================================================\\
        gt_MapInit = TriggerCreate("MapInit");
        TriggerAddEventMapInit(gt_MapInit);
        //====================================================================\\
        
        //====================================================================\\
        gt_BurningStep = TriggerCreate("BurningStep_Main");
        TriggerAddEventUnitAbility( gt_BurningStep, null, AbilityCommand( "Blink", 0 ), 0, false );
        //====================================================================\\
        
        //====================================================================\\
        gt_DebugMode = TriggerCreate("DebugMode_Main");
        TriggerAddEventUnitOrder( gt_DebugMode, null, AbilityCommand( "move", 0 ) );
        TriggerAddEventUnitOrder( gt_DebugMode, null, AbilityCommand( "stop", 0 ) );
        TriggerAddEventUnitOrder( gt_DebugMode, null, AbilityCommand( "attack", 0 ) );
        //====================================================================\\
    }
    
    //--------------------------------------------------------------------------------------------------
    // Library Initialization
    //--------------------------------------------------------------------------------------------------
    void InitLibs () {
        libNtve_InitLib();
    }
    
    //--------------------------------------------------------------------------------------------------
    // Map Initialization
    //--------------------------------------------------------------------------------------------------
    void Main () {
        InitLibs();
        InitTriggers();
        InitGlobals();
    }
    
    //==================================================================================================
    //
    // <Your Map> Globals
    //
    // Name:  <Your Map>
    // Author: <Your Name>
    //
    //==================================================================================================
    
    include "TriggerLibs/NativeLib"
    
    //Objects
    
    //Triggers
    trigger gt_MapInit;
    trigger gt_BurningStep;
    trigger gt_DebugMode;
    
    // Variables
    
    //--------------------------------------------------------------------------------------------------
    // Globals Initialization
    //--------------------------------------------------------------------------------------------------
    void InitGlobals () {
    }
    
    //==================================================================================================
    //
    // <Your Map> SetupGame
    //
    // Name:   <Your Map>
    // Author: <Your Name>
    //
    //==================================================================================================
    
    include "TriggerLibs/NativeLib"
    include "Globals.galaxy"
    
    void MapInit () {
        UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText("I Has Init!"));
    }
    
    //==================================================================================================
    //==================================================================================================
    //
    // Test Map - Spell - Burning Step
    //
    // Name:   <Your Map>
    // Author: <Your Name>
    //
    //==================================================================================================
    
    include "TriggerLibs/NativeLib"
    include "Globals.galaxy"
    
    const fixed SPELL_RANGE = 50.0;
    
    //static void SPELL_DAMAGE ( unit
    
    static unit Caster = null;
    
    void UnitGroupLoop ( unitgroup uGroup ) {
        int groupNum = UnitGroupCount( uGroup, c_unitCountAll );
        
        unit u = null;
        //unitgroup grp = UnitGroupCopy( uGroup );
        
        UIDisplayMessage( PlayerGroupAll(), c_messageAreaDebug, UnitGetType( Caster ) );
        
        if ( groupNum <= 0 ) { return; }
        
        if ( groupNum == 1 ) { u = UnitGroupUnit( uGroup, 1 ); UnitDamage( Caster, null, u, 50 ); UIDisplayMessage( PlayerGroupAll(), c_messageAreaDebug, UnitGetType( u ) ); return; }
        
        while ( groupNum > 0 ) { u = UnitGroupUnit( uGroup, groupNum ); UnitDamage( Caster, null, u, 50 ); groupNum -= 1; UIDisplayMessage( PlayerGroupAll(), c_messageAreaDebug, UnitGetType( u ) ); }
        
        //return;
    }
    
    void BurningStep_Main ( bool testConds ) {
        
        Caster = EventUnit();
        
        if (testConds) {
            if (!(UnitIsAlive(Caster))) { return; }
        }
        
        //abilcmd spellAbil = EventUnitAbility();
        
        point spellPoint = EventUnitTargetPoint();
        
        point castPoint = UnitGetPosition( Caster );
        fixed castX = PointGetY( castPoint );
        fixed castY = PointGetX( castPoint );
        
        region spellRange = RegionCircle( castPoint, SPELL_RANGE );
        unitgroup spellDmgd = UnitGroup( null, c_playerAny, spellRange, UnitFilterStr( "Ground,Air,Alive;Self,Ally" ), 0 );
        
        UnitGroupAddUnitGroup( spellDmgd, UnitGroup( null, c_playerAny, spellRange, UnitFilterStr( "Ground,Air,Alive;Self,Ally" ), 0 ) );
        
        UnitGroupLoop( spellDmgd );
        
        UnitSetPosition(Caster, libNtve_gf_PointFromPositionAndAngle(spellPoint, UnitGetFacing(Caster)), true);
    }
    
    //==================================================================================================
    //
    // <Your Map> SetupGame
    //
    // Name:   <Your Map>
    // Author: <Your Name>
    //
    //==================================================================================================
    
    include "TriggerLibs/NativeLib"
    include "Globals.galaxy"
    
    const bool DEBUG_MODE = true;
    
    void DebugMode_Main () {
        abilcmd ab = EventUnitAbility();
        unit u = EventUnit();
        order o = EventUnitOrder();
        
    	if DEBUG_MODE {
    	    UIDisplayMessage( PlayerGroupAll(), c_messageAreaDebug, AbilityCommandGetAbility( ab ) );
    		UIDisplayMessage( PlayerGroupAll(), c_messageAreaDebug, AbilityCommandGetAbility( OrderGetAbilityCommand( o ) ) );
    	}
    }
    

    Those are all my triggers atm and I'm really sorry to ask this question but, what inside those could cause trouble ? :S

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