Jump to content

WEIDU - items basic coding problems


ptifab

Recommended Posts

I was  not sure about both opcodes #146 and #148 parameters 1 and 2 (casting level not used or used) behaviors and i decided to test them in my games.

First, IESDP lacks a small description about the third option in parameter2 , it's not specified at all that it exists, maybe this was a description for an old patch version ? But actually those opcodes have 3 options in parameter2 and IESDP states only option 0 and a mix of 1 and 2.

Anyway, my testing was actually this :

- make a copy of a burning hand spell, redone it that it has only 3 headers, with level 1, 10 and 20, with 10, 20 or 30 fire damage, add it to an item that will cast it with an opcode 148 and toy with level (parameter1) and casting type (parameter2). Header is set to cast at "any point within range" (4)

- make a copy of melf's acid arrow, redone it that it has only 3 headers with level 1, 10 and 20, with 10, 20 or 30 acid damage, correct projectile, add it to an item that will cast it with an opcode 146 and toy with level (parameter1) and casting type (parameter2). Header is set to cast at living target (1)

my results so far :

with opcode  #148, the target only takes 10 damage no matter the level (1, 10 or 20 and with parameter2 set at option 1 or 2)

with opcode #146, the target takes correct damage based on the level specified in parameter1 and 2.

So my question now: Is there something wrong with opcode #148 ? In the example, there's a projectile to set the zone of effect of the spell so the target is correctly damaged but the level is not affected by the parameters. Did i miss something ?

Edited by ptifab
Link to comment

So i've made some diggings on opcode 148 parameters, and it seems that parameter1 is not taken into account besides 0 (at this value it takes into acount the level of the character). If set to anything higher than 0, it ignores the parameter, dealing the effect as if cast at level 1, no matter what you do with parameter2

Is this a known issue ? I'm working on an EE install...

Link to comment

It's always been that way, only the non-instant modes could ever specify a casting level.
op146, Param2=0:

  • Param1=0: Casts spell at (Caster level)
  • Param1=(non-zero): Casts spell at (Param1) level

op146, Param2=1: Casts spell instantly at (Caster level)

op146, Param2=2:  Casts spell instantly at (Param1) level

  • (This mode is new, specific to the EE's, and functions closer to op326/op333 (they share the same targeting and reflection mechanics) than the other modes of op146 or op148.

op148, Param2=0:

  • Param1=0: Casts spell at (Caster level)
  • Param1=(non-zero): Casts spell at (Param1) level

op148, Param2=(non-zero): (Effect target) Casts spell instantly at (Caster level)

 

If you're looking for an opcode to instantly cast a normal spell at a specified level (at a creature or a point), there isn't one.

op326/op333 and op146/param2=2 can cast a spell instantly at a specific level targeting a creature, but do so differently.

  • The spell is cast at the spells/projectiles target(s), not necessarily the effect target.  This target will inherit any "Self" targeted effects in the spell, not the caster.
  • The target's Magic Resistance will not affect the effects of these opcodes spells.
  • Any "Original-Caster" targeted effects in their spell may target the caster or the target depending on the spells projectile.  If PRO is invalid, target becomes "Original Caster", otherwise caster will remain "Original Caster".
  • Any Enemy-only or Ally-only projectiles in the spell will base their targeting off the target of these opcodes.  If you use "Preset target" and target an enemy, that enemy will determine the enemy-ally of the projectile of the spell, not the caster.
  • As such, they should not be used to cast to normal spells, unless you are looking to specifically exploit this behavior.  Such as casting "Armor of Faith", normally a "Self-only" spell, on someone else at a specified level.
  • When spell turning reflects these opcodes, the target of their spells effects changes depending on its projectile. If PRO is valid, target becomes "Original Caster", but remains "Self" and "Preset" target. If PRO is invalid, caster becomes "Self", "Preset", and "Original Caster" targets.  This can be avoided by setting the power level of these opcodes to 0 to bypass spell turning, only targeting "self" with these opcodes, or exploited to cast some spells to bypass Spell Turning.
  • "Invalid" projectile refers to any projectile index that is not listed in PROJECTL.IDS (with a relevant .PRO file) or hardcoded.
Edited by kjeron
Link to comment

Hi everyone,

 

Doe someone knows how targetting is working in Creatures effects ? I've looked at a bunch of cre files, and it seems a lot of them does not have the target flag specified (its always set to none instead of self). I have seen this problem in proficiency modifiers effects (opcode #233) for example.

Edited by ptifab
Link to comment
12 hours ago, ptifab said:

ve looked at a bunch of cre files, and it seems a lot of them does not have the target flag specified (its always set to none instead of self).

This is defined by what, aka, what are you using to look at .cre file ? Cause that's just text showing up in a tool. As in, this is likely:

Quote

I have seen this problem

Just a matter of prespective, rather than an actual problem. Unless you use a heavily modified resources that have a wrong setting that actually make it not appear in the game.

Edited by Jarno Mikkola
Link to comment
4 hours ago, Jarno Mikkola said:

This is defined by what, aka, what are you using to look at .cre file ? Cause that's just text showing up in a tool. As in, this is likely:

Just a matter of prespective, rather than an actual problem. Unless you use a heavily modified resources that have a wrong setting that actually make it not appear in the game.

I don't fully understand your answer, but the tool i'm using is near infinity. I've been modding for a year now but i never encountered this. I always set a target flag for all of my effects, but in this situation, a lot of creatures files have some effects that do not have it specified. I was just asking if that was for a particular reason ?

Link to comment
41 minutes ago, ptifab said:

 I've been modding for a year now but i never encountered this.

Then you should have ran into the LPF marco's, like my post in the last pages first post, and they all have defaults they default into if no other inputs are provided in the later part of the function for usage. The defaults are there for reason, for common usability, and you only need to define it if your definition is not the default. Like the opcode for LPF ~ADD_SPELL_EFFECT~ ... in the int_var's.

And if we are talking about creature effects, then the creature itself is(usually) the effected target.

Edited by Jarno Mikkola
Link to comment
29 minutes ago, Jarno Mikkola said:

Then you should have ran into the LPF marco's, like my post in the last pages first post, and they all have defaults they default into if no other inputs are provided in the later part of the function for usage. The defaults are there for reason, for common usability, and you only need to define it if your definition is not the default. Like the opcode for LPF ~ADD_SPELL_EFFECT~ ... in the int_var's.

And if we are talking about creature effects, then the creature itself is(usually) the effected target.

I'm aware of all that, i just asked if the fact that the target flag is set as "none" (0) instead of "self" (1) or "preset target" (2) has actually a consequence on the effectiveness of the effect itself. To be simple, is it effective or not on the creature ?

Edited by ptifab
Link to comment

Hmm, the 0, 1 and 2 actually only differ on the who casted the effect on them... but as it likely is permanent, that hardly matters. Aka, did you learn the two handed sword proff, or did you run into a dude that teached it to you, perhaps as a reward... so the hobgoblins joined an army and a troll went and teached them the use of a weapon. How did they learn, you ask, of course hitting him, and thus it's a magical effect. Cause you can't kill a troll with slashing weapons. 😜

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...