HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Compile Error Please Help

09-03-2006, 09:38 AM#1
bounty_hunter2
I saved my map but then it says:


Collapse JASS:
//===========================================================================
// 
// Just another Warcraft III map
// 
//   Warcraft III map script
//   Generated by the Warcraft III World Editor
//   Date: Sun Sep 03 11:34:29 2006
//   Map Author: Unknown
// 
//===========================================================================

//***************************************************************************
//*
//*  Global Variables
//*
//***************************************************************************

globals
    // Generated
    trigger                 gg_trg_Melee_Initialization = null
endglobals

function InitGlobals takes nothing returns nothing
endfunction

//***************************************************************************
//*
//*  Unit Creation
//*
//***************************************************************************

//===========================================================================
function CreateUnitsForPlayer0 takes nothing returns nothing
    local player p = Player(0)
    local unit u
    local integer unitID
    local trigger t
    local real life

    set u = CreateUnit( p, 'ogru', -9243,1, -4183,8, 346,662 )
    set u = CreateUnit( p, 'ogru', -9234,4, -4540,9, 0,000 )
    set u = CreateUnit( p, 'o000', -8878,6, -4332,9, 3,000 )
endfunction

//===========================================================================
function CreatePlayerBuildings takes nothing returns nothing
endfunction

//===========================================================================
function CreatePlayerUnits takes nothing returns nothing
    call CreateUnitsForPlayer0(  )
endfunction

//===========================================================================
function CreateAllUnits takes nothing returns nothing
    call CreatePlayerBuildings(  )
    call CreatePlayerUnits(  )
endfunction

//***************************************************************************
//*
//*  Triggers
//*
//***************************************************************************

//===========================================================================
// Trigger: Melee Initialization
//
// Default melee game initialization for all players
//===========================================================================
function Trig_Melee_Initialization_Actions takes nothing returns nothing
    call MeleeStartingVisibility(  )
    call MeleeStartingHeroLimit(  )
    call MeleeGrantHeroItems(  )
    call MeleeStartingResources(  )
    call MeleeClearExcessUnits(  )
    call MeleeStartingUnits(  )
    call MeleeStartingAI(  )
    call MeleeInitVictoryDefeat(  )
endfunction

//===========================================================================
function InitTrig_Melee_Initialization takes nothing returns nothing
    set gg_trg_Melee_Initialization = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Melee_Initialization, function Trig_Melee_Initialization_Actions )
endfunction

//===========================================================================
function InitCustomTriggers takes nothing returns nothing
    call InitTrig_Melee_Initialization(  )
endfunction

//===========================================================================
function RunInitializationTriggers takes nothing returns nothing
    call ConditionalTriggerExecute( gg_trg_Melee_Initialization )
endfunction

//***************************************************************************
//*
//*  Players
//*
//***************************************************************************

function InitCustomPlayerSlots takes nothing returns nothing

    // Player 0
    call SetPlayerStartLocation( Player(0), 0 )
    call SetPlayerColor( Player(0), ConvertPlayerColor(0) )
    call SetPlayerRacePreference( Player(0), RACE_PREF_HUMAN )
    call SetPlayerRaceSelectable( Player(0), true )
    call SetPlayerController( Player(0), MAP_CONTROL_USER )

endfunction

function InitCustomTeams takes nothing returns nothing
    // Force: TRIGSTR_002
    call SetPlayerTeam( Player(0), 0 )

endfunction

//***************************************************************************
//*
//*  Main Initialization
//*
//***************************************************************************

//===========================================================================
function main takes nothing returns nothing
    call SetCameraBounds( -9472,0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -9728,0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 9472,0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 9216,0 - GetCameraMargin(CAMERA_MARGIN_TOP), -9472,0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 9216,0 - GetCameraMargin(CAMERA_MARGIN_TOP), 9472,0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -9728,0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) )
    call SetDayNightModels( "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" )
    call SetTerrainFogEx( 0, 3000,0, 5000,0, 0,000, 0,502, 0,502, 0,000 )
    call NewSoundEnvironment( "Default" )
    call SetAmbientDaySound( "BarrensDay" )
    call SetAmbientNightSound( "BarrensNight" )
    call SetMapMusic( "Music", true, 0 )
    call CreateAllUnits(  )
    call InitBlizzard(  )
    call InitGlobals(  )
    call InitCustomTriggers(  )
    call RunInitializationTriggers(  )

