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] Need help with ForceRefTo Alias


TigerCubofPNW
 Share

Recommended Posts

Okay, so I'm new to modding but I've been studying mods and the scripts that power them and reading tons of helpful tutorials and watching videos so I have a reasonable grasp of the basics. This script I have should be working. It's based on another script which does work. Basically, I am trying to hire NPCs to be servants at my house. (Using the gorgeous Underground Bathhouse by Andragon)

 

Basing my script and how it is used off of her script I came up with this (stripped down to save space, I removed the multiple repeats):

 

{Pap Fragment:} (GetOwningQuest() AS TIGHouseServantInvite).NewServant(akSpeaker)

 

{TIGHouseServantInvite Script:}

 

GlobalVariable Property TIGGBServant01  Auto

 

ReferenceAlias Property  Servant01 Auto

 

Faction Property ServantFaction Auto

 

Function NewServant(Actor (Servant)
      If (TIGGBServant01() == 0)
            Servant01.ForceRefTo(Servant)
            TIGGBServant01.SetValueInt(1)

{repeat a few times}

Endif

 

  Guest.AddToFaction(ServantFaction)
      Guest.EvaluatePackage()

 

EndFunction

 

>>>>>>>

 

So, the script saves and compiles without complaint. The script runs in game, which I know because the global variable does indeed switch from zero to one. And the character is added to the servant faction so there is no problem with akSpeaker knowing it is named Servant in the script. But what it refuses to do is attach the actor to the alias. I confirmed this by creating test dialogue with the condition that the actor had to be linked to the Reference Alias. Additionally, the character did not travel to the house in the way he should have, which tells me he is not using the AI packages in the alias. I also tested this with a follower by bringing them to the house, releasing them and then running the "be a servant" dialogue. They just went home.

 

I have Googled this every way I can think of and every result is basically, "ForceRefTo" should work. So I guess I'm wondering if there is a thing where sometimes it just doesn't work because CK likes to be whimsical or something? My confusion is that there is no difference between my script and the original script save for the names given to the aliases and variables and so on. The aliases I use are set up identically to the ones in the script that work. And while I am no master coder, this is a pretty simple script--if there's a spot available, assign it to the speaker.

 

I generally try to work these things out on my own, so I've never asked for help before so I hope I gave all the info required. I fully expect someone to point out something obvious I missed, but at this point, I'll just be grateful for the answer to the riddle.

 

 

ETA: Found the solution. I don't really understand it, but there was something in the naming of the idles in the alias that seems to be the root of the conflict.

Edited by TigerCubofPNW
  • Upvote 1
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...