Aller au contenu

Photo

Testing compatibility?


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

#1
dr.drummie

dr.drummie
  • Members
  • 51 messages
hi!
a question for all modders who still watching this forum: how do you test compatibility for your mods?
I was playing with overriding events few days ago, and by following wiki i tried to create some simple override of few events in game, and i found some interesting things which confused me little more about testing and compatibility..
since i'm trying to create addon for main campaign, I needed to override few events from module_core, so i created a mymod_module_core script in form:

#include "utility_h"
#include "wrappers_h" 
#include "events_h" 
void main(){
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    string sDebug;
    object oPC = GetHero();
    object oParty = GetParty(oPC);
    int nEventHandled = FALSE;
    switch(nEventType)
    {         
          case EVENT_TYPE_UNIQUE_POWER:
         {
             //Floaty message here... 
             nEventHandled = TRUE; //set this if no further action is required for this event
             break;
         }
    }
    if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
    {
        HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
    }


so this was working fine (i created simple item like bomb with ability UNIQUE_POWER_UNLIMITED_USE for testing).. but accidentaly I loaded some old save i guess when i was first time get in camp (lothering still was enabled on world map), so i get back in lothering to pick up leliana and sten, and after battle with loghains men it was impossible to finish conversation with her, game would slow down and was non-responsible.. but in dialog with sten no problems at all!after disabling my mod and playing again same thing, everything went fine with leliana..

after that i changed approach and tried to override this event with gda file so i created new engineevents_mymod.gda, put it in module override also i put inside another event to override (inventory added just to test if this work), and i got confirmation that this works (another floaty message when i pick up something), but event type unique power does not trigger there, so i needed to get back on beginning with module core script..
after few tries and misses i found that last statement:

if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
    {
        HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE);
    }
 
is causing problems with leliana dialog.. when this is not in module core script, that conversation in lothering runs fine.. and that's confuses me much.. so i finish this with:

#include "utility_h"
#include "wrappers_h" 
#include "events_h" 

void main(){
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    string sDebug;
        object oPC = GetHero();
    object oParty = GetParty(oPC);
      int nEventHandled = FALSE;
     switch(nEventType)
    {
         case EVENT_TYPE_UNIQUE_POWER:
         { 
           //Floaty message here...
             if (sItemTag == "kivsptest_dwarf_explosive")
             {
                DisplayFloatyMessage(GetHero(), "UNIQUE POWER!", FLOATY_MESSAGE, 14654488, 10.0);                                   nEventHandled = TRUE;
              }
             else
             {
                HandleEvent(ev, RESOURCE_SCRIPT_MODULE_CORE); // this passes the event to the default handler of the event's target object
             }
             break;
         }
    }
}
and this (I believe) is doing same thing (surely it runs normal and there is no problem with leliana in lothering anymore), but i'm not sure. so if anyone have little more knowledge and will to explain how he/she test and maintain compatibility with main campaign and other mods, i would be grateful..
just to mention that i uninstalled every other mod so it is just singleplayer and my mod there to avoid possible problems with compatibility.. cheers!

Modifié par dr.drummie, 06 novembre 2012 - 04:59 .


#2
sea-

sea-
  • Members
  • 264 messages
Old save files don't work well with mods at all because most things are loaded into the save permanently. As far as I know there is no way to really help this other than "start a new game."

Modifié par sea-, 07 novembre 2012 - 07:12 .


#3
dr.drummie

dr.drummie
  • Members
  • 51 messages
that's plausible, but I also tried opposite thing, so I uninstalled my mod, went back to early save (where i didn't have anything connected to my mod), start playing again, then install my mod again, same things.. but as I saw in your other post, you have non logical situation cause you didn't touch any resource and same resources suddenly stop to function, same here, talking to leliana is impossible as long I have "if statement" at the end of my module core script (other things works completely normal).. as i'm aware this kind of irregularities are not so strange to happen, it would be nice to have a way to catch them..

#4
MerAnne

MerAnne
  • Members
  • 1 157 messages
As soon as someone says "I needed to override few events from module_core" I don't believe it can be considered compatible with the main game or with other mods that rely on specific events to be handled in the standard way by DAO.

How to figure out exactly what will be impacted by your overrides is a different question. What do you HAVE to override?

#5
dr.drummie

dr.drummie
  • Members
  • 51 messages
yes, but I wonder how original DLCs has been created.. currently I want (need) to override EVENT_TYPE_UNIQUE_POWER and EVENT_TYPE_ITEM_AQUIRED, cause in my mod I definitely want to have some plot item (key / cristals/ etc..) and also item with unique power, for unique power items I guess it is possible to create gda with item properties and call script when item is used, but i'm not sure what about acquiring item event?

#6
MerAnne

MerAnne
  • Members
  • 1 157 messages
I don't think you need to override anything to keep track of plot/plot items. I suggest this link as a start: http://social.biowar...sation_tutorial It has a section named: Keeping track of quests via plots There are ways of using plot items, but I've not worked with them. I suggest reading the various tutorials on the Toolset wiki, especially before overriding any of the core scripts.

For unique power, it depends on what the unique power is.

#7
Karma

Karma
  • Members
  • 391 messages
There used to be a mod floating around for making overriding events compatible with other mods. I think the link is: http://social.biowar...m/project/1907/ I don't know much about it, but you could check it out. See if it fits your needs.

#8
dr.drummie

dr.drummie
  • Members
  • 51 messages
thanks, gonna play with that project to see and compare..