More control over commanded actors?

Post » Thu Jun 21, 2012 9:00 am

I wrote a simple script that was supposed to retrieve my reanimated undead from an alias, and then have him either initiate combat with the target actor or move to the target actor and then feed on it. It doesn't work and I believe it is a problem with packages.

Does anyone know how I might circumvent this? Here is the script:


Scriptname ESG_DarkCommandScript extends activemagiceffectReferenceAlias Property UndeadAlias AutoActor MyUndeadFloat HealthBool ReadyToFeedEvent OnEffectStart(Actor Target, Actor Caster)If UndeadAlias.GetRef() != None  MyUndead = (UndeadAlias.GetRef() as Actor)  If Target.IsDead()   If MyUndead.IsInCombat()	Debug.Notification("Cannot feed during combat.")   Else	Health = 0.5 * MyUndead.GetBaseAV("Health")	ReadyToFeed = MyUndead.PathToReference(Target, 1)	If ReadyToFeed	 MyUndead.StartCannibal(Target)	 MyUndead.RestoreAV("Health", Health)	 Debug.Notification("Gross")	EndIf   EndIf  Else   MyUndead.StopCombat()   MyUndead.StartCombat(Target)   Debug.Notification("RAWR")  EndIfEndIfDispel()EndEvent

I was thinking, there is some default package that I am unaware of that summons and reanimated minions seem to obey. If there is some way to simulate this behavior on an actor that is created using PlaceAtMe(), then perhaps it might be able to override this behavior temporarily in the script, but I am unfamiliar with how packages work and it looks to be very difficult to do this type of thing (modifying the behavior of an actor on the fly).
User avatar
sarah
 
Posts: 3430
Joined: Wed Jul 05, 2006 1:53 pm

Post » Thu Jun 21, 2012 2:05 pm

A lot of us have had trouble trying to get our commanded actors to do what we want. After a lot of testing I found as soon as the 'Summonable' option is ticked on an NPC a lot of hard coded functions take over and most of what you have spent ages scripting to do no longer works.
Best bet to prove its not this problem is duplicate an actor, add the scripts and alias you want to it and use in game console commands to bring it to you and check how it behaves. Then if you find its all working ok go back into the CK and check 'Summonable' then test again in game.
Good luck.
User avatar
Stephanie I
 
Posts: 3357
Joined: Thu Apr 05, 2007 3:28 pm

Post » Thu Jun 21, 2012 8:18 am

The problem is, I am not summoning anything and no summonable checkbox is ticked. I am reanimating non-summonable actors.

So the problem isn't the checkbox, it is the way the game handles commanded actors.

Perhaps there is a solution to this. Has anyone gotten a non-summonable actor to imitate the behavior of a summoned actor? What packages did you use?




For summoned actors, this is easy enough. As soon as I figure out how to use packages, I just stick the packages on an alias or on the actor, then create it with placeatme() and presumably, it would behave like a summon without the problems. Reanimation would be a bit more difficult. I presume that the "ressurect" function "pops" the target up rather than lifting it up like the reanimate spells do. In which case, you would need to play some animation on the actor which I do not know how to do. Then, you would simply strip it of its current factions, and add it to the player follower or player faction. Then you would also need to somehow set it to undead, perhaps by giving it a keyword in an alias and shoving it into the alias with forcerefto, and this may not even return true on the IsUndead condition, probably only just for haskeyword conditions.

Then there is the whole problem of replacing the voice with the reanimated voice.



Even if I go through all that, how would I know if it would even work? Is there some way to provide specific targets for actors, get them to stay put, or anything like that? Maybe through the use of a global variable which is part of a condition on various packages in an alias or something?
User avatar
Steph
 
Posts: 3469
Joined: Sun Nov 19, 2006 7:44 am

Post » Thu Jun 21, 2012 6:57 am

The problem is, I am not summoning anything and no summonable checkbox is ticked. I am reanimating non-summonable actors.

The Reanimate Archetype causes the same problems as the Summon Creature Archetype. Using a reanimate spell on a corpse subverts any packages (faction relations too I think?) it may have had. It also removes the player's ability to activate it. Through my own mod testing I've found another rather annoying bug: when a reanimated actor goes through certain load screens, they are stripped of any spell effects/abilities that may have been added after they were reanimated - even those added by perks like Dark Souls (a perk specifically designed to interact with the Reanimate Archetype).
They also lose any hit shaders they were being affected by, even the one attached to the reanimate magic effect responsible for their continued existence.

Edit:
I just started testing this tonight, but so far it seems successful (should probably knock on wood or do some other superstitious ritual)

