Forcing an actor to attack another?

Post » Wed Jun 20, 2012 1:45 pm

I have searched high and low for the answer to this, but I am trying to make an actor attack another actor while ignoring everything else that is going on, so that this actor will always chase after and attack this target even if this actor is getting hit or there is another enemy closer than the target.

The closest I could come to getting this to work is using frequent OnUpdates to check the target and then stop and restart combat with the correct target if the actor is not attacking the correct target. The problem with this method is when my actor is chasing his target, and there is some doofus actor off to the side shooting arrows into my actor, he will briefly stop moving each time he gets hit with the arrow because the arrow turns his attention to the archer for a moment before the script turns his attention back to the intended target.

I want to skip that nonsense altogether and just have my actor ignore hits made against it and only attack the target that I originally told it to with StartCombat(target).


Any help?
User avatar
Cesar Gomez
 
Posts: 3344
Joined: Thu Aug 02, 2007 11:06 am

Post » Thu Jun 21, 2012 4:40 am

Give him an 'UseWeaponAlreadyHolding' package with the 'Ignore Combat' flag checked and the never ending parameter thingy set to True. He should then barrage the target actor no matter what as long as the package is valid.
User avatar
Cool Man Sam
 
Posts: 3392
Joined: Thu May 10, 2007 1:19 pm

Post » Wed Jun 20, 2012 3:56 pm

I gave this a shot, and all it did was make my actors sit there, motionless, and not attack.

Here is the script that I am using to create the actors. It is attached to a magic effect, so basically each actor that gets hit with the effect creates one of these actors to attack it.

Spoiler

Scriptname ESG_ReaperSpawnerScript extends activemagiceffect  ActorBase Property Reaper AutoImageSpaceModifier property TrapImod auto{IsMod applied when we trap a soul}sound property TrapSoundFX auto{Sound played when we trap a soul}VisualEffect property TargetVFX auto{Visual Effect on Target aiming at Caster}VisualEffect property CasterVFX auto{Visual Effect on Caster aming at Target}EffectShader property CasterFXS auto{Effect Shader on Caster during Soul trap}EffectShader property TargetFXS auto{Effect Shader on Target during Soul trap}ObjectReference TheShadeactor MyShadeactor Victimbool bUseWait = TrueFunction CreateReaper()MyShade = Game.GetPlayer().PlaceActorAtMe(Reaper)MyShade.SetAlpha(0.0, False)MyShade.StartCombat(Victim)MyShade.SetAlpha(1.0, True)EndFunctionFunction RemoveReaper()MyShade.Kill()Utility.wait(2)MyShade.DisableNoWait()MyShade.Delete()EndFunctionEvent OnEffectStart(Actor Target, Actor Caster)If (!Victim.IsDead())Victim = TargetbUseWait = FalseCreateReaper()EndIfEndEventEvent OnEffectFinish(Actor Target, Actor Caster)if victimif bUseWaitUtility.Wait(0.25)endifif (Caster.TrapSoul(victim) == true)TrapSoundFX.play(Caster)	  TrapImod.apply()								TargetVFX.Play(victim,4.7,Caster)		  CasterVFX.Play(Caster,5.9,victim)TargetFXS.Play(victim,2)	CasterFXS.Play(Caster,3)endifIf (!Victim.IsDead())RemoveReaper()EndIfendifendEvent

The actor uses the default package list DefaultMasterPackageList also. He also has no spells, only a two handed melee weapon, intended to be a melee character.
User avatar
Logan Greenwood
 
Posts: 3416
Joined: Mon Jul 30, 2007 5:41 pm

Post » Thu Jun 21, 2012 3:01 am

The culprit seems to be the "Ignore Combat" flag. That flag in the package, when turned on, seems to result in my skeletons standing there and not doing jack. When turned off, the package obviously doesn't do what I am trying to do, which is to force the actor to never stop chasing and attacking the target that I set for it originally with StartCombat(Target).
User avatar
Arnold Wet
 
Posts: 3353
Joined: Fri Jul 07, 2006 10:32 am

Post » Wed Jun 20, 2012 6:19 pm

bump!
User avatar
jason worrell
 
Posts: 3345
Joined: Sat May 19, 2007 12:26 am

Post » Thu Jun 21, 2012 3:04 am

hi,

did you try StartCombat Function ?

See http://www.creationkit.com/StartCombat_-_Actor
User avatar
Lyndsey Bird
 
Posts: 3539
Joined: Sun Oct 22, 2006 2:57 am

Post » Wed Jun 20, 2012 1:15 pm

Using stopcombat and startcombat immediately after will cause the actor to attack the new target, but not at any cost. I want to be able to, from a script, cause an actor to enter a tunnel vision of sorts to force him to attack a specific actor, ignoring everything else, until I tell him to stop
User avatar
Bad News Rogers
 
Posts: 3356
Joined: Fri Sep 08, 2006 8:37 am

Post » Thu Jun 21, 2012 4:00 am

Hi,

There's a tutorial from doughamil which talk about forcing player to act

may be you can reuse part of it
http://www.youtube.com/watch?v=rter3FIzvZs
User avatar
Gavin Roberts
 
Posts: 3335
Joined: Fri Jun 08, 2007 8:14 pm

Post » Thu Jun 21, 2012 2:05 am

Seems like using a useweapon procedure would be good for making a spell to direct a single actor to attack another.

But this requires dynamically filling/unfilling a reference alias and quest stages (unless there is a way to force an actor to run a specific package through a script).


The problem is, my spell creates X monsters, where X is the number of enemies within a radius of the player. Each monster is spawned to attack a specific target, so each monster should have its own, individual target and never "gang up on" enemies or run off to fight something that is not in the radius. The problem with this is that I cannot direct the targets into reference aliases in such a way that I can keep track of which monster is attacking which target, as the targets rapidly leave or enter the area.
User avatar
Jesus Duran
 
Posts: 3444
Joined: Wed Aug 15, 2007 12:16 am


Return to V - Skyrim