Feralkyn Posted May 17, 2016 Share Posted May 17, 2016 (edited) Hey, folks! I have a complex idea in mind, and I'm looking for guidance on the smoothest, easiest way to go about implementing it, since there's likely a few ways to do it. What I'm looking to create: 1. A spell that can be cast on any Falmer (only!) enemy, and will teleport them to location X, IF and ONLY IF there is not already an NPC present in that location (a jail cell). - Done 2. A way to administer a custom potion to said Falmer, and a way to have that potion's effects delayed before application. - Done, without a delay 3. A way to cast a 2nd custom spell on that Falmer, by switching a lever (NOT casting the spell), then checking first whether they are under the potion's effects, with only a "yes" allowing this spell to succeed. 4. Changing this Falmer into a custom NPC based on which Falmer NPC was in the jail cell (i.e. a spellsword will become a Snow Elf spellsword, an archer a Snow Elf archer, etc). - semi-done 5. Having 2 different AI packages for these custom NPCs, which can be toggled through dialogue, but without a separate quest for -each- NPC (since theoretically there could be dozens of them). Basically I want to be able to tell these NPCs to use either a custom sandbox/patrol package, OR ask them to live in the custom home this mod will include, INDIVIDUALLY. ___________ Now, I know this is oversimplified, and a lot to ask, but there's a reason for that. Basically I'm aware I could go about this a ton of different ways, and I want to know from those with experience which methods would be easiest--do I tackle it with a quest? Is there a way to manage it through scripts checking NPC IDs and #s instead, bypassing quests? Do I check it with scripts in the spells, instead? With #2 I could have an activator in the water trough within the jail cell to add the potion, but I'd prefer to have it be an option directly to the jailed Falmer NPC, possibly as dialogue. Would it therefore be easier to despawn the Falmer being "teleported" and simply generate a new Falmer NPC in the jail cell, with the dialogue option for the potion available, etc? Or does anyone have other ideas? If it's too complex to implement as-is, I could easily make it only a handful of hard-to-find, essential and named NPCs instead. But, I'd prefer to make it more free and open-ended. The idea is to have a way to 'cure' Falmer through a quest line, by teleporting them to a certain area, applying a potion then a spell, so that some of them can be returned to a Snow Elf state--at which point Snow Elves will begin to wander Skyrim, or can be invited to stay at your (Snow Elf themed) house. Therefore, I'd prefer if it remains open-ended, since having only a few followers doesn't seem nearly as world-changing or as immersive. However, I'm aware that it may be difficult to manage AI packages through dialogue for potentially dozens of characters, using only one quest--or is it? I'm also having trouble figuring out how to make an NPC--say a "bandit" type, randomly generated NPC--have different faces/hair by default. I made a custom Snow Elf race, but they all appear identical, male and female both, despite having multiple facial options available. Any help on any of these points, or any ideas, inspiration or suggestions, are welcome! Thanks! Edited May 22, 2016 by Feralkyn Link to comment Share on other sites More sharing options...
Feralkyn Posted May 19, 2016 Author Share Posted May 19, 2016 (edited) As an update, here's how I'm tackling this: 1. There is now a spell that targets NPCs, and if they are Falmer (and not a treasfalmercorpse), banishes/fades them away.HOWEVER: I need a script to check the Falmer's combat style (preferable), OR class, so that I can then spawn the appropriate type of NPC back in my jail cell (it will be a different, non-hostile NPC of the same class, with attached dialogue and scripts). By looks, check csstyle is a SKSE-only function, so is there another way to do this? I am not familiar with what the script system can look for. Equipped weapon type? Class? A list of classes? I see this: http://www.creationkit.com/index.php?title=GetClass_-_ActorBase but am not sure how to implement it. For refererence, what I'm trying to do--I was thinking: Falmer Missile -> spawns friendly Falmer Missile userFalmer Shaman -> spawns friendly Falmer Shaman userFalmer Melee -> spawns friendly Falmer Melee userOther/not listed -> spawns friendly Falmer Melee user also but I need a script to check that class or what have you, and then generate the appropriate NPC at the correct location. 2. I have a custom crafting station with a custom potion set up and it will be administered via dialogue to the custom NPCs.3. I am going to control the 2nd spell and cure progression via a quest, with stages, also adding a condition to the Banish spell that one must be on the specific quest stage for the spell to succeed.4/5 is a bridge I'll cross when I come to it, but with quests and a script to check NPC classes, I'd think it shouldn't be too hard (hopefully). Edited May 19, 2016 by Feralkyn Link to comment Share on other sites More sharing options...
Fantafaust Posted May 19, 2016 Share Posted May 19, 2016 (edited) I'm reasonably certain you could use GetClass without SKSE. Find the Falmer classes in the CK(you want the IDs). Make a fire and forget spell with a really simple script attached, that returns a message(debug.notification) depending on what GetClass returns. Standard IfElse run should be fine.Open the game, TGM, and find some Falmer that are clearly some specific type, cast the spell on them, see what you get.As for spawning a new NPC, ehh, I'm not that advanced but I imagine you might be better off making named NPCs to spawn in. Edited May 19, 2016 by Fantafaust Link to comment Share on other sites More sharing options...
Feralkyn Posted May 20, 2016 Author Share Posted May 20, 2016 I will be doing precisely that yes--thanks very much, I'll try this to see if it works :) Link to comment Share on other sites More sharing options...
Fantafaust Posted May 20, 2016 Share Posted May 20, 2016 Let us know how it goes, if it doesn't work, post your code and I'll see if I can help out. Link to comment Share on other sites More sharing options...
Feralkyn Posted May 20, 2016 Author Share Posted May 20, 2016 Right I'm feeling a bit daft, but the resources available on scripts like these are surprisingly scarce. I'm trying to use this: Scriptname SNOWBLINDClassTest extends activemagiceffect Event OnEffectStart(Actor akTarget, Actor akCaster) Debug.Notification("Class: " + akTarget.GetActorBase().GetClass()) EndEvent It works in the sense that it compiles and it attempts to read me a piece of info in-game, but it tells me: "[Class" (without "s) which does not help me. This also won't help in terms of actually getting a code to check the class and then take an action, but if I could at least get -this- function to work, I'd at least know "getClass" works. I'm by no means a scripting expert so even the simpler stuff, if I'm not familiar with it, can take hours to cobble together from other scripts. Am I doing something stupid? Link to comment Share on other sites More sharing options...
Fantafaust Posted May 20, 2016 Share Posted May 20, 2016 I'm coming up empty as well, I get the same return as you.Maybe the classes need to be defined in Properties? Link to comment Share on other sites More sharing options...
Feralkyn Posted May 20, 2016 Author Share Posted May 20, 2016 I'm not even sure, nor do I know quite how to rework the script for that. Hmm... Link to comment Share on other sites More sharing options...
FrankFamily Posted May 21, 2016 Share Posted May 21, 2016 Notification prints a string, "class: " is one, then you add the getclass which returns a class (same as it could return a spell, a weapon or any other form) not a string, so that is not going to work as you expect. You'd need to setup a predefined list of class properties, compare the class of the target to the list with a bunch of if/elseif and print one thing or the other. Link to comment Share on other sites More sharing options...
Feralkyn Posted May 21, 2016 Author Share Posted May 21, 2016 (edited) All right, thank you. If anyone has any examples/similar scripts I can look at that'd be cool, otherwise I'll start working on this. I'm really shocked at how few examples there seem to be, but with this help I should be able to figure it out eventually :smile: Thank you, FrankFamily! Edit--on second look, all Falmer are only one of two classes: "EncClassFalmer" which covers both melee and ranged, and EncClassFalmerShaman, which covers casters. Looks like class won't be a good method of figuring out which Falmer I've got. Unfortunately bar otherwise making a list of every single Falmer npc, it looks like that's what I'll need to do. Shame, but oh well! Edit again--I'm using this code, and it works for the first class/npc type, but if the NPC is a shaman, it isn't spawning the corresponding NPC. Not sure why. I've tried it both with specifying for each class, or just one that's an "else". The NPCs spawn properly using console commands, so they do work in-game. 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) Else If NPC2 && SpawnPlace SpawnPlace.PlaceActorAtMe(NPC2) EndIf Endif Endif EndEvent Edited May 21, 2016 by Feralkyn Link to comment Share on other sites More sharing options...
Recommended Posts