erratichippo Posted March 24, 2017 Share Posted March 24, 2017 I am trying to activate the effect when the actor has their weapon out and deactivate it when they unequip their weapon. My thought was that I could use the condition isweapoout=2 but it doesnt seem to be starting the effect. Can anyone tell me how conditions work for spells and magic effects? The magic effect and spell this script is attached to is set on constant and self. My thought was that once the condition on the spell was met the effect would start. Scriptname _Civ_AmmoTypeCheck extends activemagiceffect Ammo property WeaponAmmo auto Ammo property thirtyeightCaliber auto Actor property Shooter auto Perk property thirtyeightCaliberEquip auto Weapon property WeaponEquipped Auto Event OnEffectStart(Actor akTarget, Actor akCaster) akTarget = Shooter WeaponEquipped = Shooter.GetEquippedWeapon() WeaponAmmo = WeaponEquipped.GetAmmo() debug.notification("effect started") if (WeaponAmmo == thirtyeightCaliber) Shooter.addperk(thirtyeightCaliberEquip) debug.messagebox(".38 ammo equipped") endif endevent Event OnEffectFinish(Actor akTarget, Actor akCaster) Shooter.removeperk(thirtyeightCaliberEquip) debug.messagebox("perk removed") endEvent Link to comment Share on other sites More sharing options...
shavkacagarikia Posted March 24, 2017 Share Posted March 24, 2017 For isWeaponOut condition change "== 2" to "> 0". Link to comment Share on other sites More sharing options...
erratichippo Posted March 24, 2017 Author Share Posted March 24, 2017 This didnt work for me. I tried putting it on both the spell and then the spell effect. Nothing happened in either case. Link to comment Share on other sites More sharing options...
shavkacagarikia Posted March 24, 2017 Share Posted March 24, 2017 (edited) Have you added spell to player? Edited March 24, 2017 by shavkacagarikia Link to comment Share on other sites More sharing options...
erratichippo Posted March 24, 2017 Author Share Posted March 24, 2017 Yes, I used the console command to do it. Link to comment Share on other sites More sharing options...
shavkacagarikia Posted March 24, 2017 Share Posted March 24, 2017 Ok, I understand why you need constant effect, but try and change it to fire and forget. See if that works Link to comment Share on other sites More sharing options...
erratichippo Posted March 24, 2017 Author Share Posted March 24, 2017 Still not working. I also added an oninit event just to see if I could get a messagebox. Nothing happened. The console just says the spell was added. Scriptname _Civ_AmmoTypeCheck extends activemagiceffect Ammo property WeaponAmmo auto Ammo property thirtyeightCaliber auto Actor property Shooter auto Perk property thirtyeightCaliberEquip auto Weapon property WeaponEquipped Auto event OnInit() debug.messagebox("Is this thing on?") endevent Event OnEffectStart(Actor akTarget, Actor akCaster) akTarget = Shooter WeaponEquipped = Shooter.GetEquippedWeapon() WeaponAmmo = WeaponEquipped.GetAmmo() debug.notification("effect started") if (WeaponAmmo == thirtyeightCaliber) Shooter.addperk(thirtyeightCaliberEquip) debug.messagebox(".38 ammo equipped") endif endevent Event OnEffectFinish(Actor akTarget, Actor akCaster) Shooter.removeperk(thirtyeightCaliberEquip) debug.messagebox("perk removed") endEvent Link to comment Share on other sites More sharing options...
shavkacagarikia Posted March 24, 2017 Share Posted March 24, 2017 Ok, now change target for isWeaponOut from Subject to Player Link to comment Share on other sites More sharing options...
erratichippo Posted March 24, 2017 Author Share Posted March 24, 2017 (edited) Still nothing. Does it matter if I run the condition on the magic effect or the spell? Edited March 24, 2017 by erratichippo Link to comment Share on other sites More sharing options...
shavkacagarikia Posted March 24, 2017 Share Posted March 24, 2017 (edited) I'm not sure. I always run them from spell. And that condition works correctly I'm using it in my mod and what I see here should work. I'm out of ideas what can be a problem. P.S try testing on clean save or better type coc qasmoke in console in main menu Edited March 24, 2017 by shavkacagarikia Link to comment Share on other sites More sharing options...
Recommended Posts