IsharaMeradin Posted October 17, 2016 Share Posted October 17, 2016 Your syntax for the OnHit event is incorrect. There are more parameters than what you have. This is why the compiler is having an issue. Correct:Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) You have to include all of the parameters when using an event or function even if you won't need to access them in the script otherwise it will complain when trying to compile. Link to comment Share on other sites More sharing options...
mmft93 Posted October 17, 2016 Author Share Posted October 17, 2016 Oh ok I didn't know I had to put everything. I changed it and it finally compiled :) ! One little problem now though, my activator will cast vanilla spells no problem but when I ask it to cast custom spells it wont work is there some way around this. my script if thats the problem: ScriptName SacredTreeSpellCast3 extends ObjectReferencespell property myspell autoprojectile property spellprojectile autoEvent OnHit(ObjectReference akActionRef, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) If akProjectile == spellprojectile ObjectReference SelfObj = Self as ObjectReference mySpell.cast(SelfObj, SelfObj) EndIfEndEvent Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 17, 2016 Share Posted October 17, 2016 If it casts stock spells just fine, then there shouldn't be a problem with the script.Make sure that you have the properties correctly assigned.Do you know if the custom spell works outside of this scenario? If the problem ends up being in the spell some where, I can't really help with that. I haven't made that many spells and there is still a lot that I do not know in that regard. Link to comment Share on other sites More sharing options...
mmft93 Posted October 17, 2016 Author Share Posted October 17, 2016 The custom spell is the same as the vanilla spell the only deference is I made it a little bit stronger. Its the pacify spell, in vanilla Skyrim it only affects people up to level 20 so I made a custom version that affect people up to level 80. I probably accidentally changed something in the spell effect I'll double check. Thanks a ton for helping with the scripts. Just need to find out a few more things and then the next version of the mod should be exciting when released :) . Link to comment Share on other sites More sharing options...
mmft93 Posted October 25, 2016 Author Share Posted October 25, 2016 Help?I was trying to write a simple script that would increase spells damage based on destruction level. No fancy formulas or anything just a simple script. scriptname NatureDestructionMagicIncrease extends ActiveMagicEffectFloat DamAugmentEvent OnEffectStart(Actor akTarget, Actor akCaster) state OnBeginState () DamAugment = akCaster.getAV("Destruction") akTarget.DamageAV("Health", DamAugment) endstateEndEvent However I'm getting a lot of errors and I have no idea why? Starting 1 compile threads for 1 files...Compiling "NatureDestructionMagicIncrease"...C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NatureDestructionMagicIncrease.psc(3,17): required (...)+ loop did not match anything at input 'auto'C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NatureDestructionMagicIncrease.psc(3,21): mismatched input '\\r\\n' expecting STATEC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NatureDestructionMagicIncrease.psc(6,1): no viable alternative at input 'state'C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NatureDestructionMagicIncrease.psc(6,20): required (...)+ loop did not match anything at input '('C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NatureDestructionMagicIncrease.psc(7,13): mismatched input '=' expecting LPARENC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\NatureDestructionMagicIncrease.psc(0,0): error while attempting to read script NatureDestructionMagicIncrease: Object reference not set to an instance of an object.No output generated for NatureDestructionMagicIncrease.psc, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on NatureDestructionMagicIncrease.psc Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 25, 2016 Share Posted October 25, 2016 You cannot declare a state within an event. Link to comment Share on other sites More sharing options...
mmft93 Posted October 25, 2016 Author Share Posted October 25, 2016 (edited) Oh ok I will try to rewrite it thank you. It worked scriptname NatureDestructionMagicIncrease extends ActiveMagicEffectFloat DamAugmentEvent OnEffectStart(Actor akTarget, Actor akCaster) DamAugment = akCaster.getAV("Destruction") akTarget.DamageAV("Health", DamAugment) EndEvent just took out the state part thank you your a lifesaver IsharaMeradin thank you :) Edited October 25, 2016 by mmft93 Link to comment Share on other sites More sharing options...
mmft93 Posted October 26, 2016 Author Share Posted October 26, 2016 Ran into another wall this time I was trying to add onto one of my previous scripts. The one that allows the activator to cast a spell. I was trying to add onto it to make it delete the activator after a certain amount of time once it had been activated. I keep getting an "error did you forget loop" or something like that. An example of my script: ScriptName NatureActivatorTreeSpellCast extends ObjectReferencespell property myspell autoEvent OnActivate(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() ; only the player can activate this ObjectReference SelfObj = Self as ObjectReference mySpell.cast(SelfObj, SelfObj) utility wait (10) ObjectReference delete() EndIfEndEvent I tried defining specifically which object reference to delete but it kept telling me object already defined not needed. So I just put ObjectReference delete() and it stopped giving me that error and gave me the new one instead. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 27, 2016 Share Posted October 27, 2016 Utiltiy Wait (10) should beUtility.Wait(10) ObjectReference delete()should beDelete() orSelf.Delete()orSelfObj.Delete() ;this one is possible because you already defined it earlier in the script Link to comment Share on other sites More sharing options...
mmft93 Posted October 28, 2016 Author Share Posted October 28, 2016 It worked thank you :) . Wow, such little mistakes I think I'm getting better though thanks to you. Link to comment Share on other sites More sharing options...
Recommended Posts