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

[SKY] Follower sleep mod help


taliessin
 Share

Recommended Posts

I was trying to use the function isPlayerTeammate because this mod uses it in its scripts

Scriptname aaaTableMannerQuestScript extends Quest  

import skse;

GlobalVariable Property aaaTAPOngoing auto

ReferenceAlias [] Property fo auto
ReferenceAlias [] Property par auto

GlobalVariable Property PlayerFollowerCount auto

Event onLoad()
	aaaTAPOngoing.setValue(0)
endEvent

Function onStart()
	int kNPC = 43
	int actual = 0
	Actor [] actors = new Actor[20]
	Actor player = Game.getPlayer()
	Cell playerCell = player.getParentCell()
	int i = playerCell.getNumRefs(kNPC)
	while (i > 0)
		i -= 1
		Actor flw = playerCell.getNthRef(i, kNPC) as Actor
		if (flw != None && flw != player && flw.isPlayerTeammate())
;debug.notification("["+i+"]:"+flw.getActorBase().getName())
			actors[actual] = flw
			actual += 1
		endIf
	endWhile
	i = 0
	while (i < 20 && actual < PlayerFollowerCount.getValue())
		Actor flw = Game.FindRandomActorFromRef(player, 1024)
		if (flw != None && flw != player && flw.isPlayerTeammate())
			int j = 0
			bool found = false
			while (j < actual)
				if (actors[j] == flw)
					j = actual
					found = true
				endIf
				j += 1
			endWhile
			if (!found)
				actors[actual] = flw
				actual += 1
			endIf
		endIf
		i += 1
	endWhile
	i = 0
	while (i < actual)
		if (fo[i] && actors[i] && actors[i].isEnabled() && !actors[i].isDead() && !actors[i].isUnconscious() && actors[i].getSleepState() < 3)
			fo[i].forceRefTo(actors[i])
		endIf
		i += 1
	endWhile
	i = actual
	while (i < fo.Length)
		fo[i].clear()
		i += 1
	endWhile
EndFunction

Function invitation()
;	unregisterForUpdate()
;debug.notification("Invitation start")
	int i = 0
	while (i < par.Length)
		if (fo[i] && fo[i].getRef() && fo[i].getActorRef().getSleepState() < 3)
			par[i].forceRefTo(fo[i].getRef())
		endIf
		i += 1
	endWhile
endFunction

Function feast(Potion akPotion)
	int i = 0
	while (i < par.Length)
		if (par[i].getRef() && par[i].getActorRef().getSleepState() < 3)
			par[i].getActorRef().equipItem(akPotion)
		endIf
		i += 1
	endWhile
endFunction

Function kickOff()
	int i = 0
	while (i < par.Length)
		if (par[i].getRef() && par[i].getActorRef().getSleepState() < 3)
			par[i].onGetUp(None)
			par[i].clear()
		endIf
		i += 1
	endWhile
;debug.notification("Kicked out of feast")
;	registerForUpdate(TAPFollowerUpdateInterval.getValue())
endFunction

To my understanding, the first while cicle fills an array of actors using the if conditional: if the follower is distinct of none, follower is not equals to player and if the follower is player teammate, so in this case the function isPlayerTeammate is working. I still use this mod in my game and it works nice.

Obviuosly i want the "clean" way to make this mod, and if posible working with Serana and any custom follower.

Edited by taliessin
Link to comment
Share on other sites

Interesting. I've tried using the condition GetPlayerFollowerCount and it yielded no results.

We're probably going a bit far afield here and overcomplicating things. MOST follower mods will have followers added in the normal way. Serana is the exception, not the rule. So instead of chasing our tails on this, just add this to your script

Actor Property Serana Auto
Faction Property CurrentFollowerFaction Auto

Event OnInit()
Serana.AddtoFaction(CurrentFollowerFaction)
EndEvent()

Be sure to fill the two properties

What this will do is stick Serana into the faction, whether she likes it or not :)

I looked at the Mrissi mod. I don't know what the problem is, but she is in the usual Potential Folllower and Current Follower factions. So the mod should work on her

 

 

Link to comment
Share on other sites

Ok, i did the things you told me:

first: I edited my script and compiled it

59c880d077609_editedscript.PNG.d4bd5aecc47a7cf9315c24c8efc95785.PNG

Second: i had to add Dawnguard as a master of my plugin because i needed to fill the properties

59c88158429b4_dawnguardadded.PNG.ac71a09556b9abaca780dfebb7638095.PNG

Third: i added my script again to the quest and filled the three properties

59c881e0e7c76_fillfollowerfaction.PNG.35748e9cd79d2f4f20d498f08d512a1c.PNG

59c88210cce42_fillserana.PNG.efeadc73a533956bac2a160549052c0d.PNG

59c8823c7812a_fillalias.PNG.619de8fb4f6290549e55d7d04ecb25d0.PNG

