Jump to content

Can you use a single TIF script for multiple branches?


Recommended Posts

I'm working on porting my trainer mod to SSE. I have well over 100 fragment script for all of the choices. 6 each on the each of 18 skills.

The nod works fine and I'm ready to publish, but it seems a waste when the same fragment could be utilized 6 times for each skill.

 

Every time I try to add a fragment new fragment to replace the previous fragment, the ck just generate a new fragment.

It's no big deal if I can't, but It sure would cut down the receptiveness.

 

Anyone? TIA!

Link to comment
Share on other sites

The way the Creation Engine works, you can't.

CK generates each time for each topic / dialogue fragment its own unique id and its own unique fragment id that bellongs only to that topic / dialogue line.

Link to comment
Share on other sites

Definitely can, but that requires some SSEEdit chicanery.

Think about it. After adding a script fragment to a TI, you can go to advanced tab and rename the script to whatever you want. It is NOT tied to your TI fromid. And you absolutely should be renaming your fragment scripts to avoid conflicts.

 

Say you added script fragments to your 6 alchemy topics and have 6 separate TIF pex and psc files. Each with a function Fragment_0.

Create a script that extends TopicInfo and put all code from those 6 into it. For scripts 2-6, you rename functions Fragment_1..5. Consider looking at some QF_ scripts for example of how multifragment scripts look.

 

If some fragments are exactly the same, you can get rid of duplicates.

 

Compile in CK using script manager. Save/exit.

 

Go into SSEEdit. In your plugin, go into your topic infos. You will see they have VMAD section indicating which script is attached, and which fragment is called. Here, you can change them to reference your combined script and to call a different fragment.

 

You probably should avoid messing around those topic infos in CK after that.

Link to comment
Share on other sites

I haven't modded or touched the game for like a year and a half, or more..., I can't even remember... and I only used to use xEdit to clean mod an generate SEQ files.

But yeah, you should definitely try what was proposed, and if you can, report back your results if its working, it could come in handy if I decide to make one last mod before quitting Skyrim for good this time.

Link to comment
Share on other sites

I used the CK to change the name of one of the fragments.

I verified all seven response fragments were end fragment_0

I changed the other 6 in SSEEdit to match the "master" fragment.

Only one of the responses played instead of a random one of the other 6 and the fragment script didn't execute.

 

Probably did something wrong or it just won't work.

Gonna leave it as is, but thanks for taking the time to answer.

Link to comment
Share on other sites

Proof of concept.

 

What we got here: Added an extra branch of player dialogue to 'DialogueRiverwood_Revisited', with 4 random responses for Alvor and 3 for Sigrid.

Each TopicInfo calls a script fragment, but you can see that only two scripts are included, illustrating two different cases.

 

Alvor: All four responses call the same 'Fragment_0' function within same TIF_Multi_05005902 script, but each response loads the 'Ingot' property with a different item.

 

Sigrid: All three responses use the same TIF_Multi2_0500AA06 script, which includes three fragments, and each response calls a different fragment.

 

When you test it, remember - it is random, so it CAN be 'streaky'. Sigrid gave me the same response first 6 times before choosing a different one.

Link to comment
Share on other sites

Solid example from I what I used a ton back when. Needs XEdit for you to do modify the attached fragment labelings, and also to renumber IDs so it can identify itself. In this case I use a SKSE call to check the last digit, so naturally this means numbering the ids in a sequential manner like below. I liked this method quite a lot, was a huge headache saver

 

hk3DFGo.jpeg


ScriptName EZTopics Extends TopicInfo Hidden

Function Fragment_0(ObjectReference akSpeakerRef)
	 Int RequestID = StringUtil.SubString(Self,StringUtil.Find(Self," on") - 1,1) as Int)
	 If RequestID == 1
		 (akSpeakerRef as Actor).SetPlayerTeammate()
	 ElseIf RequestID == 2
		 (akSpeakerRef as Actor).SetActorValue("WaitingForPlayer",1.0)
	 ElseIf RequestID == 3
		 (akSpeakerRef as Actor).SetActorValue("WaitingForPlayer",0.0)
	 ElseIf RequestID == 4
		 (akSpeakerRef as Actor).OpenInventory()
	 EndIf
      ; Etc
EndFunction

Link to comment
Share on other sites

  • Recently Browsing   0 members

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