I've made a lesser power that will make my reanimated minions either start combat with the target or switch to attacking the target if they're already in combat. So it is possible to override some of the crap associated with these spell archetypes.

Edit#2:
according to the wiki, http://www.creationkit.com/PathToReference_-_Actor wants an Object Reference and you're giving it an Actor...though if that was the problem I would assume you'd get a type mismatch compile error?
User avatar
CYCO JO-NATE
 
Posts: 3431
Joined: Fri Sep 21, 2007 12:41 pm

Post » Thu Jun 21, 2012 11:12 am

The Reanimate Archetype causes the same problems as the Summon Creature Archetype. Using a reanimate spell on a corpse subverts any packages (faction relations too I think?) it may have had. It also removes the player's ability to activate it. Through my own mod testing I've found another rather annoying bug: when a reanimated actor goes through certain load screens, they are stripped of any spell effects/abilities that may have been added after they were reanimated - even those added by perks like Dark Souls (a perk specifically designed to interact with the Reanimate Archetype).
They also lose any hit shaders they were being affected by, even the one attached to the reanimate magic effect responsible for their continued existence.

Edit:
I just started testing this tonight, but so far it seems successful (should probably knock on wood or do some other superstitious ritual)

I've made a lesser power that will make my reanimated minions either start combat with the target or switch to attacking the target if they're already in combat. So it is possible to override some of the crap associated with these spell archetypes.

Edit#2:
according to the wiki, http://www.creationkit.com/PathToReference_-_Actor wants an Object Reference and you're giving it an Actor...though if that was the problem I would assume you'd get a type mismatch compile error?

For the first problem, have you found any fixes? I can't get the damn shader to keep playing but I found a workaround for the spell effects, you just gotta toy with them so they are on the player and not the minion.

The reason you are getting them to attack is because combat preceeds other packages from the wiki. I too am able to make my minion attack specific targets while it is already in combat, but I cannot direct it to start combat or pathtoref if it is out of combat. And startcannibal seems bugged.
User avatar
mike
 
Posts: 3432
Joined: Fri Jul 27, 2007 6:51 pm

Post » Thu Jun 21, 2012 7:20 am

For the VFX/Spell Effect Stripping:
I have a quest script that checks for cell changes and casts an aoe spell on the player that updates the minions VFX and abilities. Just made a new thread a little while ago because theres a slight problem with script casting. Causing the player to script cast something will invalidate EffectWasDualCast and IsDualCasting, which my spells require to function properly.
So I ended up having to make a work around for my work around so that my quest script update only happens if the player isn't dual casting...and to check that I had to stick an ability on the player.


Edit: Turns out they were only starting combat because my spell effect had the Hostile flag checked...derp
And my dudes will start combat. I've been testing with coc riverwood so this hasn't been exhaustively tested but...I can send my mob off to attack whoever even if they're not already in combat.
I have a scripted spell that the player casts on a target, which causes the player to remote cast another scripted aoe spell (with blame on the initial target) that causes any minions in my minion faction that get hit to startcombat with the blamed actor.

Its all unnecessarily convoluted bs but it works for the moment.



Also, I'm fairly certain that the Reanimate effect is never on the target actor. It puts Hit shaders and stuff on whatever it hits, but the effect is somehow tied to the caster.
User avatar
Max Van Morrison
 
Posts: 3503
Joined: Sat Jul 07, 2007 4:48 pm

Post » Thu Jun 21, 2012 2:51 pm

Yes, the reanimated archetype puts the magic effect on the caster, returning the caster as both the target and caster in the oneffectstart and oneffectend events. The reanimated secondary effects are responsible for turning the undead to ash and playing the shader, and the effect exists on the minion.

I was wondering how you managed to.get the shaders to play on a cell change. I have not had any luck with this. I tried a quest with a script on an alias filled with the player, then manually stoping and then playing the shader on the undead which is stored in another alias, inside the event oncellattach. This did nothing. But you say you did it by casting a spell? What event did you use?


I was also thinking of a way to temporarily override the bevahior of a minion. What if you created a global variable, then crammed.the minion into an alias, and put packages into the alias with conditions on the packages that point to the global variable. Then, when you want to modify the behavior of the minion, you just change the global.

You.could test this with a donothing package to temporarily pause the actor so that its default follow.package won't interrupt the pathtoref function. It could work, but I can't test.it.right now.
User avatar
AnDres MeZa
 
Posts: 3349
Joined: Thu Aug 16, 2007 1:39 pm

Post » Thu Jun 21, 2012 7:14 pm

Bump
User avatar
Theodore Walling
 
