Jump to content

[LE] Allow multiple Nightingale Powers - Modifying quest script


Recommended Posts

Hi Nexus!

 

I'm getting more confident with the Object Manager, but am still new to scripts.

 

First off; I want to make it so that a player can have all three Nightingale Powers from the Thieves Guild Quest line at the same time, and instead switch between a trio of passives (like they switch between a selection of powers now).

 

 

 

  • Agent of Shadow (Crescent Moon) - Use this power to be invisible for 2 minutes while sneaking.

"The Agent of Stealth is the master of remaining unseen. They are able to manipulate the darkness and use it to their advantage. On moonlit nights or in darkened rooms, this agent literally becomes invisible."

  • Agent of Subterfuge (Half Moon) - Use this power to cause all nearby enemies to fight each other for 30 seconds.

"The Agent of Subterfuge utilizes shadow to cloud the judgement of those around him. By weaving the darkness to their will, this agent can manipulate others into fighting for the Nightingale for a limited time."

  • Agent of Strife (Full Moon) - Use this power to invoke a powerful life-drain effect.

"This [sic] Agent of Strife can send forth a tendril of pure darkness into the heart of another, causing great injury to them. At the same time, this tether will bolster the agent's own life force, making him stronger.""

 

 

 

I can deduce that the powers are controlled through a quest: TGNightingalePowerHandler

This quest has little info beyond two scripts, which I've copied below (inelegantly).

 

 

 

QF_TGNightingalePowerHandler_0010B0E0

>name: pTGNQS type: TGNQuestScripts value: TGNightingalePowerHandler

>name: pTGNToggle type: GlobalVariable

 

and

 

TGNQuestScript

>pNightingaleShadowPerkSpell type: SPELL value: the spell from object editor

>pNightingaleStrife type: SPELL value: the spell from object editor

>pNightingaleSubterfuge type: SPELL value: the spell from object editor

 

 

 

And I've had a look at the TGNQuestScript

 

 

Scriptname TGNQuestScript extends Quest  Conditional

float pTGNAward
Spell Property pNightingaleShadowPerkSpell Auto
Spell Property pNightingaleSubterfuge Auto
Spell Property pNightingaleStrife Auto

Bool Function CanIAward()

	Return Utility.GetCurrentGameTime() >= pTGNAward

endFunction

Function AwardDone()

	pTGNAward = Utility.GetCurrentGameTime() + 1

endFunction

Function CleanUpSpells()

	Game.GetPlayer().RemoveSpell(pNightingaleShadowPerkSpell)
	Game.GetPlayer().RemoveSpell(pNightingaleSubterfuge)
	Game.GetPlayer().RemoveSpell(pNightingaleStrife)

endFunction

 

 

It seems to be that the TGNQuestScript removes all the powers... ? But in that case how is the proper one added afterwards?

 

To be concise

How do I let players pick up all powers simultaneously, and never lose them.

What would I have to change/replicate to let players switch between a (new) set of passives, but always keep all 3 active powers?

 

If anyone can help me clear this up, it'd be much appreciated.

Edited by Littlebigpeach
Link to comment
Share on other sites

TGNQuestScript does not remove all the powers, but just defines the function that can do it. The script which calls this function is TG09CircleTriggerScript :

 

 

 

Scriptname TG09CircleTriggerScript extends ObjectReference Conditional

Quest Property pTG09Quest Auto Conditional
TGNQuestScript Property pTGNQuestScript Auto Conditional
Spell Property pTG09Spell Auto Conditional
Message Property pTGNMessage Auto Conditional

event onTriggerEnter (objectReference activateRef)

if pTG09Quest.GetStage()>= 70
if activateRef == Game.GetPlayer()
if pTGNQuestScript.CanIAward()
pTGNQuestScript.CleanUpSpells()
Game.GetPlayer().AddSpell(pTG09Spell)
pTGNQuestScript.AwardDone()
else
pTGNMessage.Show()
endif
endif
endif

if pTG09Quest.GetStage() == 70
pTG09Quest.setstage(200)
endif

endevent

 

 

Edited by shumkar
Link to comment
Share on other sites

Ah, okay.

 

I also found TG09ShadowScript, -strifescript, -subterfugescript. They look like this:

 

 

Scriptname TG09TriggerShadowScript extends ObjectReference  Conditional

Quest Property pTG09Quest  Auto  Conditional
Spell Property pTG09ShadowSpell  Auto  Conditional

