• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] why dont this work?

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
bj_mapInitialPlayableArea has no vlaue when you make the globals.
This is cause the values of it are set up after the globals are defined if I am not mistaken.

To fix this simply asign them the value in an set up function and use them like you did in script 1.
 
Level 9
Joined
Mar 25, 2005
Messages
252
Code:
[COLOr=White][B][COLOr=Wheat]library[/COLOr][/B] MapLimits [B][COLOr=Wheat]initializer[/COLOr][/B] [COLOr=Silver]init[/COLOr]
    [B][COLOr=Wheat]globals[/COLOr][/B]
        [B][COLOr=DarkSlateGray]real[/COLOr][/B] MaxX
        [B][COLOr=DarkSlateGray]real[/COLOr][/B] MinX
        [B][COLOr=DarkSlateGray]real[/COLOr][/B] MaxY
        [B][COLOr=DarkSlateGray]real[/COLOr][/B] MinY
    [B][COLOr=Wheat]endglobals[/COLOr][/B]
    [B][COLOr=Wheat]private[/COLOr][/B] [B][COLOr=Wheat]function[/COLOr][/B] [COLOr=Silver]init[/COLOr] [COLOr=DimGray]takes[/COLOr] [B][COLOr=DarkSlateGray]nothing[/COLOr][/B] [B][COLOr=Wheat]returns[/COLOr][/B] [B][COLOr=DarkSlateGray]nothing[/COLOr][/B]
        [COLOr=DimGray]set[/COLOr] MaxX [B][COLOr=SlateGray]=[/COLOr][/B] [COLOr=LightBlue]GetRectMaxX[/COLOr][B][COLOr=SlateGray]([/COLOr][/B]bj_mapInitialPlayableArea[B][COLOr=SlateGray])[/COLOr][/B][B][COLOr=SlateGray]-[/COLOr][/B][COLOr=Cyan]50[/COLOr]
        [COLOr=DimGray]set[/COLOr] MinX [B][COLOr=SlateGray]=[/COLOr][/B] [COLOr=LightBlue]GetRectMinX[/COLOr][B][COLOr=SlateGray]([/COLOr][/B]bj_mapInitialPlayableArea[B][COLOr=SlateGray])[/COLOr][/B][B][COLOr=SlateGray]+[/COLOr][/B][COLOr=Cyan]50[/COLOr]
        [COLOr=DimGray]set[/COLOr] MaxY [B][COLOr=SlateGray]=[/COLOr][/B] [COLOr=LightBlue]GetRectMaxY[/COLOr][B][COLOr=SlateGray]([/COLOr][/B]bj_mapInitialPlayableArea[B][COLOr=SlateGray])[/COLOr][/B][B][COLOr=SlateGray]-[/COLOr][/B][COLOr=Cyan]50[/COLOr]
        [COLOr=DimGray]set[/COLOr] MinY [B][COLOr=SlateGray]=[/COLOr][/B] [COLOr=LightBlue]GetRectMinY[/COLOr][B][COLOr=SlateGray]([/COLOr][/B]bj_mapInitialPlayableArea[B][COLOr=SlateGray])[/COLOr][/B][B][COLOr=SlateGray]+[/COLOr][/B][COLOr=Cyan]50[/COLOr]
    [B][COLOr=Wheat]endfunction[/COLOr][/B]
[B][COLOr=Wheat]endlibrary[/COLOr][/B][/COLOr]
 
Status
Not open for further replies.
Top