Akatosh2903 Posted November 5, 2011 Share Posted November 5, 2011 (edited) Main Question: How can I get my ScriptEffect to activate when a kill is made with the scripted weapon? Edited November 5, 2011 by Akatosh2903 Link to comment Share on other sites More sharing options...
Akatosh2903 Posted November 5, 2011 Author Share Posted November 5, 2011 (edited) I think I'm on to something now but I've hit an annoying snag, what's a nested begin/end block and how do I prevent it? In theory if I create this script as an effect, and use it as an "on death" effect for a weapon, I won't have to do so much coding. ScriptName HalfZatoichiHeal begin ScriptEffectStart player.SetAV health +30 begin ScriptEffectFinish Edited November 5, 2011 by Akatosh2903 Link to comment Share on other sites More sharing options...
Akatosh2903 Posted November 5, 2011 Author Share Posted November 5, 2011 (edited) New problem, I think I've fixed the nested begin/end block problem but know it says that I haven't defined the parameter amount ScriptName HalfZatoichiHeal begin ScriptEffectStart player.SetAV health +30 end ScriptEffectStart Edited November 5, 2011 by Akatosh2903 Link to comment Share on other sites More sharing options...
Akatosh2903 Posted November 5, 2011 Author Share Posted November 5, 2011 I now know that ModAV is better suited for my purposes than SetAV but it still says I haven't defined the parameter amount ScriptName HalfZatoichiHeal begin ScriptEffectStart player.ModAV health +30 end ScriptEffectStart Link to comment Share on other sites More sharing options...
Akatosh2903 Posted November 5, 2011 Author Share Posted November 5, 2011 ScriptName HalfZatoichiHeal begin ScriptEffectStart player.ModAV health 30 end ScriptEffectStart fixed Link to comment Share on other sites More sharing options...
Akatosh2903 Posted November 5, 2011 Author Share Posted November 5, 2011 (edited) I've added another element to the script, I'm trying to heal the PC by 30 points but only if their karma level is above 249 (good). ScriptName HalfZatoichiHeal begin ScriptEffectStart if player GetAV Karma > 249 player.ModAV health 340 else player.ModAV health -40 endif end ScriptEffectStart Edited November 5, 2011 by Akatosh2903 Link to comment Share on other sites More sharing options...
Akatosh2903 Posted November 5, 2011 Author Share Posted November 5, 2011 (edited) Revised but untested.0HalfZatoichiHeal1 heals the player for 20 points if they have a good karma level.0HalfZatoichiHeal2 heals the player for 40 points if they have a very good karma level.0HalfZatoichiHurt1 damages the player for 20 points if they have a bad karma level.0HalfZatoichiHurt2 damages the player for 40 points if they have a very bad karma level.0HalfZatoichiRadBurst causes the player to emit a glowing one's rad burst if they have a neutral karma level. ScriptName HalfZatoichiHealHurt begin ScriptEffectStart if player GetAV Karma >= 250 && < 750 player.CastImmediateOnSelf 0HalfZatoichiHeal1 endif if player GetAV Karma >= 750 player.CastImmediateOnSelf 0HalfZatoichiHeal2 endif if player GetAV Karma > -250 && < 250 player.CastImmediateOnSelf 0HalfZatoichiRadBurst endif if player GetAV Karma <= -250 && > -750 player.CastImmediateOnSelf 0HalfZatoichiHurt1 endif if player GetAV Karma <= -750 player.CastImmediateOnSelf 0HalfZatoichiHurt2 endif end ScriptEffectStart Edited November 5, 2011 by Akatosh2903 Link to comment Share on other sites More sharing options...
Akatosh2903 Posted November 5, 2011 Author Share Posted November 5, 2011 (edited) Revised Script Tested.This script was attached to a weapon, it didn't work, my doubts lies with line 4 "if IsKiller player", I think if I found a good alternative to that line, It would work. ScriptName HalfZatoichiHealHurt begin ScriptEffectStart if IsKiller player if player GetAV Karma >= 250 && < 750 player.CastImmediateOnSelf 0HalfZatoichiHeal1 endif if player GetAV Karma >= 750 player.CastImmediateOnSelf 0HalfZatoichiHeal2 endif if player GetAV Karma > -250 && < 250 player.CastImmediateOnSelf 0HalfZatoichiRadBurst endif if player GetAV Karma <= -250 && > -750 player.CastImmediateOnSelf 0HalfZatoichiHurt1 endif if player GetAV Karma <= -750 player.CastImmediateOnSelf 0HalfZatoichiHurt2 endif endif end ScriptEffectStart Edited November 5, 2011 by Akatosh2903 Link to comment Share on other sites More sharing options...
Recommended Posts