Maleagant Posted April 11, 2012 Share Posted April 11, 2012 (edited) This script is supposed to force the Follower actor to Cast the Werewolfchange spell at the beginning of combat. (Yes I know this is a once a day power, useing it as a test spell (to make sure the script works) before I modify it to a lesser power for multiple uses on the Follower). Here's my script: ScriptName activateSelfOnCombatBegin extends Actor {Script that lives on an actor that simply activates itself on Combat Begin} import game import debug auto State waiting Event OnCombatStateChanged(Actor actorRef, int combatState) if combatState != 0 ; 0 = not in combat, so if the state isn't 0, they entered combat gotoState("allDone") activate(Self) endIf endEvent endState State allDone ;do nothing endState SPELL Property WerewolfChange Auto Event OnCombat (Kythiraamanan) Werewolfchange.cast(Self, Self) endEvent I am receiving this error when compiling: Compiling "activateSelfOnCombatBegin"...c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\activateSelfOnCombatBegin.psc(22,29): missing ID at ')'No output generated for activateSelfOnCombatBegin, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on activateSelfOnCombatBegin Any help would be apreciated (or a script if anyone knows one that works like this) Thanks :D Edited April 11, 2012 by Maleagant Link to comment Share on other sites More sharing options...
Maleagant Posted April 11, 2012 Author Share Posted April 11, 2012 My second attempt: ScriptName activateSelfOnCombatBegin extends Actor {Script that lives on an actor that simply activates itself on Combat Begin} import game import debug auto State waiting Event OnCombatStateChanged(Actor actorRef, int combatState) if combatState != 0 ; 0 = not in combat, so if the state isn't 0, they entered combat gotoState("allDone") activate(Self) endIf endEvent endState State allDone ;do nothing endState SPELL Property WerewolfChange Auto Event OncombatStateChanged(sskythiraamanan akTarget, 0 aeCombatState) if (akTarget == Game.GetPlayer()) if (aeCombatState == 1) Werewolfchange.Cast(Kythiraamanan()) endif endif EndEvent Gives this error: Compiling "activateSelfOnCombatBegin"...c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\activateSelfOnCombatBegin.psc(22,53): no viable alternative at input '0'No output generated for activateSelfOnCombatBegin, compilation failed. Link to comment Share on other sites More sharing options...
fg109 Posted April 11, 2012 Share Posted April 11, 2012 I do not know where you got that script, but there are lots of things wrong with it. Why do you have states in your script when you're not using them for anything? You have a command telling your script to go to one state, but no command telling it to go back to the previous state. What is 'sskythiraamanan' and 'Kythiraamanan'? Why are you trying to have the actor activate itself instead of casting the transform spell like you wanted? Anyway, I would use a script like this: Scriptname Example extends Actor SPELL Property WerewolfChange Auto Event OnCombatStateChanged(Actor actorRef, int combatState) if (combatState == 1) ;started combat WerewolfChange.Cast(Self) elseif (combatState == 0) ;left combat DispelSpell(WerewolfChange) endif EndEvent Link to comment Share on other sites More sharing options...
RandomlyAwesome Posted April 11, 2012 Share Posted April 11, 2012 (edited) I'm not A scripter but this may work So instead of Event OnCombatStateChanged(Actor actorRef, int combatState) if combatState != 0 ; 0 = not in combat, so if the state isn't 0, they entered combattryEvent OnCombatStateChanged(Actor actorRef, int combatState) if (Follower.GetCombatState() != 0) ; 0 = not in combat, so if the state isn't 0, they entered combatReplace the word follower with your follower's id/name tough(not sure which one is needed)And if THAT doesn't work try thisEvent OnCombatStateChanged(Actor actorRef, int combatState) if aeCombatState != 0 ; 0 = not in combat, so if the state isn't 0, they entered combatEdit:Ohh well I'm too late fg109's script should be perfect tough. Edited April 11, 2012 by RandomlyAwesome Link to comment Share on other sites More sharing options...
scrivener07 Posted April 11, 2012 Share Posted April 11, 2012 Fg's script is perfect. It will work on any actor you attach the script to. Nice script :thumbsup: Link to comment Share on other sites More sharing options...
Maleagant Posted April 11, 2012 Author Share Posted April 11, 2012 I do not know where you got that script, but there are lots of things wrong with it. Why do you have states in your script when you're not using them for anything? You have a command telling your script to go to one state, but no command telling it to go back to the previous state. What is 'sskythiraamanan' and 'Kythiraamanan'? Why are you trying to have the actor activate itself instead of casting the transform spell like you wanted? Anyway, I would use a script like this: Scriptname Example extends Actor SPELL Property WerewolfChange Auto Event OnCombatStateChanged(Actor actorRef, int combatState) if (combatState == 1) ;started combat WerewolfChange.Cast(Self) elseif (combatState == 0) ;left combat DispelSpell(WerewolfChange) endif EndEvent I tried this out, it works, but there is a slight issue, She will change into a werewolf when she enters combat, But she will not change back after leaving it. Any ideas? (By the way I will be giveing you full credit for this in the Mod since you've helped me solve the issue if we can actually get this to work). Link to comment Share on other sites More sharing options...
scrivener07 Posted April 11, 2012 Share Posted April 11, 2012 Self.DispelSpell(WerewolfChange) Link to comment Share on other sites More sharing options...
Maleagant Posted April 11, 2012 Author Share Posted April 11, 2012 Self.DispelSpell(WerewolfChange) It compiles, but she still wont change back :( Link to comment Share on other sites More sharing options...
scrivener07 Posted April 11, 2012 Share Posted April 11, 2012 Maybe there is a separate spell that handles changing back to a humanoid. Ive never looked at the werewolf spells myself so that could be bunk. Link to comment Share on other sites More sharing options...
Maleagant Posted April 11, 2012 Author Share Posted April 11, 2012 (edited) Maybe there is a separate spell that handles changing back to a humanoid. Ive never looked at the werewolf spells myself so that could be bunk. It looks like she actually dispels it, but she remains a werewolf race, May need to somehow add a function that saves her race before the transformation and then sets her race back to herself after combat ends. (Like Douge does with his Skeever Fevor quest on youtube only he uses a single shot quest, whereas were trying to make this continuous every time thing.) And unfortunately the papyrus script commands work differently on NPC's Vs Quest Alias's (Tried just modifying his set race script but to no avail) :( Edited April 11, 2012 by Maleagant Link to comment Share on other sites More sharing options...
Recommended Posts