The results were... well... we tried... :(

59c8828f3feaf_dammitserana.thumb.png.4d7bdbb3b7c965dab30d3e053ea2ff14.png

What did i do wrong? i can't get it...

Link to comment
Share on other sites

There are a few possibilities

Your quest mod doesn't have the ticky box "RUN ONCE" checked, does it?

Making this change to your script mid game could be problematic. If you know how, I'd recommend using the save cleaning tool to force Skyrim to reacquire the script for your mod

I know I had you change it. Not sure if you changed it back. Make sure your Dialogue option for "Go to sleep" is set with the Condition "GET IN FACTION" "CURRENT FOLLOWER FACTION" == 1

And finally, it's possible this is just Skyrim being Skyrim. I've had a lot of "artifacts" come up in modding. Like, the dialogue for a character won't come up, you leave the cell, come back, and the dialogue is fine. Skyrim is an old, crotchety, cantankerous game and it tends to be a pain for no reason, but it's what we got.

 

Link to comment
Share on other sites

I finally got it working. It  was a lot of trial and error, but finally fixed

I added a debug notification to the script because it seemed Serana was not adding to the faction

59c98b2b93fb1_debugnotification.PNG.6bc89a9a342cac19ad5fea0ee43ee180.PNG

And i how suspected, The game wasn't executing my script properly

59c98b9726f60_damnserana.thumb.png.d58b9f3b885e201cb317d702eb417b63.png

So i deleted the script using a save cleaner tool as you told me

59c98bde4d855_savecleaned.PNG.3594663f517f0c089a529762828d8609.PNG

And finally when i opened the game...

59c98c42642f9_modworking.thumb.png.ad390c3d17fa32e19f9ce9673e4578c6.png

The dialogue finally show up. Though it show up too even when Serana is not following me...

I also uninstalled the Seranaholic mod, i was thinking it could conflict with my mod that edits Serana... I've not tested if it works with that texture mod...

Now my next goal is if exists the posibility to add a voiced dialogue answer like this mod. I observed that every time you ask for water to the vendors in the inns or some npc in diferent places they answer you with "of course" using his own voice, if you have an idea how to do this please let me know.

 

Link to comment
Share on other sites

Quote

The dialogue finally show up. Though it show up too even when Serana is not following me...

This is a consequence of the way we pushed her into the faction. We could modify the script so it doesn't add her until later in her quest, but the basic issue wouldn't go away. She would still have the dialogue even when not a follower.

Quote

Now my next goal is if exists the posibility to add a voiced dialogue answer like this mod. I observed that every time you ask for water to the vendors in the inns or some npc in diferent places they answer you with "of course" using his own voice, if you have an idea how to do this please let me know.

You do like to play with the parts of Creation Kit that are a pain in the neck, huh? :)

I've never been able to figure out how to do what you want done. It's again one of those things that should be easy but isn't. Sorry, you're on your own there

 

Link to comment
Share on other sites

I've managed to make it work the voice response by studying the ineed mod. I only had to change where it says: Share response data from info. Now everytime i ask my followers to sleep they say of course with his/her voice. It is not working with custom voiced followers though...

 

59cb4099cd23b_ofcourse.PNG.975349499f0c1909b46a6f85ab6cba9e.PNG

And now is working with mrissi too

 

59cb40ee05028_mrissiworking.thumb.png.31c5e2ffd8322ded24da072cb02a8917.png

Now i have to ask you the ultimate help before i share this mod with the fantastic community of tes alliance and posibly with nexus. How can we clear the alias if by mistake i made my follower sleep but i don't wanted to? It is possible to add a dialogue like: "time to get up" when the alias is executing?

Edited by taliessin
Link to comment
Share on other sites

Hey thanks for the tip on the shared dialogue. Huh. Goes to show I don't know everything! :)

Quote

Now i have to ask you the ultimate help before i share this mod with the fantastic community of tes alliance and posibly with nexus. How can we clear the alias if by mistake i made my follower sleep but i don't wanted to? It is possible to add a dialogue like: "time to get up" when the alias is executing?

Why yes. :)

Create your Dialogue Topic for "Time to Get Up"

This time, make the condition (the ONLY condition) GetIsAliasRef SleepAlias == 1

This way, the dialogue comes up only for the follower executing the package

Now, in your script, add a Function like:

Function WakeUp(Actor Follower)
SleepAlias.Clear()
Follower.EvaluatePackage()
EndFunction

Now, in your "Time to get up" dialogue, you add this line (just like you did with the Go to sleep dialogue)

(GetOwningQuest() as FollowerSleepScript).WakeUp(AkSpeaker)

 

Easy peasy. :)

Link to comment
Share on other sites

Well, it have been a long road but i feel satisfied with that i achieved. I added the wake up dialogue successfully and also marked a checkbox called "Good bye" in the two dialogue topics to dismiss the follower dialogue after issue the command.

As promised i uploaded this mod to TES Alliance and Nexus to share my love with everyone and also i give you the credit you deserve for your time and your patience, from the bottom of my hearth i want to thank you, i feel i learned a lot thanks to you and i realize how difficult is to make a mod even a simple mod like this.

Here is my mod in nexus: https://www.nexusmods.com/skyrim/mods/87020/?

And here is in TES Alliance: 

Then is done, my mod is ready, so if a admin want to keep this topic open for someone else i don't have problems. officiate and file.

 

  • Upvote 1
Link to comment
Share on other sites

I'm happy I was of help. It was fun, actually, to figure out the puzzle with you. Modding for me is like a giant jigsaw puzzle, trying to find all the right pieces and where they go. It can be very rewarding. I give Bethesda a lot of crap, but I really am thankful they made the game so customizable.

If you need any more help, just let me know. I don't have all the answers, but I've got enough battle scars to show I've been through the fire with Creation Kit

  • Upvote 1
Link to comment
Share on other sites

  • 5 months later...

Sorry for necro this thread but i have noticed an issue while using my mod. If i have more than one follower and if i want to send them to sleep using the dialogue on each one, only one of them will go to sleep, this is, if one of them is already sleep and i order my other follower to sleep too, the other will get up and return to his normal behavior.

Why is this happening?, It is a issue related with the reference alias?, How can i get the mod working with two or more followers? i am trying to figure out myself but your help will be really appreciated.

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