Skip to content

General mod Questions thread

1272830323370

Comments

  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    Is there a way to temporary remove all the effects from a creature's equipment while this is polymorphed?
  • kjeronkjeron Member Posts: 2,367
    @Luke93 if copying the item itself isn't practical for your purposes:
    COPY_EXISTING	~RING95.ITM~	override
    	READ_LONG	0x6a	fx_off
    	READ_SHORT	0x6e	glob_idx
    	READ_SHORT	0x70	glob_fx
    	READ_ASCII	(fx_off + glob_idx * 0x30)	(glob_fx * 0x30)	eq_effects
    BUT_ONLY
    COPY_EXISTING	~(otheritem).itm~	override
    	READ_LONG	0x6a	fx_off
    	READ_SHORT	0x6e	glob_idx
    	WRITE_LONG	0x70	(THIS + glob_fx)
    	INSERT_BYTES	(fx_off + glob_idx * 0x30)	(glob_fx * 0x30)
    	WRITE_ASCIIE	(fx_off + glob_idx * 0x30)	~%eq_effects%~	(glob_fx * 0x30)
    	READ_LONG	0x64	ab_off
    	READ_SHORT	0x68	ab_num
    	FOR	(i = 0; i < ab_num; ++i)	BEGIN
    		WRITE_SHORT	(ab_off + i * 0x38 + 0x20)	(THIS + glob_fx)
    	END
    
  • The user and all related content has been deleted.
  • RaduzielRaduziel Member Posts: 4,714
    I want to make a spell that can be used one time only. Once used, the spell vanishes forever.

    How do I do that?
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535

    Luke93 said:

    Can I give a kit the possibility to trigger a certain effect every time it scores a Critical Hit with a specific weapon (e.g., a mace)?

    You would have to patch all weapons matching your criteria (e.g. maces), adding an equipping effect for 177 targeting your kit, and give the triggered .EFF the critical hit effect opcode with timing mode 2. Pretty sure that should work.
    What about ranged weapons (e.g., bows)? I'd like to prevent this unintended side effect, but the following doesn't seem to work:
    341 (critical hit effect) --> 249 (ranged hit effect) --> 146 (cast spell)
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    Raduziel said:

    I want to make a spell that can be used one time only. Once used, the spell vanishes forever.

    How do I do that?

    Try using opcode #172 (Remove spell) with timing mode 1 or 9.....
  • [Deleted User][Deleted User] Posts: 0
    edited July 2018
    The user and all related content has been deleted.
    Post edited by [Deleted User] on
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited July 2018


    That only happens because those bracers are an equipped piece of clothing (bracers). If you put the crit effect into a melee weapon it will work fine, because when you switch to a missile weapon you "unequip" the melee weapon.

    Sorry but I don't understand.... Are you saying it is possible to fix that issue for ranged weapons (it's never been an issue for melee weapons if I understood well, i.e.: opcode #248 is not needed....)? If so, how? As I said, my previous solution doesn't seem to work.....
  • RaduzielRaduziel Member Posts: 4,714
    edited July 2018
    Using Opcode 172 in Casting Features: spell doesn't appear anywhere to be cast

    Using Opcode 172 in the effects: spell does nothing. It is not cast, the character just remains as it was about to take an action and comes back to normal.

    ---

    Just to clarify what I want: to give a weapon to a kit. I've tried it through AP_Spell using Opcode #122 and it works... for a character created in Lv 1 (the level that I assign the AP_Spell).

    If I create the character in BGEE or IWD, the weapon is there. If it is created in IWD, the weapon is there.

    Created in BG2EE or ToB, nothing.
  • The user and all related content has been deleted.
  • RaduzielRaduziel Member Posts: 4,714
    edited July 2018
    @subtledoctor

    My text was not good, sorry.

    The spell (let's call it K) currently has two effects:

    122 -> Create Weapon X

    172 -> Removes K.

    Neither happens.

    ---

    How can I do to append to the area script a command to create this weapon in the golem's room if someone in the party has the kit?

    Beautiful solution, by the way.
  • kjeronkjeron Member Posts: 2,367
    @Raduziel If the spell is going to be cast manually, it cannot have a level of 0.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited July 2018
    @subtledoctor

    I'd like my kit to be able to deal additional magic damage (via opcode #12) whenever he/she scores a critical hit with bows. The problem is that this time I cannot strictly follow your previous advice (equipping 177 ---> 341 ----> .SPL with melee ability containing opcode #12) because I'd like to avoid that issue (i.e., "Ranged Weapons with Critical Hit Effects through opcode 341 trigger those effects immediately upon the attack roll, rather then when the weapon strikes its target, effect is preceding the cause".)

    Having said that, I think the issue can be fixed by combining opcode #249 and #341 (summoning also @kjeron ........)
  • The user and all related content has been deleted.
  • RaduzielRaduziel Member Posts: 4,714
    edited July 2018
    Ok, I'm confused.

    I have the following piece of coding:
    //Giant Insects

    ACTION_IF !FILE_CONTAINS_EVALUATED(~SPELL.IDS~ ~CLERIC_GIANT_INSECT~) BEGIN

    ADD_PROJECTILE ~DeitiesofFaerun/Lib/Spheres/Import/GiantInsect/IDPRO282.PRO~

    COPY_EXISTING ~IDPRO282.PRO~ ~override~
    WRITE_LONG 0x0030 RESOLVE_STR_REF (@999997)

    LAF cd_new_summon_table STR_VAR descript = "GIANT_INSECT" 2da_file = GINSECT RET GINSECT = table END
    ADD_SPELL ~DeitiesofFaerun/Lib/Spheres/Import/GiantInsect/SPPR418.spl~ 1 4 CLERIC_GIANT_INSECT
    SAY NAME1 @999993 SAY NAME2 @999993 SAY UNIDENTIFIED_DESC @999994 SAY DESC @999994
    TEXT_SPRINT spell_res ~%DEST_RES%~ TO_UPPER spell_res
    WRITE_ASCIIE 0x3a ~%spell_res%C~ #8
    LPF ALTER_SPELL_HEADER STR_VAR icon = EVAL ~%spell_res%B~ END
    LPF ALTER_EFFECT STR_VAR silent = 1 match_resource = EVAL ~%SOURCE_RES%~ resource = EVAL ~%spell_res%~ END
    LPF ALTER_EFFECT INT_VAR match_opcode = 331 parameter2 = GINSECT END

    COPY ~DeitiesofFaerun/Lib/Spheres/Import/GiantInsect/SPPR418B.BAM~ ~override\%spell_res%B.BAM~
    COPY ~DeitiesofFaerun/Lib/Spheres/Import/GiantInsect/SPPR418C.BAM~ ~override\%spell_res%C.BAM~

    COPY ~DeitiesofFaerun/Lib/Spheres/Import/GiantInsect/GINSECT.2DA~ ~override~

    COPY ~DeitiesofFaerun/Lib/Spheres/Import/GiantInsect/GISBORB.CRE~ ~override~
    SAY NAME1 @999995 SAY NAME2 @999995

    COPY ~DeitiesofFaerun/Lib/Spheres/Import/GiantInsect/GISBOMB.CRE~ ~override~
    SAY NAME1 @999996 SAY NAME2 @999996

    COPY ~DeitiesofFaerun/Lib/Spheres/Import/GiantInsect/SPIN191.spl~ ~override~
    LPF ALTER_SPELL_HEADER INT_VAR projectile = %IDPRO282% END
    LPF ALTER_EFFECT INT_VAR match_opcode = 139 match_parameter1 = 34527 parameter1 = RESOLVE_STR_REF (@999997) END
    LPF ALTER_EFFECT INT_VAR match_opcode = 139 match_parameter1 = 35568 parameter1 = EVAL "%RA_Stunned%" END

    END
    The problem: it installs perfectly in BG2EE, but fails to install in BGEE.
    ERROR: Failure("resource [IDPRO282.PRO] not found for 'COPY'")
    Please make a backup of the file: SETUP-DEITIESOFFAERUN.DEBUG and look for support at: Raduziel



    It's the exact same file with the exact same code for both games.

    Ideas?
  • kjeronkjeron Member Posts: 2,367
    @Raduziel
    In BGEE, IDPRO282 is listed in PROJECTL.ids, but no such file exists in the game. ADD_PROJECTILE doesn't work if the projectile is already listed in PROJECTL.ids. Try using the projectile function I gave you earlier for it instead.
  • RaduzielRaduziel Member Posts: 4,714
    Thanks, I will!
  • RaduzielRaduziel Member Posts: 4,714
    edited July 2018
    Let's say I wanna make an aura effect that affects every party member in a 10 ft radius (but not the "caster"), but only takes place during a combat (which means: start its effects when the combat starts, cease it, as well as removing its effects, once the combat ends).

    Is it possible? Opcode 232 gives me options of Seeing Enemy and Attacked By, but my idea would be to fire this spell when YOU start attacking, not the other way around.

    Edit: What I can do so far

    10 ft radius: I'll use an adapted version of the Invisibility 10 ft projectile;

    Except for caster: I'll use the "Exclude original caster" target for the spell;

    The spell per se;

    The aura effect;

    Which means that my problem is the firing condition.

    Thanks.
  • The user and all related content has been deleted.
  • RaduzielRaduziel Member Posts: 4,714
    edited July 2018
    @subtledoctor

    A pure and simple Opcode 206 having the first aura as the resource you mean?

    Sounds elegant and simple (well, after the idea is presented I mean, I would not have this idea).
    Post edited by Raduziel on
  • [Deleted User][Deleted User] Posts: 0
    edited July 2018
    The user and all related content has been deleted.
  • RaduzielRaduziel Member Posts: 4,714
    Thanks!

    For the Opcode 232:
    Target = 1  Timing = 9  P1 = 0  P2 = 20  Extra = 102
    Is that correct?
  • ArunsunArunsun Member Posts: 1,592
    How do I make an event trigger upon resting (like the dreams, for instance), and one just after resting (Like the post-dream dialogues that we see in many mods)?
    I could only find one trigger (0x0093 PartyRested()) that, I assume, does one or the other
  • BubbBubb Member Posts: 1,000
    edited July 2018
    I've come up with some hex edits to the BG2EE v2.5.16.6 exe in order to add some new LUA commands; my question is this: am I allowed to distribute a mod that directly modifies the executable of the game? I feel like this is a bit of a gray area in terms of acceptance, and I wanted to hear everyone's opinion before I move forward...

    Edit: I'm sure the community wouldn't have a problem with it; I am more concerned about Beamdog taking issue with modifying their executable.
  • [Deleted User][Deleted User] Posts: 0
    edited July 2018
    The user and all related content has been deleted.
  • argent77argent77 Member Posts: 3,434
    I can't say much about the legal situation today, but a good number of mods (e.g. TobEx, Widescreen mod or some PS:T mods) patched the game executable to add new features or remove certain restrictions back in the days without getting into trouble.
  • ArunsunArunsun Member Posts: 1,592
    Well it's best to ask it directly to Beamdog in this situation. Theoretically we are not supposed to do reverse engineering and all that and modifying the executable kind of enter the area, but it is definitely Beamdog's call to make.

    I would say they won't mind it, but best to ask them before you do the job rather than doing the job, publishing the mod and having it taken down because of legal issues.
  • RaduzielRaduziel Member Posts: 4,714
    @Bubb As long as other mods run fine I don't see why not, but maybe this is a question to be asked to one of the blues.
  • RaduzielRaduziel Member Posts: 4,714
    edited July 2018
    1) Is it possible to allow a specific kit to use wizard scrolls and wands?

    2) Is it possible to allow a specific kit to use wizard scrolls from a specific school only?

    3) Is it possible to reproduce a specialist wizard's penalty to enemies for another wizard kit? And 15% bonus/penalty to learn scrolls? I know how to add the +2 resistance, restrict the use of items and the game automatically gives the extra spell slot (that IDK if can be target by @kjeron 's mod).

    Thanks.
  • ArunsunArunsun Member Posts: 1,592
    Raduziel said:

    1) Is it possible to allow a specific kit to use wizard scrolls and wands?

    2) Is it possible to allow a specific kit to use wizard scrolls from a specific school only?

    3) Is it possible to reproduce a specialist wizard's penalty to enemies for another wizard kit? And 15% bonus/penalty to learn scrolls? I know how to add the +2 resistance, restrict the use of items and the game automatically gives the extra spell slot (that IDK if can be target by @kjeron 's mod).

    Thanks.

    1) I believe the only way to do that is to allow the base class of the kit to use these scrolls, and then forbid every kit besides the one you want from using the scrolls. There might be a cleaner solution I am not aware of. If you go for that option then you need to install the scroll restriction component after any other kit mod.

    2) Assuming you got a solution for 1 (whether mine or a cleaner one), you may add an extra test to the PATCH_IF, to apply the modifications only to scrolls that have a certain "unusable by" flag ticked in. These flags are split in 4 bytes (at 29h, 2bh, 2dh and 2fh). So for instance if you want only divination spells to be usable by your kit, then, as they are divination spells, they will be unusable by conjurers, so bit 7 at 0x2f will be a 1. You may check for these bits. Some overhaul mods might make modifications to scroll and spell usability, so you might want to check them too, for compatibility.

    3) These are hardcoded and we had a long session of trial and error last summer to try and find a solution around the issue. Never got anything satysfying. IIRC you ended up asking Beamdog to dehardcode them in a feature request thread, and I joined you by asking to dehardcode other unique class features (such as HiPS on shadowdancer). Maybe it will be part of the 2.5 IE update.
Sign In or Register to comment.