Aller au contenu

Photo

IMPORTANT for all modders!!!! Tutorial to ensure your Awakening mod will not break Origins and vice versa!!! (includes screenshots and script code)


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
DLAN_Immortality

DLAN_Immortality
  • Members
  • 481 messages
I'm hoping to save my modding friends some time.

As some of you know, yesterday I had an utterly crappy day when my game completely broke for both Origins and Awakening, plus my two mods. Yes, I was enraged, Arr!

But here's a tutorial so you don't have to go through the problems I had to fix, and waste the time I had to waste to find a solution!


Remember: IT'S YOUR RESPONSIBILITY TO ENSURE YOUR MOD DOES NOT BREAK THE GAME, THE EXPANSION, DLCS, OR OTHER MODS!!



The problem:

- While working in my Origins mod, and then on my Awakening mod, I realized that my Origins mod was breaking Awakening (scripts were not triggering, and even objects were moving around!).

- In the same way, my mod for Awakening was interfeering in Origins, breaking it (wrong scripts triggering, destroying the party recruiting).



The objective:

- Prevent the Origins mod to interfere with Awakening. If your mod is for Origins, it should only work in Origins.

- Prevent the Awakening mod to interfere with Origins. If your mod is for Awakening, it should only work in Awakening.

- If you have one mod for both, to ensure that the Origins part triggers in Origins and Awakening part in Awakening.



Procedure:


1- Ensure your Origins mod is for Origins only!

NEVER EVER EVER set your core scripts or handling scripts as Core Game Resources. NEVER!

There's absolutely no need for your scripts (especially your module core) to be a core game resource.

This means that whenever you create a mod for origins you should always set the properties of your major handling scripts as "Module: your module", and "Owner Module: your module". NEVER as a core game resource. Otherwise they will interfere with awakening and will break it (make no mistake, they will).

Example:

This is how you set your Origins module:
Posted Image


This is how you set all your script's properties:
Posted Image


2- Ensure your Awakening mod is for Awakening only!

Things are different for Awakening because you DO have to set all your materials' properties as "Module: Core Game Resources", and "Owner Module: your module". (read the tutorial if you need to know more.)

This means that your Awakening mod will interfere with Origins and will break the game.

We will use a plot flag check to ensure that your module core script and handling scripts only trigger in Awakening.

You should insert this code in all your handling scripts:


 if(!WR_GetPlotFlag("C0B7199C74CA4B67B143ACA8CDCFCF9D",0, TRUE))
        return;

Where "C0B7199C74CA4B67B143ACA8CDCFCF9D" is actually gxa000pt_awakening,plo, and "0", is "GXA_AWAKENING_START", but you can use any other Awakening plot that you may need.

Please read this tutorial to learn how to mod using Awakening's plot flags.

(For for people who don't know how to script, like me, this tells the game not to run the script unless GXA_AWAKENING_START is true.)


Screenshots of my Awakening handling scripts with the code inserted:



Posted Image

Posted Image




And as always... BE CAREFUL! :-)

If you want to read my other tutorials, check here: http://social.biowar...ategory_id=1123

#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
Immortality, have you tried using IsUsingEP1Resources() [returns TRUE or FALSE] instead of that plot flag check?

Just to give some background - Origins code itself has a lot of code that was written for Awakening and in all cases, they use this function to check if Awakening is being used or not.

Modifié par TimelordDC, 15 novembre 2010 - 08:23 .


#3
DLAN_Immortality

DLAN_Immortality
  • Members
  • 481 messages
I haven't tried, I didn't even know that function! I reckon it has to work better than the code I put there.

I'll make a try. Thanks! :-D

Ultimately, though, we have to stress that a check has to be introduced! :-)

Modifié par DLAN_Immortality, 15 novembre 2010 - 08:28 .


#4
Proleric

Proleric
  • Members
  • 2 356 messages
Thanks for a really useful illustration. We've been trying to capture this sort of concept in the compatibility wiki article - you might like to add to it.

#5
DLAN_Immortality

DLAN_Immortality
  • Members
  • 481 messages
EDIT: Done and looking good. :-)

Modifié par DLAN_Immortality, 16 novembre 2010 - 08:49 .


#6
ladydesire

ladydesire
  • Members
  • 1 928 messages
An idea for the Awakening scripts (I haven't tried this yet, but it should work); instead of making them Core Game Resources (core), make them Core Expansion Resources (core_ep1). it would mean making another project in the toolset, but the bonus is that it would enable them to work in non-Awakening modules like Golems of Amgarrak or Witch Hunt that support high level character abilities.

#7
DLAN_Immortality

DLAN_Immortality
  • Members
  • 481 messages
It doesn't work. I've tried it.



What happens is that a new "mod" becomes activated, called "dao_prc_ep1", which is in truth your fake mod, that conflicts with the real Awakening, plus my own Awakening scripts do not work. This was when I finally reached out to Noob766 to give me a hand, because I was going crazy with the mod and materials properties.



After everything I tried, the only way I could make my mod work was setting Awakening like this> http://social.biowar...295/blog/10858/ And the scripts as I mentioned above.



Right now, if your Awakening scripts are set to Core Game Resources, they will work in all DLCs and Origins. And that's why it's important to introduce the checks in them, in order to only work in Awakening. Additionally, you could also expand the checks to work with other DLCs in the same manner, just enter an "or" ( || ) in the condition.

#8
DLAN_Immortality

DLAN_Immortality
  • Members
  • 481 messages
I've made another addendum after a script kept messing in Origins (even though the check was implemented).



***



Addendum: If you have copy-pasted scripts, for example your follower join script, it can still mess your Origins mod, even with the checks implemented!!!



In order to avoid this, you can rename your functions.

For example, if your Origins script has the function "SetFollowerInParty", then rename the function in your Awakening script to "SetFollowerInParty_awakening", and etc.

#9
Anadra Jadin

Anadra Jadin
  • Members
  • 8 messages
Immortality, I think the reason you had so many compatibility problems is because (at least according to your tutorial) you're extending the awakenings mod in the origins campaign's hierarchy, meaning that the origins campaign loads them, not your awakenings. That's also why you need to set all your awakenings resources to core, because the game's not looking in the right place, all those extra measures to make your scripts work are unecessary.

From what I understand, you should extend the Awakenings mod to dao_prc_ep_1 in the module hierarchy *as well as* extended module, and set all your awakenings scripts (without the additions you've used to distinguish) as module resources. But maybe not, I haven't tried it, it just seems a long way round

Edit: Just found out why, it's a big big game-breaker.

Modifié par Anadra Jadin, 13 avril 2011 - 11:49 .