• 0

    posted a message on Additional parameters for Triggers

    Ah thanks. I'm already doing something similar to how the GUI creates a global variable then sets it to the local variables within the trigger.

    I'm using triggers because of the ability to call them dynamically, whereas functions I cannot. So I guess this is my only option... thanks though. :)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Additional parameters for Triggers

    Possible?

    If not, any other way to pass variables into a trigger other than global variables?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Questions about 1.20's Custom Layout Files

    I'm a complete beginner to XML editing, but I've read the old threads about the layout files and I'm pretty comfortable learning the format, and I wonder if they're worth my time to edit. I know how XML editing of existing layout files let you reposition items that is already on the UI (e.g. moving the mini-map around), but how does functionality work with new layout files?

    In other words, how does the new UI connect with functions, triggers, other stuff in your code?

    Another question would be the template, panel dialog stuff. Panels just group dialog items together right? Whats this template stuff? Are they used to connect dialog items with the new UI layout files?

    Posted in: Triggers
  • 0

    posted a message on Imported Script Limit?

    Yes I'm working on a project which is a bit large scale.

    As for string literals, thanks. :) Is it wise to store all constant messages and display them via variables rather than string literals then?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Dynamically running a function?

    Apologies for so the numerous threads... I prefer keeping each question separated so discussion is focused. :P

    First and foremost, I would like to ask one question... Is there a big difference in the size between trigger[500] or 500 void functions? If there isn't, then I won't bother pursuing this.

    The only reason why I'm using trigger[500] right now is because of the ability to execute a trigger based on an array. For example, running trigger a[230].

    Is it possible to achieve this with functions? I can't think of any way to run a function based on a dynamically constructed name since you can't have arrays of a function name. Unless you can somehow use strings or something to construct a name of a function then run it... or something...

    And there's a crude way of doing it using if then else clauses, but then it gets really slow for the functions at the end.

    Posted in: Galaxy Scripting
  • 0

    posted a message on Imported Script Limit?

    Sorry for the late reply.

    Here are the results: "Script load failed: Could not allocate Global Memory (try reducing the size)"

    Using:

    int[500][500][500][500] x;
    int[500][500][500][500] y;
    int[500][500][500][500] z;
    

    Yeah, as you guessed s3rius, there is a limit even on imported scripts. But would allowed size of my code drastically increase for me? It seems like triggers take a lot of space in the editor... I only have triggers for a few buttons and some debugging tools, the rest (the majority) of my code runs on functions.

    What I'm scared of now, is to continue on coding until one day I reach a limit... but I wouldn't know how close I am. :(

    Last question is... what are string literals? I know what strings are but "literals"? (I'm still a programming newbie)

    Finally, I have a few questions concerning strings...

    Character limit on strings?

    I need around 600 strings 200 characters each and like another 600 strings 50 characters each, would I reach a limit?

    Posted in: Galaxy Scripting
  • 0

    posted a message on Imported Script Limit?

    I know there are trigger limits, and other stuff, but what about an imported script?

    Using Andromeda as a compiler, all my dedicated code files (coded outside of editor) are compressed to one .galaxy file which is then imported into the map. But even after compilation my map is still 90 KB, and when I look at the overall manager thing, nothing about imported stuff is listed...

    If there isn't a limit... why isn't everyone using this method? I have like 2.6k lines of code and I'm like less than 1% to the max file size...

    Posted in: Galaxy Scripting
  • 0

    posted a message on Two events for one trigger?

    Yeah alright, thanks.

    So as long as I'm aware of using event responses and what comes along with it, I can do whatever with events. :)

    Posted in: Galaxy Scripting
  • 0

    posted a message on Two events for one trigger?

    If you added a second event for a trigger, would it overwrite the first one or would it add a second event?

    If you can add a second one, is there a limit to how many you add?

    Posted in: Galaxy Scripting
  • 0

    posted a message on qustion about bit operation and more

    Yeah, I know my operators, haha.

    And I believe that it works as well because I vaguely remember using a function for power, meaning that ^ is in fact, the bit operator for XOR.

    Posted in: Galaxy Scripting
  • 0

    posted a message on qustion about bit operation and more

    I use %, >>, << and can confirm those are working. ^ is reserved for power I think..? Not entirely sure.

    Posted in: Galaxy Scripting
  • 0

    posted a message on CreateEffect not working?

    Hmm, yes I'm aware of the fact that some effects do not have graphics associated with them... but as I've said, I have previously used previewer to see the graphic for the effect before I chose to use it, I wonder why it still didn't show...

    Anyway, I'll take your advice and try out other effects, thanks for the swift reply.

    Posted in: Triggers
  • 0

    posted a message on CreateEffect not working?

    Using:

    PlayerCreateEffectUnit(EventPlayer(), "FrenzyWeaponImpact", SomeUnit);

    I don't see any effect showing when it is actually ran. Being a complete effect newbie, all I did was search the effect up on previewer to grab that...

    How do I get this effect to show?

    Posted in: Triggers
  • 0

    posted a message on Weird array behaviour

    Yeah its in the map as imports.

    Thanks though, I managed to fix it... I'm so stupid that I didn't make a new instance, which is why the values are shared despite not being static.

    class Foo {
    int x;
    }
    
    static {
    	Foo[2] bar;
    	bar[0] = new Foo();
    	bar[1] = new Foo();
    	bar[0].x = 1;
    	TriggerDebugOutput(1, (text)bar[0].x, true);
    	bar[1].x = 2;
    	TriggerDebugOutput(1, (text)bar[0].x, true);
    }
    

    That is the proper way of doing it... which gives me 1, 1. I should read the language specification more...

    Posted in: Galaxy Scripting
  • 0

    posted a message on Weird array behaviour

    edit: scratch that... Here is a new map with only a sample code showing the problem.

    class foo {
    int x;
    }
    
    static {
    	foo[2] bar;
    	bar[0].x = 1;
    	TriggerDebugOutput(1, (text)bar[0].x, true);
    	bar[1].x = 2;
    	TriggerDebugOutput(1, (text)bar[0].x, true);
    }
    

    Static { } means it will start on map startup during initialization. It should say in the debugger window 1 then 1 but it shows 1 then 2... please have a look. The code in galaxy format is in the imports as Andromeda.galaxy.

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