Jump to content

How to define an actor.


Kain82

Recommended Posts

I am having a problem compiling a script in the ck.  Each time I try to compile it, it always fails.  In the error message it says the following:

 

Starting 1 compile threads for 1 files...
Compiling "TIF__010012E7"...
D:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__010012E7.psc(9,25): variable TestDummyM is undefined
No output generated for TIF__010012E7, compilation failed.

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

 

 

As you can see, it says my npc 'TestDummyM' is undefined.  My question is:  How do I define him?

Link to comment

Actor Property TestDummyM Auto

 

This will tell papyrus that for this script you have an actor called TestDummyM that you will be using. Everything that is in the CK whether it is an actor, object, place or anything else has to be defined as a property in a script. This can be added yourself or by using the Properties button and Actor is the Type and TestDummyM is the name of it. Once added, use the Properties button, select the property and tell it what that item actually is.

 

You can find more info here: http://www.creationkit.com/Bethesda_Tutorial_Papyrus_Introduction_to_Properties_and_Functions

 

Link to comment

Thanks for the help I did what you said and it worked. :)   I have one more question, how do I make the script fire when I want it too?  For example: I want the script to fire after a conversation ends.

 

Also here's the script I made it compiled, but want to know if I did it right for what I want it to do.  Which is to make an npc play an animation after a conversation.

Scriptname PlayAnimation extends Quest  
{Npc plays animation after dialogue.}
Actor Property TestDummyM auto
Event OnActivate ()
               Debug.SendAnimationEvent(TestDummyM, "bookopen")
endEvent

Should I have made the extends actor?  Or leave it as is?

Link to comment

Ok, I did everything as you said, but when I try to compile the script fragment I get "TestDummyM is undefined" error.

 

Can you tell me if I added the property in the script correctly?

 

Scriptname TestDummyMProperty extends Quest  
{Adds TestDunnyM as a property.}
Actor Property TestDunnyM Auto

Then I entered the following in the end scipt fragment window:

Debug.SendAnimationEvent(TestDummyM, "bookopen")

 

Link to comment

 

Ok, I did everything as you said, but when I try to compile the script fragment I get "TestDummyM is undefined" error.

 

Can you tell me if I added the property in the script correctly?

 



Scriptname TestDummyMProperty extends Quest  
{Adds TestDunnyM as a property.}
Actor Property TestDunnyM Auto

Then I entered the following in the end scipt fragment window:



Debug.SendAnimationEvent(TestDummyM, "bookopen")

 

 

Did you add the property to the fragment in the dialogue? The script fragments in dialogue are complete self contained scripts and not part of the script where fragments from the quest stages are.

Link to comment

Once again thank you for your response as for your question.  No I did not add the property to the fragment in dialogue.  

 

 

So just to be sure.  I have to add the following to the end script fragment?

Actor Property TestDummyM Auto
Debug.SendAnimationEvent(TestDummyM, "bookopen") 
Link to comment

 

Once again thank you for your response as for your question.  No I did not add the property to the fragment in dialogue.  

 

 

So just to be sure.  I have to add the following to the end script fragment?





Actor Property TestDummyM Auto
Debug.SendAnimationEvent(TestDummyM, "bookopen") 

 

Put this line if the script fragment box:

Debug.SendAnimationEvent(TestDummyM, "bookopen")

 

Then compile the script (and get the error).

 

Click on the properties button by the script name and add the property there or right click on the script name and select 'Edit Source' which will bring up the editor. You will see something like this:

 

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment

;NEXT FRAGMENT INDEX 1

Scriptname CDxCA04plug4 Extends TopicInfo Hidden

 

;BEGIN FRAGMENT Fragment_0

Function Fragment_0(ObjectReference akSpeakerRef)

Actor akSpeaker = akSpeakerRef as Actor

;BEGIN CODE

plug.setvalueint(4)   <-------   This line is the only line in the Script Fragment Window

;END CODE

EndFunction

;END FRAGMENT

 

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

 

GlobalVariable Property Plug Auto

 

You can put your property at the beginning or the end of the script. You can select Build which will compile it so you can see if it works or just Save it which will compile it then save it, either way you will still have to save it at the end.

 

Once the property is defined you can click on the properties button and point the property to your actor.

