In C + +, we can also pass values to the variables when we call a function/method.
Example Here:
string ello = reusethis ("hi",67);
My Question is why can't we do this in Galaxy?
It would make it a lot easier to code if this was true.
For instance, if I wanted a spawn system, I could create a function/method that gets sent an array of regions from a map, and returns a spawn number for units to be spawned. This could be placed in a Mod file, and be reused.
I think this would make coding in Galaxy much more worthwhile.
If you have any other reusable ideas, please post them here!
- ChosenOreo
P.S - If there is a way to do this, I haven't found it. If someone who does know about this could direct me to a resource that shows how, please, post that too!
Not that i've tried.. but if I read that correctly, we can't have triggers/script in mod files? I remember opening a mod file and opening the trigger window before though.. If it doesnt work, what kinda error does it give?
I suppose you could always export your script and import it into the mod then include it later. Thats the only other alternative I can think of. If it's really not possible then it kinda sucks. But TBH, I honestly see no reason why this is not doable
FuzzYD -
I forgot to add that triggering in Mod files isn't possible, but it should be. I had it in my head as I was writing this, but forgot to type it in.
Im pretty sure one of the tips when i start up the editor says that "trigger libraries included in a mod file can be used in maps that use that mod as a dependency", or something along those lines.
Why can't we use reusable functions/methods, and code triggers in Mod files?
Currently, we CANNOT put triggers in Mod Files!!
I feel we should be able to code reusable functions/methods in Mod files so we can reuse code many times without recopying or retyping.
FOR INSTANCE
In C + +, I can write (after importing headers and declaring namespaces):
string reusethis (string something, int somethingelse)
{
something = "hello!";
somethingelse = 567;
cout << "Variables are... " << something << " | " << somethingelse << endl;
string combine = "word is: " + something;
return combine;
}
In C + +, we can also pass values to the variables when we call a function/method.
Example Here:
string ello = reusethis ("hi",67);
My Question is why can't we do this in Galaxy? It would make it a lot easier to code if this was true.
For instance, if I wanted a spawn system, I could create a function/method that gets sent an array of regions from a map, and returns a spawn number for units to be spawned. This could be placed in a Mod file, and be reused.
I think this would make coding in Galaxy much more worthwhile.
If you have any other reusable ideas, please post them here!
- ChosenOreo
P.S - If there is a way to do this, I haven't found it. If someone who does know about this could direct me to a resource that shows how, please, post that too!
Not that i've tried.. but if I read that correctly, we can't have triggers/script in mod files? I remember opening a mod file and opening the trigger window before though.. If it doesnt work, what kinda error does it give?
I suppose you could always export your script and import it into the mod then include it later. Thats the only other alternative I can think of. If it's really not possible then it kinda sucks. But TBH, I honestly see no reason why this is not doable
FuzzYD - I forgot to add that triggering in Mod files isn't possible, but it should be. I had it in my head as I was writing this, but forgot to type it in.
- ChosenOreo
@ChosenOreo: Go
Any plans to try explorting a .galaxy file and importing it into the mod for later callback? I'm about 90% certain it should be possible.
@FuzzYD: Go
.galaxy files for whatever reason aren't including as part of the MPQ hierarchy between mod and map. So, that doesn't work. :(
Triggers do work in mod files (and in maps that include those mods). Create a library in that mod.
Also, stuff like this:
it works if "SomeCustomWrittenFunction" is in a library (they get defined before any other code).
Im pretty sure one of the tips when i start up the editor says that "trigger libraries included in a mod file can be used in maps that use that mod as a dependency", or something along those lines.
@Tolkfan: Go @TheAlmaity: Go
Thats good to know. I'll probably play around with that and figure out how it works when I can find the time.
Yes, you need to put all your stuffs into a library and import that into your mod.
But mods suck in general. Updating a mod and updating the maps using that mod is tedious <.<