HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Jass newgen Compile error...

11-24-2007, 10:33 PM#1
Seannny
Well ive recently joined the jass community(still not too good) so i got the newgen pack to code things in, the problem though, is that every time i save anything in the newgen the jasshelper detects a compile error

line 8677-identifier redeclared: "Commander"

and

line 8850---------previously declared line here


because of these two errors, when i save my map it corrupts it and when i try and host it on wc3 it cant find the map... i need this to be fixed, this is the 4th map this has happened on, obviously i havent learned my lesson because ive only used newgen for 4 maps.... and ive gotten to far to restart... any help i would really appreciate
11-28-2007, 12:23 PM#2
PitzerMike
What other scripts are you using in your map?
Any WEU advanced triggers etc?

PS: Upload one of your maps then I can look for the problem.
12-01-2007, 01:01 PM#3
Vexorian
Commander sure sounds like WEU
12-04-2007, 12:35 AM#4
Seannny
Meh sorry guys, peeps at TheHelper already helped fix this, It wasnt WEU, it was some really weird freak accident thing that had happened with a file in Newgen. Its working perfectly now.
12-09-2007, 03:19 PM#5
Troll-Brain
There is the script generated :

Collapse JASS:
globals
    // User-defined
    boolean                 udg_AUTORISATION           = false

    // Generated
    trigger                 gg_trg_GestionDesOrdres    = null
    trigger                 gg_trg_DonnerUnOrdre       = null


//JASSHelper struct globals:
constant integer si__infos=1
integer si__infos_F=0
integer si__infos_I=0
integer array si__infos_V
string array s__infos_ordre
integer array s__infos_stocke
real array s__infos_x
real array s__infos_y
widget array s__infos_w
constant integer si__erre=2
timer array s__erre_t
integer array si__infos_type
trigger array st__infos_onDestroy

endglobals

//Generated allocator of infos
function s__infos__allocate takes nothing returns integer
 local integer this=si__infos_F
    if (this!=0) then
        set si__infos_F=si__infos_V[this]
    else
        set si__infos_I=si__infos_I+1
        set this=si__infos_I
    endif
    if (this>8190) then
        return 0
    endif

    set s__infos_ordre[this]=null
    set s__infos_stocke[this]=0
    set s__infos_x[this]=0
    set s__infos_y[this]=0
    set s__infos_w[this]=null
    set si__infos_V[this]=-1
 return this
endfunction

//Generated destructor of infos
function sc__infos_destroy takes integer this returns nothing
    if this==null then
        return
    elseif (si__infos_V[this]!=-1) then
        return
    endif
    set f__arg_this=this
    call TriggerEvaluate(st__infos_onDestroy[si__infos_type[this]])
    set si__infos_V[this]=si__infos_F
    set si__infos_F=this
endfunction

//Generated allocator of erre
function s__erre__allocate takes nothing returns integer
 local integer this=s__infos__allocate()
 local integer kthis
    if(this==0) then
        return 0
    endif
    set si__infos_type[this]=2
    set kthis=this

 return this
endfunction


//===========================================================================
// 
// Encore une carte Warcraft III
// 
//   Warcraft III map script
//   Generated by the Warcraft III World Editor
//   Date: Sun Dec 09 17:16:52 2007
//   Map Author: Inconnu
// 
//===========================================================================

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


function InitGlobals takes nothing returns nothing
    set udg_AUTORISATION = false
endfunction

//***************************************************************************
//*
//*  Custom Script Code
//*
//***************************************************************************
//TESH.scrollpos=0
//TESH.alwaysfold=0


function B2S takes boolean b returns string
    if b then
        return "true"
    endif
        return "false"
endfunction

function IsUnitMove takes unit u returns boolean
    local real x= GetUnitX(u)
    local real y= GetUnitY(u)
    local real r= GetUnitFacing(u)

    call TriggerSleepAction(0.00)
    return x != GetUnitX(u) or y != GetUnitY(u) or r != GetUnitFacing(u)
endfunction





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

//===========================================================================
// Trigger: GestionDesOrdres
//
// 
//===========================================================================
//TESH.scrollpos=0
//TESH.alwaysfold=0
function CheckOrdre takes nothing returns nothing
    local eventid e= GetTriggerEventId()
    local unit u= GetTriggerUnit()
    local integer ref= GetUnitUserData(u)
    local integer recu= GetIssuedOrderId()
    local widget w= GetOrderTarget()
    local real x= GetOrderPointX()
    local real y= GetOrderPointY()
    local string ordre
    local integer O
    
    
    if e == EVENT_PLAYER_UNIT_ISSUED_ORDER then
        set ordre = "widget"
    elseif e == EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER then
        set ordre = "point"
    else
        set ordre = "sans"
    endif
    if udg_AUTORISATION then
        if ref == 0 then
            set O = s__infos__allocate()
        else
            set O = (ref)
        endif
        set s__infos_ordre[O]=ordre
        set s__infos_stocke[O]=recu
            if ordre == "widget" then
                set s__infos_w[O]=w
            elseif ordre == "point" then
                set s__infos_x[O]=x
                set s__infos_y[O]=y
            endif
    endif
    
    
