NoGodMonk Posted July 1, 2018 Author Share Posted July 1, 2018 WOW!! OMG! That's it!!Tonight I'll have time to try this with my spell and see if it summons or I need to "placeatme" them.Thank you soooo much! And yes, probably I'll have a few more questions about the code but don't want to bother you too much :P so I'll try to pick the good ones... Link to comment Share on other sites More sharing options...
morogoth35 Posted July 1, 2018 Share Posted July 1, 2018 (edited) Awesome! :smile: And please if you have any questions then ask them all and don't worry about bothering me - I like helping with this, so if you got any questions or want more help then just ask away! That's the way I and we can help you the best! :smile: Edited July 1, 2018 by morogoth35 Link to comment Share on other sites More sharing options...
NoGodMonk Posted July 2, 2018 Author Share Posted July 2, 2018 (edited) Awesome! It works perfectly! Last night I implemented it and gave it a try. I must admit my spell couldn't summon the creatures, for some reason I don't understand it only played the audio file (??...) (the same happened in one of my previous attempts). So I made a stagger aimed spell (0 strenght, 24 area) with the same visuals...I managed to add the summonFX as a "Hit Effect Art" in the magic effect, so I didn't add the property in the script. Oh joy, oh joy! Since it's been too easy so far, I gave a shot at a dual state activator, pillaging that ba***rd of a defaultcastontrigger (or one of its cousins, don't remember which one) ...and it went right!!So, here's the final script I'm using now: Scriptname ConjureALotofCreaturesWhereYouWantScript extends ObjectReference ObjectReference Property SpellCaster01 Auto ObjectReference Property SpellCaster02 Auto ObjectReference Property SpellCaster03 Auto ObjectReference Property SpellCaster04 Auto ObjectReference Property SpellTarget01 Auto ObjectReference Property SpellTarget02 Auto ObjectReference Property SpellTarget03 Auto ObjectReference Property SpellTarget04 Auto Bool property doOnce auto Spell Property FAKEConjureSpell Auto ActorBase Property myCreature Auto auto STATE active Event OnActivate(ObjectReference akActionRef) If (akActionRef == Game.GetPlayer()) debug.notification("Casting") FAKEConjureSpell.Cast(SpellCaster01, SpellTarget01) FAKEConjureSpell.Cast(SpellCaster02, SpellTarget02) FAKEConjureSpell.Cast(SpellCaster03, SpellTarget03) FAKEConjureSpell.Cast(SpellCaster04, SpellTarget04) Utility.Wait(0.2) SpellTarget01.PlaceActorAtMe(myCreature) SpellTarget02.PlaceActorAtMe(myCreature) SpellTarget03.PlaceActorAtMe(myCreature) SpellTarget04.PlaceActorAtMe(myCreature) gotoState ("inactive") if doOnce == true else utility.wait(10.0) gotoState("active") debug.notification("Ready") endif Else EndIf EndEvent EndSTATE STATE inactive Event OnActivate(ObjectReference akActionRef) If (akActionRef == Game.GetPlayer()) debug.notification("Charging") Else endif EndEvent endSTATE About the creature: they were EncSkeletons; I removed the weapon, gave them 480 more HP, set them to "unaggressive" "cowardly" "puzzled"; changed their aiData to "csDeer" and Override from behavior graph to "BaseRace" (not sure what I'm doing here). Their only aiPackage is "defaultsandboxcurrentlocation1024" and they have some idlemarker in a cut out navmesh.Results: they just move around a bit, when they are attacked they start running around startling the other ones and giving good movable target.I think you can even get them to stay in position changing the aiPackage with some "defaultHoldposition", or you can remove the navmesh from under their feet... For my questions:Am I right to say that without the doOnce property I couldn't have fired the else content?if akActionRef == game.getplayer() it's not just a way to check if it was really the player or someone else, but also to tell the script whether it's been activated at all, is it?How do I Make a Script block into a Spoiler? Sorry, never been so "social" Anyway... I really mean to say Thank you! :smile:You've been kind and helpful and gave me ways to go forward and learn more. Edited July 5, 2018 by NoGodMonk Link to comment Share on other sites More sharing options...
TheWormpie Posted July 3, 2018 Share Posted July 3, 2018 Am I right to say that without the doOnce property I couldn't have fired the else content?If I understand your question correctly; if doOnce is set to True, your script stays in the Inactive state. If DoOnce is set to false, your script will return to Active state after 10 seconds. I'd recommend as good practice to always set a default value for int, float and bool properties - like this: bool property doOnce = true auto This means that even if you don't fill the bool property manually in the CK, it will still be filled with your default value. if akActionRef == game.getplayer() it's not just a way to check if it was really the player or someone else, but also to tell the script whether it's been activated at all, is it?It is just what it looks like; a way to check whether it was the player or someone else activating it. The OnActivate event will only run if your reference has actually been activated, so it's not necessary to check for this (although good practice) unless there's a chance that another reference activates it. How do I Make a Script block into a Spoiler? Sorry, never been so "social"Use the Special BBCode button (third button from the left in the upper left corner), and choose Spoiler. Link to comment Share on other sites More sharing options...
NoGodMonk Posted July 5, 2018 Author Share Posted July 5, 2018 Sorry for the delay, RL can be a b**ch...And thanks for your answers, leaving me with a few more doubt...First and fundamental one: at some point I tried with something as simple as this: ObjectReference Property xMarker01 Auto ObjectReference Property ItemCaster01 Auto Spell Property mysummon Auto Event OnActivate(ObjectReference akActionRef) mysummon.Cast(Itemcaster,xMarker01) EndEventbut didn't work.When I saw the code morogoth35 posted I supposed mine couldn't work for the lack of a IF-chek (along the line of my previous question).BUT... that's not it... so, why mine couldn't work?My most recent theory is "cause ItemCaster01 was a soulgem (with an EditorRefID) instead of a xmarker" and maybe the cast function can't accept that type of argument. If not, why that little script didn't work? Where's the catch? I would really like to understand hows and whys of my mistakes. Thanks again, hopefully I'll be back soon :) Link to comment Share on other sites More sharing options...
TheWormpie Posted July 5, 2018 Share Posted July 5, 2018 (edited) You've called your property ItemCaster01 while you simply use ItemCaster in the Cast function. Apart from that your script looks fine. Remember to fill the properties :smile: Edited July 5, 2018 by wormple12 Link to comment Share on other sites More sharing options...
NoGodMonk Posted July 6, 2018 Author Share Posted July 6, 2018 ooops!... noob mistake, sorry...but I haven't copy-pasted, and the original name wasn't itemcaster01, I triple-checked that on the original :)...So the script should have worked?... Could the problem have been having the script attached to itemcaster itself, the soulgem, receiving an activation by a parent? dwemer button or a primitive, tried both... But I must say that avoiding parenting and having just the script on one single activator is soooo much more elegant! Link to comment Share on other sites More sharing options...
TheWormpie Posted July 6, 2018 Share Posted July 6, 2018 I don't know what's wrong with your setup then. Make sure that your actual spell works and have visual effects so that you know whether it's being fired or not. You can also use the Debug.Notification function to figure out if any part of your script is failing. If the script is attached to the itemcaster reference itself, you can use mysummon.Cast(self, xMarker01) instead, but it's the same result essentially. Link to comment Share on other sites More sharing options...
NoGodMonk Posted July 7, 2018 Author Share Posted July 7, 2018 Thank you for your clarification, I'm now moving to some questing so expect some other thread :P Link to comment Share on other sites More sharing options...
Recommended Posts