FrankFamily Posted May 21, 2016 Share Posted May 21, 2016 (edited) The if/else structure at the bottom doesn't look right, if i understund what you want to do, I guess "Else" here means "targetclass =! encclassfalmer" or what's the same here "targetclass == encclassfalmershaman". If so, this should be the proper structure, every if needs it's endif in order. Scriptname SNOWBLINDClassTest extends activemagiceffect ActorBase Property NPC Auto ActorBase Property NPC2 Auto ObjectReference Property SpawnPlace Auto Class Property EncClassFalmer Auto Class Property EncClassFalmerShaman Auto Event OnEffectStart(Actor akTarget, Actor akCaster) ActorBase TargetBase = akTarget.GetBaseObject() as ActorBase Class TargetClass = TargetBase.GetClass() if TargetClass == EncClassFalmer If NPC && SpawnPlace SpawnPlace.PlaceActorAtMe(NPC) Endif Else If NPC2 && SpawnPlace SpawnPlace.PlaceActorAtMe(NPC2) EndIf Endif EndEventAs for the actual code, why not summon directly "akTarget.GetBaseObject() as ActorBase"?, why the class check? as in: (Unless the actors to summon arent the same that will receive the spell?) Scriptname SNOWBLINDClassTest extends activemagiceffect ObjectReference Property SpawnPlace Auto Event OnEffectStart(Actor akTarget, Actor akCaster) ActorBase TargetBase = akTarget.GetBaseObject() as ActorBase If TargetBase && SpawnPlace SpawnPlace.PlaceActorAtMe(TargetBase) Endif EndEvent Edited May 21, 2016 by FrankFamily Link to comment Share on other sites More sharing options...
Feralkyn Posted May 21, 2016 Author Share Posted May 21, 2016 (edited) Hi again! It works perfectly, thank you. You can tell I'm a scripting noob by that sort of simple problem, or maybe my brain's just fried from staring at it all for too long--or both. And yes, the ones being summoned aren't the same ones to be hit by the spell, if I understand your question right. I'll try to explain: The spell has several components (effects/scripts), and is player-cast. The "target conditions" require that the NPC be a Falmer (and not a corpse). The spell then casts a banish animation, then disables the NPC, but while doing so it checks the NPC's class and spawns a different NPC at a different X-Marker based upon which class of NPC you struck with the spell. So basically you hit a Falmer Shaman, it despawns with a banish animation, and you spawn a "Falmer Captive" in my jail cell. The attempt is to make it seem that you've just "captured" the NPC, even though unfortunately it's pretty limited, since there's only 2 "classes" of Falmer, but so many visual (armor, gender, frozen, vampire/winged) variations. You might ask, why not actually teleport the NPC to the X-Marker, and make it friendly? Well, moving on from the last step, my next step is to perform (repeatable) quest stages on said captive, at which point they'll be turned into a Snow Elf NPC--so I do need the classes to be dumbed down to only a handful, so that my next script will know which Snow Elf NPC to generate based on the captive. I might rework it so that you capture the NPC you're striking with the spell, and make it so the class check is on the "captive" NPC instead, but it'll open up all sorts of problems like "why did that captive female Falmer just become a male Snow Elf" (afaik some of the female Shaman are still flagged male), "why did his armor change" and so on. Unfortunately I can't just make a script to check the Falmer base data since there seem to be upwards of 50 different Falmer NPCs. I'm still going to be looking into making it more realistic, regardless; maybe just a different friendly NPC per Falmer -skin- would work, if there's a script to check skins instead. The main thing was getting this script to work, though, and I can tinker with it from there. My next steps are also to figure out how on earth to make multiple NPC faces for my new Snow Elf race rather than them all looking identical. It's a long process x) I hope this makes sense?Thanks so much for your help! Edited May 21, 2016 by Feralkyn Link to comment Share on other sites More sharing options...
Recommended Posts