endfunction

function ConditionUnitType takes nothing returns boolean
    return true
endfunction

//===========================================================================
function InitTrig_GestionDesOrdres takes nothing returns nothing
    local trigger t= CreateTrigger()
    call TriggerRegisterPlayerUnitEvent(t , Player(0) , EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER , null)
    call TriggerRegisterPlayerUnitEvent(t , Player(0) , EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER , null)
    call TriggerRegisterPlayerUnitEvent(t , Player(0) , EVENT_PLAYER_UNIT_ISSUED_ORDER , null)
    call TriggerAddCondition(t , Condition(function ConditionUnitType))
    call TriggerAddAction(t , function CheckOrdre)
endfunction

//===========================================================================
// Trigger: DonnerUnOrdre
//===========================================================================
function Trig_DonnerUnOrdre_Actions takes nothing returns nothing
    set udg_AUTORISATION = true
    // donne ton ordre
    set udg_AUTORISATION = false
endfunction

//===========================================================================
function InitTrig_DonnerUnOrdre takes nothing returns nothing
    set gg_trg_DonnerUnOrdre = CreateTrigger()
    call TriggerAddAction(gg_trg_DonnerUnOrdre , function Trig_DonnerUnOrdre_Actions)
endfunction

//===========================================================================
function InitCustomTriggers takes nothing returns nothing
    call InitTrig_GestionDesOrdres()
    call InitTrig_DonnerUnOrdre()
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(- 3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT) , - 3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) , 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT) , 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP) , - 3328.0 + GetCameraMargin(CAMERA_MARGIN_LEFT) , 3072.0 - GetCameraMargin(CAMERA_MARGIN_TOP) , 3328.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT) , - 3584.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM))
    call SetDayNightModels("Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl" , "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl")
    call NewSoundEnvironment("Default")
    call SetAmbientDaySound("LordaeronSummerDay")
    call SetAmbientNightSound("LordaeronSummerNight")
    call SetMapMusic("Music" , true , 0)
    call InitBlizzard()

call ExecuteFunc("jasshelper__initstructs10493562")

    call InitGlobals()
    call InitCustomTriggers()

endfunction

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

function config takes nothing returns nothing
    call SetMapName("Encore une carte Warcraft III")
    call SetMapDescription("Sans description")
    call SetPlayers(1)
    call SetTeams(1)
    call SetGamePlacement(MAP_PLACEMENT_USE_MAP_SETTINGS)

    call DefineStartLocation(0 , - 1408.0 , - 2944.0)

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



//Struct method generated initializers/callers:

function jasshelper__initstructs10493562 takes nothing returns nothing
    set st__infos_onDestroy[1]=null
    set st__infos_onDestroy[2]=null

endfunction

Error : line 56 Undeclared variable f__arg_this

I attach the map
Attached Files
File type: w3xordresPC.w3x (16.9 KB)
12-09-2007, 07:41 PM#6
Vexorian
Please before posting that script confirm that you are using newest jasshelper, I fixed that bug before.
12-09-2007, 07:52 PM#7
Troll-Brain
i said it in the section scripts and triggers
I've copy/paste the last jass helper ( 0.9.9.7)
12-10-2007, 01:18 AM#8
Vexorian
btw, isn't this the wrong thread?

You can temporarily fix the issue, By adding an empty onDestroy to one of the structs.
12-10-2007, 09:14 AM#9
Troll-Brain
If i add in the second scope it's still fail but not one the first :).
I just don't want to create an other post, and you didn't said that to Seannny.
But maybe the right post didn't exist at this moment.
Btw why you do that :

Collapse JASS:
//Generated destructor of infos
function sc__infos_destroy takes integer this returns nothing
    if this==null then
        return
    elseif (si__infos_V[this]!=-1) then
        return
    endif

Instead of that :
Collapse JASS:
    if this==null or si__infos_V[this]!=-1 then
        return
    endif

Hardier to make the code ?
12-10-2007, 04:36 PM#10
Vexorian
In the worst case you should have made a new thread, for it.

Medium case you would have left the post with the output in the thread in which you reported the problem with extends originally.

But if you really wanted to do things correctly you would have made the jasshelper bug report in jasshelper's thread.

I am gonna have to close this thread to avoid more misplaced bug reports.

You don't have to report the bug anymore since I have already fixed it, I also did some other things, but before releasing the new version I'll do the max used indexes hack to allow more struct instances than 8190 but before that I must go home but before that I must go back to classes...