Jump to content

Some Quest/scripting advice.


Recommended Posts

Oh, sorry. The problem is your TranslateToRef call. Your speed setting is way too low, so it takes way too long for your object to "fall". Try something like:

TranslateToRef(targetvar,8000,0.0)

Edited by Reneer
Link to comment
Share on other sites

 

 

current Code in trigger box.

Scriptname droppodfalling extends ObjectReference Default

Quest Property DO_sob_incomingpod_quest Auto Const
ReferenceAlias Property podswitch Auto Const
ReferenceAlias Property podtarget Auto Const

Event onTriggerEnter(ObjectReference akActionRef)

	if akActionRef == Game.GetPlayer()
		if DO_sob_incomingpod_quest.GetStage() > 0		
			pod()
		endif
	endif

EndEvent

function pod()

	DO_sob_incomingpod_quest.SetObjectiveCompleted(10)
	utility.Wait(3)
	Debug.Notification("3 SECONDS PASSED")
	ObjectReference targetvar = podtarget.GetReference()
	targetvar.EnableNoWait()
	Debug.Notification("Var = " + targetvar )
	TranslateToRef(targetvar,8000,50)

EndFunction

Event OnTranslationComplete()

	DO_sob_incomingpod_quest.SetObjectiveDisplayed(20)
	Debug.Notification("TRANSLATION COMPLETED")
	podswitch.GetReference().Enable(true)

EndEvent

Its not reaching the second event still.

Link to comment
Share on other sites

Ok. The problem, which is partly my fault, is that the TranslateToRef is working on your trigger box, since that's what you are calling it on. You need to set up another property that points to the "falling" static item and put this code on your trigger box and also create a "podfalling" ReferenceAlias that points to your falling pod:

Scriptname droppodfalling_trigger extends ObjectReference

Quest Property DO_sob_incomingpod_quest Auto Const
ReferenceAlias Property podswitch Auto Const
ReferenceAlias Property podtarget Auto Const
ReferenceAlias Property podfalling Auto Const

Event onTriggerEnter(ObjectReference akActionRef)

    if akActionRef == Game.GetPlayer()
        if DO_sob_incomingpod_quest.GetStage() > 0        
            pod()
        endif
    endif

EndEvent

function pod()

    DO_sob_incomingpod_quest.SetObjectiveCompleted(10)
    utility.Wait(3)
    Debug.Notification("3 SECONDS PASSED")
    ObjectReference targetvar = podtarget.GetReference()
    targetvar.EnableNoWait()
    Debug.Notification("Var = " + targetvar )
    Self.RegisterForRemoteEvent(podfalling.GetReference(), "OnTranslationComplete")
    podfalling.TranslateToRef(targetvar, 8000, 50)

EndFunction

Event ObjectReference.OnTranslationComplete(ObjectReference akSender)

    DO_sob_incomingpod_quest.SetObjectiveDisplayed(20)
    Debug.Notification("TRANSLATION COMPLETED")
    podswitch.GetReference().Enable(true)

EndEvent
Edited by Reneer
Link to comment
Share on other sites

I don't know if JLundin fixed everything papyrus related in Fallout 4.. He took care of the location functions, and GetItemCount..

 

But if you keep having any issues with OnTranslationComplete(), then it's still broken(like in Skyrim) and you need to use OnTranslationAlmostComplete().

Link to comment
Share on other sites

I don't know if JLundin fixed everything papyrus related in Fallout 4.. He took care of the location functions, and GetItemCount..

 

But if you keep having any issues with OnTranslationComplete(), then it's still broken(like in Skyrim) and you need to use OnTranslationAlmostComplete().

It's not broken. I have several (never released) mods that use it extensively.

 

Edit: I noticed something in the video - how are you filling those ReferenceAliases? It looks like they aren't pointing to anything, at least going by the debug message that pops up at 0:06. That would explain a lot.

Edited by Reneer
Link to comment
Share on other sites

VfjXlcc.jpg
Scriptname droppodfalling extends ObjectReference

Quest Property DO_sob_incomingpod_quest Auto Const
ReferenceAlias Property podswitch Auto Const
ReferenceAlias Property podtarget Auto Const
ReferenceAlias Property falling Auto Const

Event onTriggerEnter(ObjectReference akActionRef)

	if akActionRef == Game.GetPlayer()
		if DO_sob_incomingpod_quest.GetStage() > 0		
			pod()
		endif
	endif

EndEvent

function pod()

	DO_sob_incomingpod_quest.SetObjectiveCompleted(10)
	utility.Wait(3)
	Debug.Notification("3 SECONDS PASSED")
	ObjectReference targetvar = podtarget.GetReference()
	targetvar.EnableNoWait()
	Debug.Notification("Var = " + targetvar )
       Self.RegisterForRemoteEvent(falling.GetReference(), "OnTranslationComplete")
	falling.GetReference().TranslateToRef(targetvar, 8000)

EndFunction

Event OnTranslationComplete()

	DO_sob_incomingpod_quest.SetObjectiveDisplayed(20)
	Debug.Notification("TRANSLATION COMPLETED")
	podswitch.GetReference().Enable(true)

EndEvent
 

no joy and no errors, also still says var is none

 

Link to comment
Share on other sites

How are you filling those ReferenceAlias though? Are you pointing to the activator directly or are you having the quest try to fill the ReferenceAlias automatically? The reason I'm asking is because if the ReferenceAlias isn't filled it can't return any object / reference.
Link to comment
Share on other sites

Yeah I get that.

 

I've linked them in the quest menu alias tab, by clicking item in the render window. Sorry at work at the minute can't show picture.

 

Edit

Just looked it up on creation kit.com I use "Specific Reference" to link them

 

perhaps Location Alias Reference would be better...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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