• 0

    posted a message on Using include in Galaxy

    @MotiveMe: Go

    Hmmmm, I think I was doing something terribly wrong. Before when I imported a file to the root directory and used "include "blah.galaxy"" it didn't work. Perhaps I didn't import it properly. All is working properly now, thanks =)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Using include in Galaxy

    After I import a .galaxy file, what path do I use to include it?

    Thanks in advance :)

    Posted in: Galaxy Scripting
  • 0

    posted a message on "Execution took too long" and TriggerStop

    I'm getting the "execution took too long error" when I try to run a function from a trigger with the event:

    TriggerAddEventDialogControl(buttonClicked, c_playerAny, c_invalidDialogControlId, c_triggerControlEventTypeClick);
    

    I'm trying to correct this error with this:

    <<code>> TriggerStop(buttonClicked);

    createMap(true);<</code>>

    I don't really understand this error. Am I only getting this because the event TriggerAddEventDialogControl requires a fast runtime? If so, my code really should be fine, because it just stops the buttonClicked trigger.

    Or is it just that any trigger cannot exceed an execution time of .25s?

    Do I need to create another trigger, and run that?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Really weird syntax error

    @MTops: Go

    Ohhhh, well that's pretty inconvenient. Do I have to do this for the entire code, or just per function?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Really weird syntax error

    @wOlfLisK: Go

    I don't think you're truly understanding the problem here. But yes, I do have these declared:

    include "TriggerLibs/NativeLib"
    
    trigger initTrigger;
    point heroPoint;
    
    region tempRegion;
    point tempPoint;
    point[50] tempPointArray;
    
    void createMap() {}
    
    Posted in: Galaxy Scripting
  • 0

    posted a message on Really weird syntax error

    tempRegion and heroPoint are global variables (well, I don't actually know if they are). But they would be if this is C. I declared them like this:

    include "TriggerLibs/NativeLib"
    
    trigger initTrigger;
    
    void createMap() { }
    

    The first three lines

     int safeZone = 30;
    	tempRegion = RegionRect(0, 0, safeZone, safeZone);
    	RegionSetCenter(tempRegion, heroPoint);
    

    Don't have any syntax errors when I compile. Neither does anything else if I comment out these three lines.

    But...if I don't comment out those lines, I get a syntax error for every single line after those three. I tried commenting out every line after those three, and every line after those commented lines gets a syntax error.

    I'm so confused.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Really weird syntax error

    I'm very new to Galaxy, and I cannot figure out why I'm getting a syntax error.

    	int safeZone = 30;
    	tempRegion = RegionRect(0, 0, safeZone, safeZone);
    	RegionSetCenter(tempRegion, heroPoint);
    	
    	fixed avgDistanceFromCenterToEdge = (Pow(mapSizeX, 2) + Pow(mapSizeY, 2))/4;
    	fixed tempfixedX = RandomFixed(mapSizeX/4 - offset, mapSizeX/4 + offset);
    	fixed tempfixedY = RandomFixed(mapSizeY/4 - offset, mapSizeY/4 + offset);
    	fixed heroX = PointGetX(heroPoint);		//x-loc of hero
    	fixed heroY = PointGetY(heroPoint);
    	int addX = 1;	//for while loop logic
    	int addY = 1;
    

    I get a syntax error here, if I try to run the code as is.

    fixed avgDistanceFromCenterToEdge = (Pow(mapSizeX, 2) + Pow(mapSizeY, 2))/4;
    

    However, if I comment out the first 3 lines, then there is no syntax error. Anybody know why that is?

    Also, I have no idea how Galaxy's automated garbage collector works. Do non-global variables get automatically cleaned up once the function is done?

    Thanks in advance :)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Initializing Regions?

    I'm getting started with Galaxy, and regions are really confusing me.

    Why does this line get a syntax error? region startingZone = RegionEmpty();

    Also, I don't understand the function RegionAddCircle(). How do you create a variable from the region that was added?

    Posted in: Triggers
  • 0

    posted a message on Create Buildings and (maybe) Terrain Dynamically

    I've tried the AIBuild function, but it doesn't seem to work. I have town set to 1 (even though I do not know what that means), and flag set to -1 (again, no idea what that means).

    Also, I'm trying to create a map that slightly randomizes its terrain. I haven't been able to find any actions that modifies terrain. Is this something that is just not allowed by the engine?

    Thanks in advance!

    EDIT: Never mind on the building thing. I didn't realize that buildings were classified under Units. The terrain question still stands though.

    EDIT2: Sigh. I spent a pretty long time figuring this stuff out before posting, but I just figured out both. Ignore this post :/.

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