From my experience the mod script refuses to do anything until it gets referrenced at least once by the map script.
Try to create an empty action definition within the mod and call it on map init from the map script. That should be enough to force the game to load the mods script.
Create a new trigger in your map and make it fire on map initialization, call it "Mod Script Init" or smth like that.
Add a new action. Search for "turn trigger" and select "Turn trigger on/off". Now, as trigger, select your non functional trigger from the mod file. Turn it on.
Save the map and restart the game, see if it works.
Note: Even though this might be confusing, we are not actually trying to turn the trigger on, we just try to reference stuff from the mod script to make it initialize. You do NOT need to repeat this procedure for every new trigger you add to your mod.
Also, you can just disable the trigger that you put in the map. The trigger editor only needs to have one reference to add the whole mod's trigger code to the map and that reference doesn't need to be in the code that the map has.
-> Make one trigger in your map that references something from the mod. Then disable your new trigger via "ctrl + i", so it won't appear in the final map. => Editor acknowledges the connection to the mod's triggers and adds them to the map.
(It doesn't really make 100% sense, but that's how it is working...)
Ok, hmm. I will apply the MOD file to a couple of maps. Would be easy if the trigger was only in the MOD-file, so I do not have to add triggers at all to each map.
Is it not possible to add another kind of event to the trigger so everything is "kept in the MOD-file"?
Ok, hmm. I will apply the MOD file to a couple of maps. Would be easy if the trigger was only in the MOD-file, so I do not have to add triggers at all to each map.
Is it not possible to add another kind of event so everything is "kept in the MOD-file"?
You add a reference within the map's triggers to the mod's triggers to each map and it will use the mod's triggers.
You should be able to just copy paste that trigger between the maps.
Here is what it looks like:
The action definition "Register Mod in Map" is empty. I've used a new, empty one for the referencing purpose to not accidentally delete it because that would make all maps not work anymore (I assume).
Then the init trigger in the mod will be executed as the mod's code is added to the map when played.
I upload my MOD file because I want to show you something. It already has two triggers. (Built by another person in this project, but he is not available to help me atm)
I do not need to add triggers to the individual maps to make it work.
Btw, if I need to add a trigger to each map anyway, can´t I just add the trigger immediately to each map? (No need to add it in the MOD-file at all)
It's not possible to copy paste everything related to triggers from one map to another. Also, it's more time consuming and with the new "use newest version" checkbox for dependencies, you won't ever need to update your maps, only your mod.
Regarding the mod... I've tested it and I've no idea. :o
That mod's triggers create the galaxy code that initializes the triggers... other mods don't.
When I copy paste the triggers, it's adding the initialization code, too... I'm a bit confused. :D
For some reason, this trigger works on every map, but it does not work when I add it in a Library in a MOD-file.
Events - Game - Map initialization Actions - Game - Set the global time scale to 0.95
I change the Event to Timer elapsed 1.0 second. But the trigger refuses to work when I use the MOD-file as a dependencie on a map.
Any idea what the problem might be?
From my experience the mod script refuses to do anything until it gets referrenced at least once by the map script.
Try to create an empty action definition within the mod and call it on map init from the map script. That should be enough to force the game to load the mods script.
I am very bad at triggers. Would you mind to clearify?
Okay, lets try this.
Create a new trigger in your map and make it fire on map initialization, call it "Mod Script Init" or smth like that.
Add a new action. Search for "turn trigger" and select "Turn trigger on/off". Now, as trigger, select your non functional trigger from the mod file. Turn it on.
Save the map and restart the game, see if it works.
Note: Even though this might be confusing, we are not actually trying to turn the trigger on, we just try to reference stuff from the mod script to make it initialize. You do NOT need to repeat this procedure for every new trigger you add to your mod.
Also, you can just disable the trigger that you put in the map. The trigger editor only needs to have one reference to add the whole mod's trigger code to the map and that reference doesn't need to be in the code that the map has.
-> Make one trigger in your map that references something from the mod. Then disable your new trigger via "ctrl + i", so it won't appear in the final map. => Editor acknowledges the connection to the mod's triggers and adds them to the map.
(It doesn't really make 100% sense, but that's how it is working...)
Ok, hmm. I will apply the MOD file to a couple of maps. Would be easy if the trigger was only in the MOD-file, so I do not have to add triggers at all to each map.
Is it not possible to add another kind of event to the trigger so everything is "kept in the MOD-file"?
You add a reference within the map's triggers to the mod's triggers to each map and it will use the mod's triggers.
You should be able to just copy paste that trigger between the maps.
Here is what it looks like:
The action definition "Register Mod in Map" is empty. I've used a new, empty one for the referencing purpose to not accidentally delete it because that would make all maps not work anymore (I assume).
Then the init trigger in the mod will be executed as the mod's code is added to the map when played.
When thinking about this, I'm really wondering if this is intended or some sort of bug. Its pretty weird.
Thank you for all your help.
I upload my MOD file because I want to show you something. It already has two triggers. (Built by another person in this project, but he is not available to help me atm)
I do not need to add triggers to the individual maps to make it work.
How can that be?
Btw, if I need to add a trigger to each map anyway, can´t I just add the trigger immediately to each map? (No need to add it in the MOD-file at all)
It's not possible to copy paste everything related to triggers from one map to another. Also, it's more time consuming and with the new "use newest version" checkbox for dependencies, you won't ever need to update your maps, only your mod.
Regarding the mod... I've tested it and I've no idea. :o
That mod's triggers create the galaxy code that initializes the triggers... other mods don't.
When I copy paste the triggers, it's adding the initialization code, too... I'm a bit confused. :D
edit: I've no idea why it's loading that... :X