event onTriggerEnter (objectReference activateRef)

	if activateRef == Game.GetPlayer()
		if pTG09Quest.getstage() == 70
			Game.GetPlayer().AddSpell(pTG09ShadowSpell)
			pTG09Quest.setstage(200)
		endif
	endif

endevent 

 

 

 

I don't get when/where the game defines pTG09Spell though.

 

I need the Cleanupspells (which I assume removes all three powers) to instead remove 3 custom buffs, and the new added ability should be a new custom ability that I made.

However; I still want the player to get (and permanently keep) all three powers somehow.

 

I'm guessing now:

In TGNQuestScript I change the lines

Function CleanUpSpells()

    Game.GetPlayer().RemoveSpell(pNightingaleShadowPerkSpell)
    Game.GetPlayer().RemoveSpell(pNightingaleSubterfuge)
    Game.GetPlayer().RemoveSpell(pNightingaleStrife)

to

Function CleanUpSpells()

	Game.GetPlayer().RemoveSpell(pShadowNewPassive)
	Game.GetPlayer().RemoveSpell(pSubterfugeNewPassive)
	Game.GetPlayer().RemoveSpell(pStrifeNewPassive)

But how do I define these new objects? And how do I make the game also add the old powers (and not remove them again)

 

 

 

I'm not sure which bits to edit where...

 

-Also, sorry for the late reply.

Edited by Littlebigpeach
Link to comment
Share on other sites

I still want the player to get (and permanently keep) all three powers somehow.

 

The author of Better Nightingale Powers adds the 3 powers with console commands player.addspell 000f1987, player.addspell 000f1986, player.addspell 00017122. Sure, this could be done with Papyrus: https://www.creationkit.com/index.php?title=AddSpell_-_Actor

 

I'm guessing now:

 

In TGNQuestScript I change the lines

 

I would recommend you to create your own functions in your own scripts... You could attach your scripts to your quest: https://www.creationkit.com/index.php?title=Dynamically_Attaching_Scripts (and also see the next link below).

 

But how do I define these new objects?

 

To be able to work with any object in a Papyrus script you need to define it as property. An example (with 2 properties: a spell and the player). The property value can be auto-filled or assigned manually while attaching the script in CK (to a quest, or to something else, does not matter to what).

Edited by shumkar
Link to comment
Share on other sites

 

 

The author of Better Nightingale Powers adds the 3 powers with console commands player.addspell 000f1987, player.addspell 000f1986, player.addspell 00017122. Sure, this could be done with Papyrus: https://www.creationkit.com/index.php?title=AddSpell_-_Actor

 

 

I would recommend you to create your own functions in your own scripts... You could attach your scripts to your quest: https://www.creationkit.com/index.php?title=Dynamically_Attaching_Scripts (and also see the next link below).

 

 

 

So if I create a new quest, how would I run it? It still needs to coincide with the old mechanics (talking to Nocturnal, activating one of the moon crests in Twilight Sepulcher)

 

And even if I did add all three powers to the player ("game().GetPlayer().AddSpell( Name of Spell)") I'd still have to modify the original mod script to prevent removing the powers again when player revisits the crests.

 

i.e.

  • When player first completes Darkness Returns they should get All three Power spells (I could add these to the original quest script; in whatever part comes after talking to Nocturnal, I guess).
  • When player afterwards chooses a Crest (Half Moon, Full Moon, Crescent Moon) NOTHING HAPPENS TO THE POWERS (which would normally be (partially) removed), but they get one new passive.
  • The player can then switch Moon Crest once per day (or week?), removing any previous passives and adding a new one. But retaining all the active power spells.

 

Edit: I might just be in over my head here. I've never really tried scripting before (except for one, very simple mod where I had an On-Game-Start quest that added a bunch of perks to player permanently, but that was much simpler than this dynamic back and forth Nightingale system).

Edited by Littlebigpeach
Link to comment
Share on other sites

Unfortunately, my progress in the Thieves Guild is low so I don't know all these specifics.

 

Yeah, the most difficult part here is not scripting as such (unlikely the script would be long and complex; just adding/switching spells) but understanding to which object(s) your script(s) should be attached (may be it's better to attach not to your quest, but to something else), and which event(s) it should contain, to cover all cases that you described. There is a plenty of events in Papyrus https://www.creationkit.com/index.php?title=Category:Events

 

Edit: I don't have yet much experience in creating mods either.

Edited by shumkar
Link to comment
Share on other sites

  • Recently Browsing   0 members

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