Link to comment
 Everything works fine except when it's time for the animation to play the NPC goes rigid - with arms straight out at the sides - rather then playing the animation. I tried running FNIS but the problem persists.Do you know why this is happening or what I could possibly do to fix it?

 

 

Link to comment

The name of the animation probably isn't correct. Some of the idle's for reading books are: IdleBook_Reading   or   IdleBook_Read    or   IdleBook_TurnOnePage   or   IdleBook_OnePage     or    IdleBook_TurnManyPages  Try one of those and see if they work.

 

Thank you once again, I will try this.

 

 

This might be a problem because you use the Debug.SendAnimationEvent. Do not use it unless you know exactly what you are doing. You want to use an idle animation so use the function for it: Actor.PlayIdle.

Thank you for your reply.  But can you give me an example of the syntax for Actor.Playidle?

Link to comment

The name of the animation probably isn't correct. Some of the idle's for reading books are: IdleBook_Reading   or   IdleBook_Read    or   IdleBook_TurnOnePage   or   IdleBook_OnePage     or    IdleBook_TurnManyPages  Try one of those and see if they work.

Veldarius, I don't know if this is 'valid' or not, but I thought it worth mentioning that the animation is not a vanilla one - it's a new animation created by someone helping us. It works perfectly in the previews he showed us, but that's outside of Skyrim/Creation Kit (3Ds Max?).

 

This is why Kain is making this test cell, so the person making the animations can test them in Skyrim and adjust them to look (and fit) right.

Link to comment

You will probably have to look at FNIS to see how to get the animation into Skyrim or replace a stock animation with yours. Animations are one of those things that I don't think can be made in the CK. When we were doing some testing on the armbinder animations for DD - Integration we replaced some other animations with them until we could get them set up in FNIS.

Link to comment

So I put the following script into script fragment box:

Bool Success
Success = TestDummyM.PlayIdle(bookopen)

But when I press the compile button, I get the following error:

 

Starting 1 compile threads for 1 files...

Compiling "TIF__02000D8D"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02000D8D.psc(10,30): variable bookopen is undefined
No output generated for TIF__02000D8D, compilation failed.
 
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__02000D8D

 

 
 

I also tried these scripts which I found at http://www.creationk...om/Actor_Script

 

Bool PlayIdle(Idle akIdle) = Plays the passed idle on this actor.

Bool PlayIdleWithTarget(Idle akIdle, ObjectReference akTarget) = Plays the passed idle on this actor, overriding the actor's current target with the one given.

 

Which turned out like this:

 

 

Bool PlayIdle(Idle bookopen)
Starting 1 compile threads for 1 files...
Compiling "TIF__02000D8D"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02000D8D.psc(9,13): required (...)+ loop did not match anything at input '('
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02000D8D.psc(9,14): no viable alternative at input 'Idle'
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02000D8D.psc(9,27): required (...)+ loop did not match anything at input ')'
No output generated for TIF__02000D8D, compilation failed.
 
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__02000D8D

 

 

and this:

Bool PlayIdleWithTarget(Idle bookopen, ObjectReference TestDummyM)
Starting 1 compile threads for 1 files...
Compiling "TIF__02000D8D"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02000D8D.psc(9,23): required (...)+ loop did not match anything at input '('
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02000D8D.psc(9,24): no viable alternative at input 'Idle'
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02000D8D.psc(9,37): required (...)+ loop did not match anything at input ','
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02000D8D.psc(9,65): required (...)+ loop did not match anything at input ')'
No output generated for TIF__02000D8D, compilation failed.
 
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__02000D8D

 

 

 

 

 

Link to comment

I also tried adding the Idle Property to fix the previous 'variable bookopen is undefined' error - this is what I got:

Idle Property bookopen Auto
Bool Success
Success = TestDummyM.PlayIdle(bookopen)

Quote

Starting 1 compile threads for 1 files...
Compiling "TIF__02000D8D"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02000D8D.psc(9,0): no viable alternative at input 'Idle'
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02000D8D.psc(9,14): no viable alternative at input 'bookopen'
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02000D8D.psc(11,8): no viable alternative at input '='
No output generated for TIF__02000D8D, compilation failed.
 
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__02000D8D

 

 

As always, any help is appreciated. I'm not really sure what to do at this point..
 
Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use