subtledoctor Posted February 9, 2017 Share Posted February 9, 2017 I'm trying to edit a spell, which is a direct-damage effect, and I would simply like to change the damage type from one to another - say, from fire damage to magic damage. But when I look at opcode 12 in NI, it's one of these ones where parameter2 is split into two fields. So the ALTER_EFFECT function isn't quite equipped to deal with it. Anyone know how I can set the "Mode" to "normal (0)" and set the "Damage type" to "MAGIC - 64" ? LPF ALTER_EFFECT INT_VAR match_opcode = 12 parameter2 = ______ END thx Link to comment
kjeron Posted February 9, 2017 Share Posted February 9, 2017 Set it in NI with the split param2 opcode, then change the opcode to one that has it listed as "unused". Opcode 12, Value = ###, Mode = 0(normal), Damage Type = 64(magic) -> Opcode 11, Unused(1) = ###, Unused(2) = 4194304 Or convert to hex: 0 + [64 * (2^16)] Link to comment
DavidW Posted February 9, 2017 Share Posted February 9, 2017 INNER_PATCH_SAVE parameter2 "" BEGIN INSERT_BYTES 0x0 4 WRITE_SHORT 0x0 [first_subfield_value] WRITE_SHORT 0x2 [second subfield value] END LPF ALTER_EFFECT INT_VAR match_opcode=12 parameter2 END(not tested) Link to comment
Ardanis Posted February 9, 2017 Share Posted February 9, 2017 parameter2 = mode + (type << 16) Link to comment
subtledoctor Posted February 9, 2017 Author Share Posted February 9, 2017 parameter2 = mode + (type << 16) Works, thanks! Link to comment
DavidW Posted February 10, 2017 Share Posted February 10, 2017 parameter2 = mode + (type << 16)Cute. I need to brush up my WEIDU, clearly. (Most of what I write has been functions-calling-functions for ages now.) Link to comment
Galactygon Posted February 12, 2017 Share Posted February 12, 2017 Another example where this could be useful are the various color glow opcodes where you specify the RGB values as separate bytes for param1. It's not necessary to look up the long value of the RGB field in NI/DLTCEP if you can write this: SET parameter1 = (150 << 8) + (150 << 16) + (150 << 24) // color hue (150,150,150), the first byte at "<< 0" is skipped Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.