Jump to content

Some Quest/scripting advice.


Recommended Posts

Right, I've decided to try and add it all correctly. I've started the quest and want the player to find an item. now I placed the code on the item to move the quest to the next stage but I cant get it to work.

Scriptname sistertransmitter extends ObjectReference Const

Quest Property DO_sob_incomingpod_quest Auto Const
Keyword Property HasKeyword Auto Const

Event OnInit()
  if (Game.Getplayer().GetItemCount(HasKeyword)  == 1 )
    DO_sob_incomingpod_quest.SetStage(10)
  endIf
endEvent

Any suggestions?

Link to comment
Share on other sites

Ugh new issue,

 

I can't this code to work.

Scriptname droppodfalling extends ObjectReference

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

Event onTriggerEnter(ObjectReference akActionRef)

        ;check if player and has quest
	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,100,50)

EndFunction

Event ObjectReference.OnTranslationComplete(ObjectReference akSender)

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

EndEvent

Debug.Notification("Var = " + targetvar ) comes back "none"

 

So I assume this is why TranslateToRef is not working and in turn code is not reaching the second event. This code is on an activator.

 

Also, I can't get Enable(ture) to work. But ObjectReference extents show this function as available.

 

C:\Users\Shaun\AppData\Local\Temp\PapyrusTemp\droppodfalling.psc(33,18): variable ture is undefined
C:\Users\Shaun\AppData\Local\Temp\PapyrusTemp\droppodfalling.psc(33,11): Enable is not a function or does not exist
No output generated for droppodfalling, compilation failed.
Link to comment
Share on other sites

There are a few things that are incorrect in your code, but, more importantly, an overall outline of what you want to do would be helpful, in terms of which script is attached to which activator / object.

 

You say that you have the droppodfalling script on an activator and you're calling TranslateToRef on the activator itself, but you have your OnTranslationComplete event set up as a remote event, which means that it won't ever receive the TranslateToRef completion on itself, but only on another TranslateToRef event from another outside Objectreference.

 

Assuming I'm correct in my assumptions, you want to change this:

Event ObjectReference.OnTranslationComplete(ObjectReference akSender)

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

EndEvent

To this:

Event OnTranslationComplete()

    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

Thanks for the reply,

 

So I have the quest leading to the Activator on the highway. The player reaches this vantage point and I just want the pod to fall. Then after Translation is completed the disable switch is activated and the static models are then in place. I'm hoping for a big puff of smoke pretty much like when you shoot a car and it explodes to hide the switch over.

 

poLLqP8.jpg

 

is there a simpler way or better way?

 

also, the code doesn't reach OnTranslationComplete() but the errors are gone mind.

Edited by Deathoctimus
Link to comment
Share on other sites

Thanks for the reply,

 

So I have the quest leading to the Activator on the highway. The player reaches this vantage point and I just want the pod to fall. Then after Translation is completed the disable switch is activated and the static models are then in place. I'm hoping for a big puff of smoke pretty much like when you shoot a car and it explodes to hide the switch over.

 

poLLqP8.jpg

 

is there a simpler way or better way?

 

also, the code doesn't reach OnTranslationComplete() but the errors are gone mind.

Could you post what errors you are getting and the script source? That would help me help you.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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