endfunction

//***************************************************************************
//*
//*  Map Configuration
//*
//***************************************************************************

function config takes nothing returns nothing
    call SetMapName( "TRIGSTR_003" )
    call SetMapDescription( "TRIGSTR_005" )
    call SetPlayers( 1 )
    call SetTeams( 1 )
    call SetGamePlacement( MAP_PLACEMENT_USE_MAP_SETTINGS )

    call DefineStartLocation( 0, -3008,0, -5504,0 )

    // Player setup
    call InitCustomPlayerSlots(  )
    call SetPlayerSlotAvailable( Player(0), MAP_CONTROL_USER )
    call InitGenericPlayerSlots(  )
endfunction

And it doesn't want to test or anything... any solutions or uggestions?

Edited by Blade.dk. Reason: Use jass tags.
Attached Images
File type: jpghelp.JPG (48.3 KB)
09-03-2006, 09:45 AM#2
The)TideHunter(
Somebody/you have changed your map script from .j.
The lines:
Collapse JASS:
set u = CreateUnit( p, 'ogru', -9243,1, -4183,8, 346,662 )
set u = CreateUnit( p, 'ogru', -9234,4, -4540,9, 0,000 )
set u = CreateUnit( p, 'o000', -8878,6, -4332,9, 3,000 )

Found near line 40 are wrong, change them too:

Collapse JASS:
set u = CreateUnit( p, 'ogru', -9243,1, -4183,8, 346,662 )
set u = CreateUnit( p, 'ogru', -9234,4, -4540,9, 0,000 )
set u = CreateUnit( p, 'o000', -8878,6, -4332,9, 3,000 )

the "8" and "9" argument arnt surposed to be there.
09-03-2006, 09:49 AM#3
bounty_hunter2
err don't get it.... :(
maybe cause I use GUI not JASS but still you just copied pasted the same 3 lines two times and wrote something about the 8 and 9 arguments... and how to change the script that editor genrates...?
09-03-2006, 09:50 AM#4
The)TideHunter(
Oops, lol, i forgot to change the new lines. Bleh.

Collapse JASS:
set u = CreateUnit( p, 'ogru', -9243, -4183, 662.)
set u = CreateUnit( p, 'ogru', -9234, -4540,0.)
set u = CreateUnit( p, 'o000', -8878, -4332,0.)

EDIT: More errors in them, who wrote them? Theyre terribly wrong.
EDIT2: Please use Jass tags in future, its hard to scour through draft lines.

This is unfinished script.
I will finish making it correct soon.

EDIT3: I cant work with that, somebody has edited your .j or you have some scary bugs on your computer.
This line:

Collapse JASS:
call SetCameraBounds( -9472,0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -9728,0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 9472,0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 9216,0 - GetCameraMargin(CAMERA_MARGIN_TOP), -9472,0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 9216,0 - GetCameraMargin(CAMERA_MARGIN_TOP), 9472,0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -9728,0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) )

Is horribly wrong.
09-03-2006, 09:52 AM#5
bounty_hunter2
ok but could you please tell me whereto go to change the script cause when the (attached image) apears I can't change anything there.

EDIT:
noboy wrote the JASS I was doing triggers when this ocured.

Here in Jass tags
Collapse JASS:
//===========================================================================
// 
// Just another Warcraft III map
// 
//   Warcraft III map script
//   Generated by the Warcraft III World Editor
//   Date: Sun Sep 03 11:51:09 2006
//   Map Author: Unknown
// 
//===========================================================================

//***************************************************************************
//*
//*  Global Variables
//*
//***************************************************************************

globals
    // Generated
    trigger                 gg_trg_Melee_Initialization = null
endglobals

function InitGlobals takes nothing returns nothing
endfunction

