Jump to content

Script in dialogue variable undefined


TheTetrahedron

Recommended Posts

Hello!

 

Simple and stupid question...

I downloaded a follower mod an modified it a little bit. So you have to talk to some peploe before you can use the follower.

To do so, I changed the rank of potentialfollowerfaction to - 1.

In the last dialogue I wanted it to change it back to 0 with setfactionrank.

 

So I put a little fragment there:

MyExamplefollower.setfactionrank(potentialfollowerfaction, 0)

But compiling just says variable undefined.

My Example Follower is set as alias in this quest.

What did I forget?

Link to comment
Share on other sites

Thanks for your help!

 

 

I'll test it tomorrow, I have to work...

 

 

Uh... properties...

 

 

I edidet the script manually, this is my idea

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname TIF__0100B4BF Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
getowningquest().setstage(200)

Sita.GetActorRef().setfactionrank(potentialfollowerfaction, 0);
Sita.GetActorRef().setfactionrank(potentialMarriagefaction, 0);
Sita.SetRelationshipRank(Game.GetPlayer(), 4);
getowningquest().setstage(200)



;END CODE
EndFunction
;END FRAGMENT

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


actor property sita auto

back in my mind is just this little actor property... line....

Edited by TheTetrahedron
Link to comment
Share on other sites

In the bottom right corner of your info window, you'll find a "script" section with a file named TIF_whatever. Double-click on it to open the properties windows and point your "sita" property to the proper quest alias.

 

You'll also need to insert another GetActorRef() before SetRelationshipRank.

Link to comment
Share on other sites

I'm sorry...

It id driving me nuts...

 

I tried and edited teh script manually...

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname TIF__0100B4BF Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
Sita.GetActorRef().setfactionrank(potentialfollowerfaction, 0);
getowningquest().setstage(200)
;END CODE
EndFunction
;END FRAGMENT

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

An what I get now:


Starting 1 compile threads for 1 files...
Compiling "TIF__0100B4BF"...
D:\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0100B4BF.psc(9,5): GetActorRef is not a function or does not exist
D:\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0100B4BF.psc(9,34): variable potentialfollowerfaction is undefined
D:\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0100B4BF.psc(9,19): none is not a known user-defined type
No output generated for TIF__0100B4BF, compilation failed.

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

Now nothing is working...

 

I made a little follower mod years ago, but no i have no clue...

 

 

If still somebody wants to help, I tell the whole story again, maybe I am missing something:


How i worked:

I edited the actor and set potentialfollowerfaction to -1.
so all the follower dialogue did not show up.
Then I made all the dialogues in the quest, everything works fine.
In the last dialogue with, Sita, thats the follower, in the last branch, in the last topic info window, I try to set the relationshiprank to 0
To do so, i tried to add a papyrus fragment:
Sita.GetActorRef().setfactionrank(potentialfollowerfaction, 0);
getowningquest().setstage(200)
but it won't compile.

I experimentet with akspeaker, still no success.

I have no idea how to get this working.

 

Link to comment
Share on other sites

You are still missing your properties...

 

Your script looks fine. On the CK window where you entered your script, look in the bottom right corner for a script entry named "TIF_somethingorother". Double-click it, and add your two missing properties: sita, and potentialfollowerfaction.

 

Name: sita

Type: referencealias

Value: your follower's quest alias

 

Name: potentialfollowerfaction

Type: Faction

Value: potentialfollowerfaction

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for your answer!

 

Well, I have little time in the moment, but at least I tried today.

 

So I tried to add the properties, but i get errors all the time:

 

 

Starting 1 compile threads for 1 files...
Compiling "TIF__0100B4BF"...
D:\Steam\steamapps\common\skyrim\Data\Scripts\Source\TIF__0100B4BF.psc(17,31): no viable alternative at input 'Sita'
D:\Steam\steamapps\common\skyrim\Data\Scripts\Source\TIF__0100B4BF.psc(19,44): no viable alternative at input 'PotentialFollowerFaction'
No output generated for TIF__0100B4BF, compilation failed.

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

 

 

 

 

The script looks like this after trying to add the properties:

 

 

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname TIF__0100B4BF Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
Sita.GetActorRef().setfactionrank(potentialfollowerfaction, 0);
getowningquest().setstage(200)
;END CODE
EndFunction
;END FRAGMENT

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

ReferenceAlias Property Sita = Sita Auto  

Faction Property PotentialFollowerFaction = PotentialFollowerFaction Auto  

 

 

 

 

But saving it only gives me the same error as above.

 

 

 

 

 

Is there another idea?
Maybe just let the rank at 0 but hide all other dialogue options until the quest is finished?

Edited by TheTetrahedron
Link to comment
Share on other sites

Adding the property declarations to the script is one thing.

 

Assigning a value to these properties cannot be done in the script, unless it is a simple numerical or string value. These assignments are made in the CK. Double click on your TIF; it will open a window like this:

 

https://drive.google.com/file/d/1d5tSDBKjy6GxkqUZwQouflMIEhG7TNi9/view?usp=sharing

 

https://drive.google.com/file/d/1I3Hw7R4ppz-K6Zd-7DDSvSeuaUGT9YE_/view?usp=sharing

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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