Compatibility patches...

Post » Sun May 01, 2011 7:07 pm

So what is the procedure for making your mod compatible with another mod by a patch? For instance if you had custom bedrolls, and you want them to be compatible with NOM? I know they need the right script, but do you load both mods and create bedrolls with the right script (assuming you have the right permissions), or what?
User avatar
sara OMAR
 
Posts: 3451
Joined: Wed Jul 05, 2006 11:18 pm

Post » Mon May 02, 2011 4:55 am

It really depends on the mods, the nature of the incompatibility, and the modders' preferences and permissions.

You could make a bedroll NoM-compatible by adding NoM info to your patch mod (a dummy script is needed IIRC, and probably a global or two), and specifying that the patch load after your mod but before NoM. Or you could load your mod with NoM, create the patch and then it would generally have to load after both your mod and NoM. Either way would work.
User avatar
Emma
 
Posts: 3287
Joined: Mon Aug 28, 2006 12:51 am

Post » Sun May 01, 2011 8:58 pm

It really depends on the mods, the nature of the incompatibility, and the modders' preferences and permissions.

You could make a bedroll NoM-compatible by adding NoM info to your patch mod (a dummy script is needed IIRC, and probably a global or two), and specifying that the patch load after your mod but before NoM. Or you could load your mod with NoM, create the patch and then it would generally have to load after both your mod and NoM. Either way would work.


Thanks! I've never done it before, and while I had some concept, I didn't know the particulars. Whoever said "ignorance is bliss" never tried modding, eh?

If the first option is used, all you would do is name the dummy script the same name as NoM's script, then attach the dummy script to the bedroll, and NoM would overwrite it, right? Then wouldn't NoM add the needed globals as well?
User avatar
Imy Davies
 
Posts: 3479
Joined: Fri Jul 14, 2006 6:42 pm

Post » Sun May 01, 2011 7:45 pm

NoM bedrolls are a bit more complicated than that. When you drop the bedroll, it starts another script and deletes itself. Then another object is placed, and this is the bedroll you can sleep on. So to add a bedroll that looks different or behaves differently, you need to script all that yourself, so the player ends up with your bedroll instead of the default.

If you wanted to use the default NoM bedroll, btw, you don't need a patch - just use the bedroll from NoM, same ID and everything, and make sure NoM loads later. It will add the scripts to the bedroll.
User avatar
Rhiannon Jones
 
Posts: 3423
Joined: Thu Sep 21, 2006 3:18 pm

Post » Mon May 02, 2011 12:46 am

I'm kind of dealing with a bad case of project bloat... I started out to make a mod that was essentially a portable ashlander yurt with placable containers and a lightable firepit. I now have the firepit, two yurts like that of exotic material and colors, 3 portable open air tents of different colors on the order of mournhold bazaar tents, 4 bedrolls of varying color and materials, a collection of urns, baskets, and chests that can be moved around in the yurt without losing the contents, and last but not least, what appears to be turning into a major quest...

...and since I'm putting all this effort into it, I want it to make the most of NoM and MCP effects if I can. hence my question. So, if I created a dummy script for the token that places the bedroll and named it with the same name as the NoM ID, and found the script that places the bedroll and put in my IDs, NoM would then overwrite that and it would be lost anyway, wouldn't it? How can you get around that unless you load it with NoM as per your second suggestion?

I don't really thinnk Taddeus would object, but I haven't mentioned it to him yet... the whole thing just kind of happened in the last few days.
User avatar
Javaun Thompson
 
Posts: 3397
Joined: Fri Sep 21, 2007 10:28 am

Post » Mon May 02, 2011 3:09 am

Well, I've had a look at the NoM scripts and the important one is this one (attached to the activator bedroll that gets placed when you drop the inventory token):
begin NOM_bedroll_sleep;--Bedroll on ground.;  This bedroll replaces the regular (inventory) bedroll when the regular;  bedroll is dropped.short state0 ;--Unusedshort stateshort buttonshort apphourshort currentHourshort delCounter;--Activate (Usage menu)if ( state == 0 )	if ( OnActivate )		set button to -1		set state to 10		messagebox "What do you want to do?" "Rest" "Take"	endif	return;--Handle usage menuelseif ( state == 10 )	set button to GetButtonPressed	if ( button == -1 )		return	elseif ( button == 0 )		ShowRestMenu		set state to 30	elseif ( button == 1 )		player->AddItem "NOM_bedroll_misc" 1		Disable		set state to 40		return	endif;--PC Restingelseif ( state == 30 )	set apphour to GameHour	if ( MenuMode == 0 )		set state to 0		set state to 0		set NOM_sleeping to 0		StartScript NOM_sleep_penalties	endif	if ( NOM_sleepactive == 0 )		set NOM_sleep to 0		return	endif	if ( GetPCSleep )		if ( NOM_sleeping == 0 )			set NOM_sleeping to 1		endif		if ( currentHour != apphour )			set currentHour to apphour			set NOM_sleep to ( NOM_sleep - 1 )			player->ModCurrentHealth 2		endif	endif;--Will deleteelseif ( state == 40 )	set delCounter to ( delCounter + 1 )	if ( delCounter > 25 )		StopScript "NOM_bedroll_sleep"		SetDelete 1	endif	set state to -1endifend


The point of a patch would be to make your bedrolls do the same things this one does. So you'll need all the globals and scripts used in that, probably.
User avatar
Damned_Queen
 
Posts: 3425
Joined: Fri Apr 20, 2007 5:18 pm


Return to III - Morrowind