Darkranger91 Posted June 29, 2011 Share Posted June 29, 2011 hello, i was wondering if there is a way to make a spell that drains the fatigue from everyone around the player, while restoring the player's magickif there is, please give an example script, thank you. Link to comment Share on other sites More sharing options...
fg109 Posted June 29, 2011 Share Posted June 29, 2011 (edited) These scripts are for if you can't or don't want to use OBSE: scriptname SomeSpell1Script float timer Begin ScriptEffectStart SomeActivator.MoveTo Player SomeActivator.Cast SomeSpell2 SomeActivator End Begin ScriptEffectUpdate set timer to timer + ScriptEffectElapsedSeconds if (timer >= 1) set timer to 0 SomeActivator.MoveTo Player SomeActivator.Cast SomeSpell2 SomeActivator endif Endscriptname SomeSpell2Script Begin ScriptEffectStart set self to GetSelf if (self == Player) self.AddSpell RestoreMagickaAbility else self.AddSpell DamageFatigueAbility endif End Begin ScriptEffectFinish self.RemoveSpell RestoreMagickaAbility self.RemoveSpell DamageFatigueAbility End The first script would be attached to a self targeting spell, and it's the spell that the player would be casting. "SomeActivator" would be an activator that is persistent and initially disabled. The second script would be attached to "SomeSpell2", which should be an area effect spell with 0 duration. "RestoreMagickaAbility" would be an ability that restores magicka, and "DamageFatigueAbility" would be an ability that damages fatigue. If you use OBSE, you can use this script: scriptname SomeSpell1Script float timer ref tempref Begin ScriptEffectStart let tempref := GetFirstRef 69 while (tempref) if (tempref.GetDistance Player <= 'AreaEffectOfSpell') tempref.ModAV2 Fatigue 'DrainAmount' tempref.pms effectDamage Player.ModAV2 Magicka 'RestoreAmount' endif let tempref := GetNextRef loop End Begin ScriptEffectUpdate let timer += ScriptEffectElapsedSeconds if (timer >= 1) let tempref := GetFirstRef 69 while (tempref) if (tempref.GetDistance Player <= 'AreaEffectOfSpell') tempref.ModAV2 Fatigue 'DrainAmount' tempref.pms effectDamage Player.ModAV2 Magicka 'RestoreAmount' endif let tempref := GetNextRef loop endif End 'AreaEffectOfSpell' would be the radius you want to cover with the spell (eg 750). 'DrainAmount' would be the amount of fatigue that should be drained (eg -5). 'RestoreAmount' should be the amount of magicka restored for each person/creature drained (eg 5). Edited June 29, 2011 by fg109 Link to comment Share on other sites More sharing options...
Darkranger91 Posted June 30, 2011 Author Share Posted June 30, 2011 thank you, that helps a lot. i have another question: how would i go about making an alternate chargen/beginning mod? what scripts are needed so that my messagebox appears after each of the chargen stages? (i.e. race, birthsign, class.) Link to comment Share on other sites More sharing options...
Darkranger91 Posted June 30, 2011 Author Share Posted June 30, 2011 i would also like to know what 'block nesting' is, and how to prevent it. i keep getting an error about it Link to comment Share on other sites More sharing options...
fg109 Posted June 30, 2011 Share Posted June 30, 2011 http://www.thenexusforums.com/index.php?/topic/318489-no-new-game-start-turorial/ I think "block nesting" would be when you try to put one scripting block inside of another: Begin GameMode Begin MenuMode End End You just can't do that... Just know that you must have an "End" after a "Begin" before you can use "Begin" again. Link to comment Share on other sites More sharing options...
Recommended Posts