IsharaMeradin Posted August 17, 2022 Share Posted August 17, 2022 We also fear that we have tried @IsharaMeradin's patience one time too many, though Scripting Guru @IsharaMeradin is, and though benefit by that Guru's work we have. My patience is not too thin. I try to only reply to topics that I believe I can actually be of assistance. I never want to knowingly send someone down the wrong path only for them to have to start all over with a different approach. There are occasions where I do not see a particular post on a given day and then later see that someone else has provided the same information or better. I see no need to post in such a scenario either. Plus the further out it gets from me having actually done this stuff, the less likely I will know of any newer methods. Link to comment Share on other sites More sharing options...
maxarturo Posted August 17, 2022 Share Posted August 17, 2022 (edited) If you follow all the steps correctly it will work, but did you fill in the properties of the script? if you don't fill/assign in the script's property from the drop down menu the 'Player' - the 'Spell' - and the 'Magic Effect', NOTHING WILL HAPPEN!!!! * Select the script in the script section and press the button on the right that sais 'PROPERTY' and fill in the properties from each property 'Drop Down Menu'. Edited August 17, 2022 by maxarturo Link to comment Share on other sites More sharing options...
Gorgopis Posted August 18, 2022 Author Share Posted August 18, 2022 We'll double check. BTW, in the meantime, we made an enchanted exploding projectile, with the slow-time explosion on it. (No scripting required) It succeeded, except, once we fired it, it stopped time for the rest of the time we were testing in game. Everything went to "black and white" and slowed down, though some hostile NPC's still moved pretty fast. We thought we had set the effect for 10 seconds, so we'll have to see where we goofed. Maybe we missed a time-in, or time-out parameter in the projectile window. Thanks, @maxarturo, this is all very interesting! (Thanks as always to @IsharaMeradin.) Link to comment Share on other sites More sharing options...
Gorgopis Posted August 19, 2022 Author Share Posted August 19, 2022 YAY! Solved! For those reading this thread, here's where we went wrong with @maxarturo's steps. 1) We did not catch on that all new Magical Effects/Spells had to be set to "contact." The original VoiceSlowTime is set to "self." We had to figure out the logic of a weapon-based magic-trigger: a weapon would require a consistent "contact" setting through all its integrated effects and spells. 2) We had to add two capital 'F"s to our ID for our first Magical Effect listed in @maxarturo's steps. I.e., Not our first failed-name SlowMotionEffect, but rather the more precise and renamed SlowMotionEffectFF. Without the FF, the CK did not show the effect in our restricted menu choices (as we remember it), when we first tried to add our effect to our Spell. 3) With @maxarturo's Step 4, we indeed added our new script, but we assumed that the Creation Kit would automatically autofill the script with our new properties. It did not. Though we could see the properties listed there in the script edit-window, they had not been "enabled." We had to ask the CK (by clicking on autofill) to really autofill our new properties, before we first noticed the little pencil icon appear next to our properties in the script-edit window, to show they were officially included. And we saved our new script! 4) Our weapon thereby functioned as desired, though it seems to one-hit-kill any same-level enemies. We'd like to back that down a bit. BTW, we very much enjoyed testing and practicing while making this mod. We learned a lot from our errors and assumptions. SO! A Big Shout Out and Thank You to @maxarturo! Link to comment Share on other sites More sharing options...
maxarturo Posted August 20, 2022 Share Posted August 20, 2022 :thumbsup: Link to comment Share on other sites More sharing options...
Gorgopis Posted August 20, 2022 Author Share Posted August 20, 2022 Hmm. A small follow-up idea. We think this process could be used to put a shield cloak/shield charge effect on a weapon? So when the weapon/bow contacts/fires, NPC's get the big push? Link to comment Share on other sites More sharing options...
ThalmorJusticiar7th Posted March 3 Share Posted March 3 (edited) i know this might be late, but i found this thread just now, i have a request quite similar to this thread's original post: i want to create a weapon enchantment, that: 1. counts the number of times you have done normal attacks 2. add an effect that with each attack, increases fire damage with a buff on player, stacking up to 4 3. at 4 stacks of the effect, your next power attack will trigger a fire explosion (similar to fire rune trap) and 3 fire balls in front, left and right directions (like fireball), my real issue is with implementing a method for the game to register and count normal and power attacks and increase the effect's stack based on the number of attacks. i couldn't find anything like this in the game's records, so i don't even know where to begin. Edited March 3 by ThalmorJusticiar7th Link to comment Share on other sites More sharing options...
xkkmEl Posted March 3 Share Posted March 3 Isn't it just a matter of counting OnHit events? Classically, since OnHit events register on the target, you'd need your weapon to place an ability on each target. Or, use Dylbill's global events plugin, if you're on SE. Note however that enchanted weapons produce multiple OnHit events on each strike (once for physical damage, and then once for each enchantment magiceffect). To increase the effect, use multiple magiceffects in the weapon enchantment, conditioned on the number of hits recorded. You might use a faction to record the number of hits since the counters will be per-actor (either the attacker or the victim or both). This works as long as you have a small finite number of steps, which seems to be what you have in mind. It's not a trivial project... and will get a bit hairier when you take into account the need for the hit counters to expire in some way. Link to comment Share on other sites More sharing options...
ThalmorJusticiar7th Posted Monday at 02:22 PM Share Posted Monday at 02:22 PM (edited) 1 hour ago, xkkmEl said: Isn't it just a matter of counting OnHit events? Classically, since OnHit events register on the target, you'd need your weapon to place an ability on each target. Or, use Dylbill's global events plugin, if you're on SE. Note however that enchanted weapons produce multiple OnHit events on each strike (once for physical damage, and then once for each enchantment magiceffect). To increase the effect, use multiple magiceffects in the weapon enchantment, conditioned on the number of hits recorded. You might use a faction to record the number of hits since the counters will be per-actor (either the attacker or the victim or both). This works as long as you have a small finite number of steps, which seems to be what you have in mind. It's not a trivial project... and will get a bit hairier when you take into account the need for the hit counters to expire in some way. thanks for the answer, how do i write the script for Normal attacks registering inside an OnHit event ? that's something i'm totally green about as nothing that i've seen ever handled normal attacks (same question about power attacks), i'm working on a mod project with already a main requirement, so i do not want to add anymore requirements for the quest, the issue of enchantment registering a hit on the opponent can be negated by simply not adding those hits to the script, and only count physical attacks, no ? i do have only 4 hits in mind, and a new effect for the power attack that follows these 4 normal attacks when the player has 4 stacks of the buff effect. also i don't understand what you mean by using multiple magic effects, are you saying i add a specific magic effect for each of the 4 attacks ? then how can i condition each one to stack after the one before it already happened, or if the one before it expires, this hit that (lets say i created for the 4th attack) should no longer be considered the 4th stack, but rather the 1st one, that can't happen if its a unique buff/debuff that applies stack number 4, rather than adding on the stack pile itself. Edited Monday at 02:23 PM by ThalmorJusticiar7th Link to comment Share on other sites More sharing options...
xkkmEl Posted Monday at 10:09 PM Share Posted Monday at 10:09 PM Unless someone has a better idea... what I have in mind is not trivial. You want to use the OnHit event. Since this requires a script on the target, we'll use a magiceffect to hold the script, and an ability to start a stable magiceffect: Create a "script", "constant effect", "self" magic effect. Create a "ability", "constant effect", "self" spell, and assign it the previously created magiceffect. Create a 2nd "script", "fire and forget", "contact" magic effect. Create a "enchantment", "fire and forget", "contact" enchantment, and assign it the 2nd magiceffect. Add the enchantment to your test weapon. Now you need to create two scripts, one for each magic effect, then add the script to the magiceffect and populate its properties. The 1st script, I call "MyHitDetectionMagicEffectScript": Script MyHitDetectionMagicEffectScript extends ActiveMagicEffect Spell property MyHitDetectionSpell Auto Actor target = None event OnEffectStart( Actor akCaster, Actor akTarget) target = akTarget registerForSingleUpdate( 20.0) endevent event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) Debug.messageBox( "Hit on " + target.getDisplayName() + "!") endevent event OnUpdate() target.removeSpell( MyHitDetectionSpell) endevent The 2nd script, I call "MyHitCounterMagicEffectScript": Script MyHitCounterMagicEffectScript extends ActiveMagicEffect Spell property MyHitDetectionSpell Auto event OnEffectStart( Actor akCaster, Actor akTarget) akTarget.addSpell( MyHitDetectionSpell) endevent Now this is just the start of it... to detect when you hit your target... and can start counting hits. Well... if I didn't make any typos... or forgot to mention some detail. Link to comment Share on other sites More sharing options...
Recommended Posts