Jump to content

Need a batch patch code for setup.tp2


deratiseur

Recommended Posts

hello :)

 

I don't understand codes like

"COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~

PATCH_IF (SOURCE_SIZE > 0x71) BEGIN"

So i need your help again, please.

 

I need a batch code for my setup.tp2 which make :

 

If a creature has a belt equipped, make this creature immunited to effect 143.

Link to comment
I don't understand codes like

"COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~

PATCH_IF (SOURCE_SIZE > 0x71) BEGIN"

Well, the first command line says to copy the existing game resources that all end with the ".itm" end(so all items) to the override folder...

The second line says that that the mod should only do so if the file is larger than the minimum .itm file size, so this prevents errors.

 

I need a batch code for my setup.tp2 which make :

If a creature has a belt equipped, make this creature immunited to effect 143.

Now, is this only to a one specific item, or all the belts, or every item in the game ?

As the "a creature" means any creature, "a belt equipped" means "any belt equipped" under the sun... which I don't think you want. But I wouldn't know...

 

I would give you the code, but I need to test it when I have somewhat more time first... %¤& ok, so it would basically go like this:

COPY ~modfolder/********.itm~ ~override/********.itm~ //customize this line
ADD_ITEM_EFFECT
//SET type ~3~					 //doesnt need to be set
SET opcode ~101~
SET target ~1~
SET timing ~2~
SET parameter1 ~0~			  //should be irrelevant
SET parameter2 ~143~
SET power ~0~
SET resist_dispel ~0~
SET duration ~0~

Yeah, totally untested...

Link to comment

OK, thanks :)

 

I will try with "ADD_CRE_EFFECT

 

The idea is to have : if ANY creature have ANY belt equipped, made THAT creature immune to effect 143.

The fact is that one of my mod's creature use a "on death" condition on the opponent it strike. The idea is to made this without add a script to the striked opponent (risking alter a natural script), so my creature's weapon have a #143 effect : add a belt to belt slot. And the belt have a effect #232, cast spell at condition : life, "myself", -10%.

This work. On strike, my creature add the item, and the opponent has the spell casted on death.

 

The idea of the batch patch is to immune all creatures wearing a droppable belt (Girdle of Fortitude, Girdle of Frost Giant Strength, Girdle of Bluntness, etc) to the effect of my creature, for not lose the drop.

Link to comment

Uuuh, ok, so you do need to use the COPY_EXISTING...

COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
 READ_SHORT "0x1c" "type"
 PATCH_IF ("%type%" = "0x0003") BEGIN	//the belts
ADD_ITEM_EFFECT
//SET type ~3~				//doesnt need to be set
SET opcode ~101~
SET target ~1~
SET timing ~2~
SET parameter1 ~0~			//should be irrelevant
SET parameter2 ~143~
SET power ~0~
SET resist_dispel ~0~
SET duration ~0~
END
 END
BUT_ONLY

Should work... can't test this though, so shoot me if it doesn't.

Link to comment

What he's asking is to patch all creatures that have a belt equipped, not patch all belts. He has a weapon that creates belts on creatures it hits. If a creature is already wearing a belt, he doesn't want that belt to get overridden by his, so he's trying to give those creatures immunity to the effect of his weapon.

 

Deratiseur, I might suggest you make your item cast a spell (opcode 146) and have that spell equip the target creature with your belt. Then, patch all creatures that already have belts with opcode 206, protecting them from being affected by your spell. This way those creatures can still be affected by anything else that uses opcode 143.

Link to comment
What he's asking is to patch all creatures that have a belt equipped, not patch all belts. He has a weapon that creates belts on creatures it hits. If a creature is already wearing a belt, he doesn't want that belt to get overridden by his, so he's trying to give those creatures immunity to the effect of his weapon.

 

Deratiseur, I might suggest you make your item cast a spell (opcode 146) and have that spell equip the target creature with your belt. Then, patch all creatures that already have belts with opcode 206, protecting them from being affected by your spell. This way those creatures can still be affected by anything else that uses opcode 143.

 

Really thanks, you have understand what i need, and your idea is really good. I've tried, it's work.

Now i have a creature with a weapon which cast a spell on strike (pxb6cro1.spl), this spell add a belt to the striked victim, and the belt cast a spell on the victim death

 

So now, i need a code to patch all creature that have a belt equipped, give those creatures immunity to the spell pxb6cro1.spl.

 

Wow, i work on no so easy kits.

Link to comment

You don't need to use an item (belt) in the first place, for the same can be achieved with placing the 232 directly from a weapon. If you hit a party member with it, he won't lose a belt he might have equipped during the game.

 

PS And yes, do you need a weapon that causes an affliction of sort, so that any following killing blow will have additional effect, or do you want only this specific weapon to kill more spectacularily? If it's the latter, then it is doable in a more efficient way, as I've learned not too long ago.

Link to comment
You don't need to use an item (belt) in the first place, for the same can be achieved with placing the 232 directly from a weapon. If you hit a party member with it, he won't lose a belt he might have equipped during the game.

 

PS And yes, do you need a weapon that causes an affliction of sort, so that any following killing blow will have additional effect, or do you want only this specific weapon to kill more spectacularily? If it's the latter, then it is doable in a more efficient way, as I've learned not too long ago.

 

my first try of the weapon use the 232, and so only when the creature wearing the weapon killed the victime cast the spell.

I has the idea of the belt (the less equiped item for creatures) for have the victime be killable by everyone after been hit by the weapon.

The spell is "change statut to undead, change statut to ally, cure all dispelable effects, change name, restore 3D8 hp and raise dead". so the victime become a zombi with a few hp.

 

It work perfectly. But i always have the matter to avoid belts drops overidden.

Link to comment

COPY_EXISTING_REGEXP GLOB ~.+\.cre~ ~override~
 PATCH_IF SOURCE_SIZE>0x2d3 BEGIN
READ_SHORT (LONG_AT 0x2b8)+14 belt
PATCH_IF belt != 0xffff BEGIN
  LPF ADD_CRE_EFFECT
  INT_VAR
	opcode=206
	timing=1
  STR_VAR
	resource=pxb6cro1
  END
END
 END
BUT_ONLY

 

I, however, think it's better to not create a belt (which can be equipped during the game process), but instead apply the condition trigger (232) from weapon. Weapon uses 146 on target, the resource (pxb6cro1) contains required 232 and immunity to itself.

Link to comment
I, however, think it's better to not create a belt (which can be equipped during the game process), but instead apply the condition trigger (232) from weapon. Weapon uses 146 on target, the resource (pxb6cro1) contains required 232 and immunity to itself.

 

Thanks a lot fot the complete code. I have reinstalled and tried, it's work.

The idea you have was the first i has, made, and tried. The spell cast cannot trigger the condition with a duration, so the raise dead cannot be perfomed if it isn't the creature with the weapon who kill the victime (giving the final hit). In this case the trigger occur, but just a this time.

 

What i would was a weapon which "infest" the victim, after what if the victim die (by anything), the raise dead spell is cast, changing it by a controlled zombi. But i've never success in my attempts of using the 232 and 272 with a duration in a spell casted by the weapon or in the weapon. It seems that the game doesn't count duration.

 

For exemple, i have try to remake the "Brain spider" (creature from Monstrous Compendium Annual Vol 1). His attack paralyse the victime and the poison destroy 1 point of int or dex each round. For this i need the 272, but it doesn't work. Not as an effect of the weapon and not as an effect of a spell cast by the weapon.

So i has the idea of an item, with the effect 272 "while equipped", and this work.

But i reserve this solution for the "zombifying" creature -> the problem is still unsolved for the Brain spider.

 

Edit : cannot use 232 with duration because the duration is automaticly stopped when the creature die.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...