//***************************************************************************
//*
//*  Unit Creation
//*
//***************************************************************************

//===========================================================================
function CreateUnitsForPlayer0 takes nothing returns nothing
    local player p = Player(0)
    local unit u
    local integer unitID
    local trigger t
    local real life

    set u = CreateUnit( p, 'ogru', -9243,1, -4183,8, 346,662 )
    set u = CreateUnit( p, 'ogru', -9234,4, -4540,9, 0,000 )
    set u = CreateUnit( p, 'o000', -8878,6, -4332,9, 3,000 )
endfunction

//===========================================================================
function CreatePlayerBuildings takes nothing returns nothing
endfunction

//===========================================================================
function CreatePlayerUnits takes nothing returns nothing
    call CreateUnitsForPlayer0(  )
endfunction

//===========================================================================
function CreateAllUnits takes nothing returns nothing
    call CreatePlayerBuildings(  )
    call CreatePlayerUnits(  )
endfunction

//***************************************************************************
//*
//*  Triggers
//*
//***************************************************************************

//===========================================================================
// Trigger: Melee Initialization
//
// Default melee game initialization for all players
//===========================================================================
function Trig_Melee_Initialization_Actions takes nothing returns nothing
    call MeleeStartingVisibility(  )
    call MeleeStartingHeroLimit(  )
    call MeleeGrantHeroItems(  )
    call MeleeStartingResources(  )
    call MeleeClearExcessUnits(  )
    call MeleeStartingUnits(  )
    call MeleeStartingAI(  )
    call MeleeInitVictoryDefeat(  )
endfunction

//===========================================================================
function InitTrig_Melee_Initialization takes nothing returns nothing
    set gg_trg_Melee_Initialization = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Melee_Initialization, function Trig_Melee_Initialization_Actions )
endfunction

//===========================================================================
function InitCustomTriggers takes nothing returns nothing
    call InitTrig_Melee_Initialization(  )
endfunction

//===========================================================================
function RunInitializationTriggers takes nothing returns nothing
    call ConditionalTriggerExecute( gg_trg_Melee_Initialization )
endfunction

//***************************************************************************
//*
//*  Players
//*
//***************************************************************************

function InitCustomPlayerSlots takes nothing returns nothing

    // Player 0
    call SetPlayerStartLocation( Player(0), 0 )
    call SetPlayerColor( Player(0), ConvertPlayerColor(0) )
    call SetPlayerRacePreference( Player(0), RACE_PREF_HUMAN )
    call SetPlayerRaceSelectable( Player(0), true )
    call SetPlayerController( Player(0), MAP_CONTROL_USER )

endfunction

function InitCustomTeams takes nothing returns nothing
    // Force: TRIGSTR_002
    call SetPlayerTeam( Player(0), 0 )

endfunction

//***************************************************************************
//*
//*  Main Initialization
//*
//***************************************************************************

//===========================================================================
function main takes nothing returns nothing
    call SetCameraBounds( -9472,0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -9728,0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 9472,0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 9216,0 - GetCameraMargin(CAMERA_MARGIN_TOP), -9472,0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 9216,0 - GetCameraMargin(CAMERA_MARGIN_TOP), 9472,0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -9728,0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) )
    call SetDayNightModels( "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" )
    call SetTerrainFogEx( 0, 3000,0, 5000,0, 0,000, 0,502, 0,502, 0,000 )
    call NewSoundEnvironment( "Default" )
    call SetAmbientDaySound( "BarrensDay" )
    call SetAmbientNightSound( "BarrensNight" )
    call SetMapMusic( "Music", true, 0 )
    call CreateAllUnits(  )
    call InitBlizzard(  )
    call InitGlobals(  )
    call InitCustomTriggers(  )
    call RunInitializationTriggers(  )

endfunction

//***************************************************************************
//*
//*  Map Configuration
//*
//***************************************************************************

