Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

script do not compile


lotang
 Share

Recommended Posts

Hi,

I'm a complete newbie in modding and I'm trying to figure out why this simple script won't compile:

AkSpeaker.EquipItem(ClothesFarmClothes04)

papyrus says:

Starting 1 compile threads for 1 files...

Compiling "TIF__01088B9B"...

c:\jeux\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__01088B9B.psc(9,20): variable ClothesFarmClothes04 is undefined

No output generated for TIF__01088B9B, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on TIF__01088B9B

After several days trying to fix this reading the docs again and again, I cant' see what I'm doing wrong, I get lost...

Edited by lotang
Link to comment
Share on other sites

You have set up the ClothesFarmClothes04 object reference incorrectly, and as such, the compiler thinks it's a variable which you have not defined any parameters for, and as such, it complains.

You need to set up the ClothesFarmClothes04 as a Property if you haven't done so. Papyrus is blind to all game objects on its own, you must define them for the script in the Creation Kit. That is what Properties are for, it tells the compiler you are referencing an in-game object.

The syntax for referencing an in-game object is: <item type> property <property name> auto. In this case, your item is a piece of clothing, which is of the type Armor, so yours would read "Armor property ClothesFarmClothes04 auto."

And remember, you must do this for every in-game object you want to use in your script. But the plus side is if you set up your properties to have identical names to the objects you want them to reference, the Creation Kit will be able to auto-fill those for you.

Edited by ThomasKaira
Link to comment
Share on other sites

Ok, I anderstand that I have to set "ClothesFarmClothes04" or whatever object ingame as a property for Papyrus (as it doesn't know what it is) and that's why my script is actualy incomplete making the compiler to complain. I also though Papyrus could "recognise" an object by its numerical ID (e.g: 0003452E) as the ingame console does but it's not the case, right? ThomasKaira wrote:

You need to set up the ClothesFarmClothes04 as a Property if you haven't done so. Papyrus is blind to all game objects on its own, you must define them for the script in the Creation Kit. That is what Properties are for, it tells the compiler you are referencing an in-game object.
This really light my way on scripting for Skyrim, thank you. That is a basic and essential concept I wasn't aware of... I'll have a look at WillieSea script class #1 and try to go forward in making my mod with this concept in mind, then I'll be back at you.

Thank you all for giving time and maintaining such a place with ressources and mutual aid :)

Link to comment
Share on other sites

Well, now that I get more familiar with the "attach property" and the "event triggering" things, I manage to write some valid compil-able scripts! HOORAH! :bowdown: ...BUT as I try it in-game, nothing happens. :coffee: Here is my two setups for it.

First way: my "external" script is attached to a dialogue topic in a quest:


Scriptname ChooseNPCOutfit extends Actor

{choose NPC armor clothes default outfit}


Armor property ClothesFarmClothes04 Auto

Actor property akActor1 Auto

Actor property akActor2 Auto


Event OnStoryDialogue(Location akLocation, ObjectReference akActor1, ObjectReference akActor2)

akActor2.EquipItem(ClothesFarmClothes04)

Debug.Trace(akActor1 + " is talking to" + akActor2)

endEvent

I think these instructions are not running in-game 'cause I don't see any debug message! :blink: Second way : End Papyrus fragment of the dialogue topic (localy edited). This code do not compile:

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

;NEXT FRAGMENT INDEX 5

Scriptname TIF__01088B9B Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_4


Function Fragment_4(ObjectReference akSpeakerRef)

Actor akSpeaker = akSpeakerRef as Actor


;BEGIN CODE

Event OnStoryDialogue(Location akLocation, ObjectReference akActor1, ObjectReference akActor2)

akSpeaker.EquipItem(ClothesFarmClothes04)

endEvent

;END CODE


EndFunction


;END FRAGMENT

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


Armor Property ClothesFarmClothes04  Auto

l

the compiler returns:

Starting 1 compile threads for 1 files...

Compiling "TIF__01088B9B"...

c:\jeux\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__01088B9B.psc(9,0): mismatched input 'Event' expecting ENDFUNCTION

c:\jeux\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__01088B9B.psc(13,0): missing EOF at 'EndFunction'

No output generated for TIF__01088B9B, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on TIF__01088B9B

Here I am for now, stucked with this errors that I d'on't anderstand. I can't find a way out only reading the CK online Wiki refence by myself, so I need help again. :dizzy:

Edited by lotang
Link to comment
Share on other sites

Thanks for translating. :thumbup: Ok, now that I've removed the "event" stuff in the fragment code, everything works just fine. :dance:

Let's get a little more complexity now...

NEXT STEP is: dislaying a list of armor / clothes from the NPC's inventory (filtered) to make our choise. Click on the disired item and the NPC get equiped. ...seems to be a longer road to get there :wave:

Edited by lotang
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...