Skip to content

Has anyone done this with melee or ranged effect

wolpakwolpak Member Posts: 390
Successfully implemented a one hit and done effect. Like, instead of poison effect lasting 6 rounds, it lasts 1 hit (or something like that.

I was trying to do it with remove secondary effect. I set the spell to a new secondary effect I listed in msectype.2da and then on melee I had it remove the secondary effect from original caster. That may not be the right target, or it may not even be targetable at all...which is why I am asking if anyone has done this.

Also, NearInfinity doesn't seem to be able to point to resources like DLTCEP can, or maybe I am missing something...

Comments

  • kjeronkjeron Member Posts: 2,367
    The Melee/Ranged Hit effect opcode ignores targeting used in the EFF, it always targets the "hit" creature. Have the EFF instead cast a spell with everything you want in it, the Poison effect would target preset, and the removal effect would target self.

    I wouldn't use the "Original Caster" targeting mode for this. Its mostly useful for when you don't want a self-targeted effect to occur when the targeted enemy saves/resists the primary effect, which you don't want for such a one-use "removal" effect, and the Melee/Ranged Hit effect opcode will already require that the attack connected.

    NI can point to resources, but you need to use the "refresh tree" button to see newly added resources, such as new projectiles, secondary effect types, and sometimes SPL/EFF files.
  • wolpakwolpak Member Posts: 390
    @kjeron‌ I am not sure what you mean, have the eff cast a spell with everything I want in it. I want it to "deactivate" on a successful hit, which Melee/Ranged effect opcode does. I am mimicking how power attack works where it stuns on hit. If it can't be done, then I am ok with that. Just want to make sure it can't.
  • kjeronkjeron Member Posts: 2,367
    @wolpak‌
    It can be done, just not through a single effect.
    The .eff file resource for the Melee/Ranged effect opcode, will need to use the Cast Spell ocpode(146), and resource spell will be the one to remove the Melee/Ranged effect opcode from yourself. Putting everything in that spell is just to eliminate the need for multiple Melee/Ranged effect opcodes.
  • wolpakwolpak Member Posts: 390
    Thanks, I'll look into that.
  • wolpakwolpak Member Posts: 390
    @‌kjeron Any chance you could do a very simple one and upload it. Just have something like, toggle skill and get an indefinite icon, and on melee strike, remove the icon. The skill doesn't have to do anything other than toggle so I can see how you did it.
  • kjeronkjeron Member Posts: 2,367
    @wolpak‌
    Sure thing. This is a slimmed down imitation of Poison Weapon, "Able to Poison Weapons" portrait icon, and a weak on-hit Poison effect.
  • wolpakwolpak Member Posts: 390
    @kjeron‌ What does opcode 321 do? I can't find it anywhere. I see it is a self referencing resource, but it comes up as unknown for me.
  • wolpakwolpak Member Posts: 390
    I see that you posted it a bit back in another thread:

    Opcode 321 Remove effects by resource

    Not sure how you figured that out, but I am happy. Thanks.
  • wolpakwolpak Member Posts: 390
    Sorry if I am being dense, but let me step through this so it makes sense to me.

    1. The spell APPLY is given to the character.
    2. APPLY has the following effects:
    321 Remove effects by resource (APPLY)
    Set Melee Effect (HIT EFFECT)
    Set RANGED Effect (HIT EFFECT)
    BLAH BLAH pretty stuff
    3. HITEFF casts a spell at target (pre-target) of REMOVE. Is that the enemy you are striking?
    4. That gives the enemy a Poison effect for 6 seconds. Why is the resource APPLY in there.
    5. 321 Remove effect APPLY

    While it works, I want to know how it works. Why does APPLY have remove itself. Why, when you hit the enemy, does it remove APPLY from you?

    Sorry for the questions.
  • kjeronkjeron Member Posts: 2,367
    @wolpak‌
    No problem, I am happy to help.

    As for Opcode 321: This was one of the first new opcodes that was added to the EE's, if it is showing as Unknown for you its because NearInfinity is out-of-date.
    It has a variety of ways to be used, but we only need to use its default function, with timing mode "Instant/limited", and duration "0", this will remove all effects applied by the resource specified(it does not have to self-reference), with a general exception of effects applied with timing mode "Instant/Permanent Until Death (1)".
    wolpak said:

    3. HITEFF casts a spell at target (pre-target) of REMOVE. Is that the enemy you are striking?

    Correct, and it will always be the target you are striking, the targeting mode used in the .EFF file is ignored by the Melee/Ranged Hit Effect Opcodes. This is why we have it cast a spell, because we CAN select our targets from within the REMOVE spell, and therefor, our-self.
    wolpak said:


    While it works, I want to know how it works. Why does APPLY have remove itself. Why, when you hit the enemy, does it remove APPLY from you?

    Why does it apply itself twice? The first instance in the APPLY spell is a safe-guard, used to remove any previous cast instance of the ability, to prevent the player from stacking the effect multiple times. It has been added to many spells in the EE this way to correct their functionality, but it must always be the first effect in the ability when used like this.
    The second instance, found in the REMOVE spell, is the one that removes the ability "on-hit", so that it only functions once, as you requested.
  • wolpakwolpak Member Posts: 390
    Got it and I just noticed it in other spells. Not sure why NI isn't showing the opcode right. I redownloaded the most recent version. Either way, I appreciate your insight.
Sign In or Register to comment.