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 .





Retour en haut







