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...

Need help with my Skyrim mod script


TheWinterhawk
 Share

Recommended Posts

Hello there!

The Papyrus structures are giving me a hard time. I still can't figure out how to exactly put up my dog script, though I very much have an idea what it should do.

I have made a dog follower, that finally IS working so far (being something like an altered copy of a dog in the game). There's just a little thing, that I don't like. If you recruit the dog, there's no message, that this dog will follow you now. So, this is exactly what I want to add to my script. My intention was to add a simple text box message when you activate the dog. Of course, the text box should only appear when you click on him first, not when you want to tell him to wait, or dismiss him. So, my idea was to ask for the faction rank of the dog's CurrentFollowerFaction. Once the faction rank is exactly -1 , the box should appear onActivate. Actually a very simple process. But how the heck do I tell CK to do exactly that?

I looked up a function on the CK wiki called GetFactionRank. There is an example that goes like this:

if (Jarl.GetFactionRank(EmpireFaction) >= 0)
Debug.Trace("Jarl is in the empire faction")
endIf

[/codebox]

I have transformed it exactly to my script, being:

[codebox]if (Loki.GetFactionRank(CurrentFollowerFaction) == -1)
Debug.MessageBox("Loki will follow you now!")
EndIf

I have put Loki as a property above my onActivate event. I have also given a value to the property, so it's not missing.

ObjectReference Property Loki Auto

Without the if condition my script works fine. But with my if condition it says GetFactionRank is not a function. And it says CurrentFollowerFaction variable is not set and stuff like that. But the CK wiki says that GetFactionRank IS a function. And why doesn't the programme know, what CurrentFollowerFaction is if it uses this term for the follower form itself? It seems, the programme knows the EmpireFaction, but not the CurrentFollowerFaction. That doesn't make sense. I have looked for typos over and over again, but can't seem to find any.

What is missing? How do I have to put it, if not this way?

Any help is appreciated! Thanks!

Link to comment
Share on other sites

Always use this page as reference while scripting:

http://www.creationkit.com/Category:Papyrus

There you can see that GetFactionRank is a funcion that is a member of Actor script, and you defined Loki as ObjectReference so it won't work. Define him as Actor instead.

The same with CurrentFollowerFaction - it means nothing to the Papyrus until it is properly declared.

You need to use:

Faction Property CurrentFollowerFaction Auto

somewhere in your code and auto-fill this property...

Edited by Artisanix
Link to comment
Share on other sites

Always use this page as reference while scripting:

http://www.creationkit.com/Category:Papyrus

There you can see that GetFactionRank is a funcion that is a member of Actor script, and you defined Loki as ObjectReference so it won't work. Define him as Actor instead.

The same with CurrentFollowerFaction - it means nothing to the Papyrus until it is properly declared.

You need to use:

Faction Property CurrentFollowerFaction Auto

somewhere in your code and auto-fill this property...

Ahhh, I see! This explains my trouble! Thank you so much for your help! I also had to change the value from == -1 to <0 and now the script works perfectly fine!

Now, I think I understand at least a little bit more about the reference structure. Wasn't quite clear, yet.

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...