function config takes nothing returns nothing
    call SetMapName( "TRIGSTR_003" )
    call SetMapDescription( "TRIGSTR_005" )
    call SetPlayers( 1 )
    call SetTeams( 1 )
    call SetGamePlacement( MAP_PLACEMENT_USE_MAP_SETTINGS )

    call DefineStartLocation( 0, -3008,0, -5504,0 )

    // Player setup
    call InitCustomPlayerSlots(  )
    call SetPlayerSlotAvailable( Player(0), MAP_CONTROL_USER )
    call InitGenericPlayerSlots(  )
endfunction
Attached Images
File type: jpghelp.JPG (48.3 KB)
09-03-2006, 09:58 AM#6
blu_da_noob
It looks like some decimal points were replaced by commas or something.

I'm guessing this is correct:
Collapse JASS:
set u = CreateUnit( p, 'ogru', -9243.1, -4183.8, 346.662 )
set u = CreateUnit( p, 'ogru', -9234.4, -4540.9, 0.000 )
set u = CreateUnit( p, 'o000', -8878.6, -4332.9, 3.000 )

Collapse JASS:
call SetCameraBounds( -9472.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -9728.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 9472.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 9216.0 - GetCameraMargin(CAMERA_MARGIN_TOP), -9472.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 9216.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 9472.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -9728.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) )
call SetDayNightModels( "Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl", "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl" )
call SetTerrainFogEx( 0, 3000.0, 5000.0, 0.000, 0.502, 0.502, 0.000 )

Collapse JASS:
call DefineStartLocation( 0, -3008.0, -5504.0 )


If you use GUI, you might have some setting which is screwing it up. I think there is some setting for whether your system uses a comma or decimal point for decimal values. I can't remember it off hand, perhaps someone else can help with that?

Edit: Ok yeah found it. If you're using windows 98/2k go to Control Panel -> Regional Settings -> Number tab and change the decimal symbol there to a point (.). If you're using WinXP go Control Panel -> Date, Time, Language and Regional options -> Regional and Language options -> Customise tab and change it there.
09-03-2006, 10:00 AM#7
bounty_hunter2
uh oh darn I did some nice terran ^^

well then New Map i supose...
09-03-2006, 10:02 AM#8
The)TideHunter(
To get the .j, you will need a mpq import/export program, theirs a few in the resources section.
To get it, if you dont want the tool, you need to crash WE so it makes a temp file of your map, with the .j included, or just make a error so that box bots up again, and CnP all that into a notepad document, save it and change the .txt to .j.
09-03-2006, 10:04 AM#9
bounty_hunter2
right....
thanks but I think il just go and press the new map buttin

^^
09-03-2006, 10:23 AM#10
blu_da_noob
Have you checked your decimal point settings? It's the only thing I can think of that would be causing that.
09-03-2006, 10:47 AM#11
The)TideHunter(
Yea i think Blu's right, somehow W/E must have replaced the decimal points with comma's.
Because the functions work if you replace them.
All the lines where it says "invalid number of arguments", it means theirs one to many commas, so all the times where it says ", (a number),(another number), "
Straight one of the numbers, is a comma (which is ok), but then straight after that next comma is another number, thats wrong.
If theirs not a space seperating the comma then the value, its wrong.

Example which is ok:
", 538.1, "

Example which is bugged:
", 538,1, "

The comma has no spaces either side from the 8 and the 1, so change it to a decimal point (.)
09-03-2006, 10:51 AM#12
blu_da_noob
Quote:
Originally Posted by The)TideHunter(
If theirs not a space seperating the comma then the value, its wrong.

That's bullshit.
09-03-2006, 10:52 AM#13
The)TideHunter(
Quote:
Originally Posted by blu_da_noob
That's bullshit.
Im not talking about any other code but this one, i do it all the time (not a comma for a fullstop), i mean what i said is wrong.
Its wrong for this code, obviously.

EDIT: That is confusing.
I mean yes it is bullshit, in any other curcumstance but this one, i was mearly pointing out what he should look out for.
09-03-2006, 11:01 AM#14
blu_da_noob
Aah... lol. Misunderstanding there :P

To OP: I suggest you just fix your decimal pointer and go back to normal GUI...
09-03-2006, 02:26 PM#15
Vexorian
Yeah, this is a known , lame WE bug, we should have a list of them or something