Jump to content

Script: About Quest Aliases


Zorkaz

Recommended Posts

Can someone lead me to the right tutorial about quest aliases if it exists?

 

The setup:

 

Basically I have a misc item called "Mining Explosives" (It can't be an explosive because you need at least 8 to get out of a Canyon)

 

When I activate a holotape via Pipboy (Via Event OnItemEquipped())

it should detonate those mines (Via placeatme(Explosion) and .Disable())

Of course it checks if the main quest has been completed

 

The issue:

 

Well everything.

I get that you need to make a alias that searches via "Find matching Reference", closest to player.

And "HasKeyword" is important too.

 

 

But how can I achieve the rest? I know it's a big and vague question.

Link to comment
Share on other sites

I would tend to model it in script as its more flexible before optimising with an alias fill.

 

Unless it needs specific RefCollection alias fill conditions to detect.

 

Which a bunch of known MISC objects the the loaded area do not:

Actor      Property pPlayerREF      auto const mandatory 
MiscObject Property pMiscExplosives auto const mandatory
Explosion  Property pCGPrewarNuke   auto const mandatory

Function ExplosivesGoBoom()

ObjectReference[] Explosives = pPlayerRef.FindAllReferencesOfType(pMiscExplosives, afRadius = 10240)

If (Explosives.Length < 8) 
	;Too Few case
ElseIf (Explosives.Length > 8) 
	;Too many case
ElseIf 	(Explosives.Length == 8) ;goldilocks case 
	Int iIndex =0
	While (iIndex < Explosives.Length)
		Explosives[iIndex].PlaceAtMe(pCGPrewarNuke)
		Explosives[iIndex].Disable()
		Explosives[iIndex].Delete()
		iIndex +=1
	Endwhile
EndIf

EndFunction

The Quest alias way would be to create a ReferenceCollectionAlias, set Max count 0, set Optional, Fill conditions GetIsID == MiscExplosives (or whatever the Form name is). Then attach a script to the quest with;

Explosion          Property pCGPrewarNuke   auto const mandatory
RefCollectionAlias Property Alias_Explosives auto const mandatory

Event OnQuestInit()

If (Alias_Explosives.GetCount() < 8) 
	;Too Few case
ElseIf (Alias_Explosives.GetCount()  > 8) 
	;Too many case
ElseIf 	(Alias_Explosives.GetCount() == 8) ;goldilocks case 
	Int iIndex =0
	While (iIndex < Alias_Explosives.GetCount())
		Alias_Explosives.GetAt(iIndex).PlaceAtMe(pCGPrewarNuke)
		Alias_Explosives.GetAt(iIndex).Disable()
		Alias_Explosives.GetAt(iIndex).Delete()
		iIndex +=1
	Endwhile
EndIf

(Self as Quest).Stop()

EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

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