Posts: 3420
Joined: Sat Jun 02, 2007 12:48 pm

Post » Thu Jun 21, 2012 5:25 pm


I was wondering how you managed to.get the shaders to play on a cell change. I have not had any luck with this. I tried a quest with a script on an alias filled with the player, then manually stoping and then playing the shader on the undead which is stored in another alias, inside the event oncellattach. This did nothing. But you say you did it by casting a spell? What event did you use?


Well, I don't use any aliases. I have a quest script that keeps track of up to 4 thralls and also casts an aoe spell on the player whenever the OnUpdate fires after a cell change. I originally had this spell set up with a reeeaaaly long duration magic effect that applied the shaders I wanted. I changed this spell to a script effect that adds an ability that has the desired shaders (among other things).

My original plan had been to use the perk entry point Apply Reanimate Spell and handle everything through that, but it is just as broken as the rest of this crap.

I will hopefully have a release ready esp Monday or Tuesday. I'll uplaod all my .psc files with it and you can have a look (there are a decent number...). Some of the things I've had to resort to are probably unnecessarily convoluted, which makes my methods a little hard to explain :P

I was also thinking of a way to temporarily override the bevahior of a minion. What if you created a global variable, then crammed.the minion into an alias, and put packages into the alias with conditions on the packages that point to the global variable. Then, when you want to modify the behavior of the minion, you just change the global.

You.could test this with a donothing package to temporarily pause the actor so that its default follow.package won't interrupt the pathtoref function. It could work, but I can't test.it.right now.

I haven't done anything at all with aliases yet so I couldn't even hazard a guess. I'm pretty sure I've seen a thread that discusses a similar procedure (I don't think it worked). Don't remember who it was by but I'll scrounge around and see if I can find it again.
User avatar
Scotties Hottie
 
Posts: 3406
Joined: Thu Jun 08, 2006 1:40 am

Post » Thu Jun 21, 2012 10:01 am

So far I was unsuccessful in getting a reanimated actor to use any packages in an alias. Recreating summoning spells using scripts should be simple, but reanimation is proving more difficult.

I am trying to get an actor to play the reanimation animation where they are "lifted" onto their feet. I can't seem to get it to work. I tried using sendanimationevent(Target, "ReanimateStart") and "Reanimated". Neither did anything.
User avatar
kitten maciver
 
Posts: 3472
Joined: Fri Jun 30, 2006 2:36 pm

Post » Thu Jun 21, 2012 12:09 pm

I haven't tested this but...I had thought about casting a Reanimate spell on a corpse, waiting the 6ish seconds it takes for the animation, then using
GetLeveledActorBase() + PlaceAtMe()
to make a copy, then deleting the original. You could then do whatever you wanted with the copy.

This might cause problems with unique actors involved in quests since you'd basically be resetting the actor, but would be totally fine on random dungeon trash NPCs.
User avatar
Chris BEvan
 
Posts: 3359
Joined: Mon Jul 02, 2007 4:40 pm

Post » Thu Jun 21, 2012 5:07 am

I haven't tested this but...I had thought about casting a Reanimate spell on a corpse, waiting the 6ish seconds it takes for the animation, then using
GetLeveledActorBase() + PlaceAtMe()
to make a copy, then deleting the original. You could then do whatever you wanted with the copy.

This might cause problems with unique actors involved in quests since you'd basically be resetting the actor, but would be totally fine on random dungeon trash NPCs.

The problem with that is that it messes up the actors inventory and their face colors and whatnot get messed up. It is a good idea though. You would have to first place an activator at the actor, delete the actor, then place the new actor though because otherwise the new actor would be placed a few feet away as the game snaps actors placed using placeatme to the nearest empty space on the navmesh. If you have ever tried using placeatme with actors you will know what I mean because they usually are spawned behind the player if you use it on the player, a few feet away, instead of inside/clipping with the player.

I ended up scrapping the idea. Instead, I will just replace the reanimate spells alltogether with spells that summon draugr using placeatme instead. I will make use of the reanimate archetype though, just not for "primary" minions. It will be more like a perk, when your draugr dies, it explodes and reanimates nearby corpses for a minute or so or something like that. Or maybe it spreads disease with its attacks, causing enemies that die while infected to be reanimated. I just can't do what I want with cannibalism and specific actor commands when using the reanimate archetype.

Draugr look pretty cool too, if you mess with their equipment and pimp them out or give them a funky shader or something so I am not too upset with it. I rather like this, as it has opened up quite a few options for interesting perks.
User avatar
Kirsty Wood
 
Posts: 3461
Joined: Tue Aug 15, 2006 10:41 am


Return to V - Skyrim