Script to override ignore combat package

Post » Wed Sep 28, 2016 12:18 pm

Hi all I am currently trying to create a draugr boss that sits on a throne ignoring all combat around him sitting asleep until the player attacks him. I have achieved this by using a Nor throne (static object not furniture) and creature sit marker 3. I have given the draugr boss a sit package with the ignore combat flag checked and attached the following script to the boss:



Scriptname OSMobiusScript extends ObjectReference

Actor Property Mob Auto

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \
bool abBashAttack, bool abHitBlocked)
If (akAggressor == Game.GetPlayer())
Mob.setAV("Aggression", 2)
Endif
EndEvent

The problem is when the player attacks the draugr the script does not override the ignore combat package, the draugr just remains motionless like a statue sitting on the chair.



Does anyone know how to solve this problem????

User avatar
Maddy Paul
 
Posts: 3430
Joined: Wed Feb 14, 2007 4:20 pm

Post » Wed Sep 28, 2016 8:42 pm

Condition that sit package on aggression < 2 and then to be extra certain it triggers modify your script like this:



Scriptname OSMobiusScript extends Actor

State WaitingForAttack Auto

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
If (akAggressor == Game.GetPlayer())
GoToState("")
SetActorValue("Aggression", 2)
EvalutatePackage()
Endif
EndEvent

EndState

There are four changes in my version. First, since the script is attached to the Draugr I use Actor instead of ObjectReference. Second with that change of script type and since the script is attached to the draugr you don't need a property. Third, the EvaluatePackage makes sure the AI package will get switched after you change aggression. And finally, I wrapped the event in a new state and change the state after that first hit so future hits don't keep modifying the AI and needlessly trigger script events. (Adding Auto at the end of the State line makes that the default state.)

User avatar
Davorah Katz
 
Posts: 3468
Joined: Fri Dec 22, 2006 12:57 pm

Post » Wed Sep 28, 2016 2:55 pm

Thanks! will give this a try :)

User avatar
JLG
 
Posts: 3364
Joined: Fri Oct 19, 2007 7:42 pm

Post » Wed Sep 28, 2016 10:37 am

It reports the following errors on compile:



Starting 1 compile threads for 1 files...
Compiling "OSMobiusScript"...
C:\Program Files (x86)\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\OSMobiusScript.psc(3,23): required (...)+ loop did not match anything at input 'Auto'
C:\Program Files (x86)\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\OSMobiusScript.psc(13,0): missing EOF at 'EndState'
No output generated for OSMobiusScript, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on OSMobiusScript
User avatar
Kellymarie Heppell
 
Posts: 3456
Joined: Mon Jul 24, 2006 4:37 am

Post » Wed Sep 28, 2016 10:29 pm

Change this:



State WaitingForAttack Auto

to this:



Auto State WaitingForAttack
User avatar
Rhi Edwards
 
Posts: 3453
Joined: Fri Jul 28, 2006 1:42 am

Post » Thu Sep 29, 2016 1:19 am

Thanks. Going to bed now ill try it tomorrow and report results :)

User avatar
Stephanie I
 
Posts: 3357
Joined: Thu Apr 05, 2007 3:28 pm

Post » Wed Sep 28, 2016 1:21 pm

That's what I get for writing scripts and not trying to compile them myself. Sorry.

User avatar
Jessica Phoenix
 
Posts: 3420
Joined: Sat Jun 24, 2006 8:49 am

Post » Wed Sep 28, 2016 4:18 pm

Still does not work. Now I get this error:



Starting 1 compile threads for 1 files...
Compiling "OSMobiusScript"...
C:\Program Files (x86)\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\OSMobiusScript.psc(26,2): EvalutatePackage is not a function or does not exist
No output generated for OSMobiusScript, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on OSMobiusScript

User avatar
Sasha Brown
 
Posts: 3426
Joined: Sat Jan 20, 2007 4:46 pm

Post » Wed Sep 28, 2016 4:37 pm

No worries lol your help is appreciated

User avatar
Shelby Huffman
 
Posts: 3454
Joined: Wed Aug 08, 2007 11:06 am

Post » Wed Sep 28, 2016 2:27 pm

Never mind got it working was a spelling error on the word evaluate lol. Thanks everybody.

User avatar
Matt Terry
 
Posts: 3453
Joined: Sun May 13, 2007 10:58 am

Post » Wed Sep 28, 2016 3:33 pm

See if you can get him to constantly condition his sitting so he can be made to get up.

User avatar
Leticia Hernandez
 
Posts: 3426
Joined: Tue Oct 23, 2007 9:46 am

Post » Wed Sep 28, 2016 10:25 pm

Thanks for the reply but I now have it fully functioning 100% the way I want it

User avatar
Leilene Nessel
 
Posts: 3428
Joined: Sun Apr 15, 2007 2:11 am


Return to V - Skyrim