Jump to content

[LE] 'Set Activate Label' perk entry point: Can it be made generic?


foamyesque

Recommended Posts

Okay, so: I have a situation where I want to change the activation text of stuff. Ideally I would also like to preserve their names in the activation prompt. However I have not found any way to do so via SAL (which is what I'm using, to, for example, replace 'Pickpocket' with 'Steal from'). Does anyone know if such is possible, either through this method or some other?

Edited by foamyesque
Link to comment
Share on other sites

If it's possible I never found it and I was looking for that too. I even tried inserting text replacement code but it seems the field is just literal text and overrides everything. (I was going to use it to have the prompt show Steal instead of Read if the book was owned by someone else. But then I couldn't see the name of the book I was about to steal.

 

If you always want the 'Pickpocket' prompt to be 'Steal from' then you could change the sPickpocket game setting. But I don't know of any way to make it dynamic.

Link to comment
Share on other sites

If it's possible I never found it and I was looking for that too. I even tried inserting text replacement code but it seems the field is just literal text and overrides everything. (I was going to use it to have the prompt show Steal instead of Read if the book was owned by someone else. But then I couldn't see the name of the book I was about to steal.

 

This is more or less my problem, yeah. I want to override the default activation text in a couple of specific situations, but in ones where I can't simply create an activator. I'd like to be able to have that respect the name of the thing being activated. I'll poke around with the mod Ishara suggested but I have a nasty suspicion it just overrides the game-setting strings for all activations, and I don't want to do that. :sad:

 

EDIT:

 

Yeah, it's an MCM front end for SetGameSetting function calls that adjust the default strings.

Edited by foamyesque
Link to comment
Share on other sites

Can you not change the string as desired and change it back afterwards? Some extra work but probably the only potential solution.

 

I'd have to change it every time the player put their crosshairs over the object in question -- and there's no guarantee that changing it back will work correctly, either.

Link to comment
Share on other sites

Now that I think about it there is one other option. I play with the on-screen strings dynamically in Sometimes Pick Up Books using SKSE's UI functions. It generally works except for Russian language translation issue and the fact that the setting isn't as dynamic as I would have really liked. Give the mod a try and see what you think. The source for the scripts should be packed in the BSA somewhere.

Link to comment
Share on other sites

Yes, the UI stuff is fairly undocumented because the folks that understand it best don't really deal with Papyrus and more than they absolutely need to.

 

And unfortunately for you I just remembered that I decided against that direct UI change for Sometimes Pick Up Books and went with a method that changed the sRead game setting for performance reasons.

 

But just in case it helps here is the old dynamic version of the code:

 

 

Event OnCrosshairRefChange(ObjectReference ref)
{Dynamically changes the prompt to reflect what will happen when activating the targetted book.}
	Book base
	if ref
		base = ref.GetBaseObject() as Book
	endif
	if base
		string prompt
		if (keyPressed == AlwaysTake && !base.GetSpell()) || !base.IsTakeable() || ref.IsActivationBlocked()
			prompt = actionName[0]  ; Read (might not be technically accurate for activation-blocked books)
		elseif ref.IsOffLimits()
			prompt = actionName[1]  ; Steal
		else
			prompt = actionName[2]  ; Take
		endif
		if base.IsRead() ; indicate previously read books with a grey prompt (for read/take but not steal)
			prompt = "<font color='#808080'>" + prompt + "</font>"
		endif
		string label = UI.GetString("HUD Menu", "_root.HUDMovieBaseInstance.RolloverText.text")
		label = StringUtil.Substring(label, StringUtil.Find(label,StringUtil.AsChar(13)))
		if !label
			label = ""
		endif
		if ref == Game.GetCurrentCrosshairRef() ; a last check to make sure the crosshair is still on the book
			UI.SetString("HUD Menu", "_root.HUDMovieBaseInstance.RolloverText.htmlText", prompt + label)
		endif
	endif
EndEvent

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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