Komaqtion
You can change this now in User CP.
- Reaction score
- 469
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 )
Those are all my triggers atm and I'm really sorry to ask this question but, what inside those could cause trouble ? :S
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 )
Code:
//==================================================================================================
//
// <Your Map> MapScript
//
// Name: <Your Map>
// Author: <Your Name>
//
//==================================================================================================
include "MainScript.galaxy"
//--------------------------------------------------------------------------------------------------
// Map Initialization
//--------------------------------------------------------------------------------------------------
void InitMap () {
Main();
}
Code:
//==================================================================================================
//
// <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();
}
Code:
//==================================================================================================
//
// <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 () {
}
Code:
//==================================================================================================
//
// <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!"));
}
Code:
//==================================================================================================
//==================================================================================================
//
// 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);
}
Code:
//==================================================================================================
//
// <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