Jump to content

Help with simple scripts


Recommended Posts

Greetings.



I am making quests for Sungarde and I´m in need for some simple scripts. I would like to use them in actors and objects, since my first experience with Papyrus was not very pleasant.



1- A script to an object, when I get it quest stage changes to next;



2- A script to an object, when I get distance "x" from it quest stages changes to next



3- A script for an actor, when he gets killed quest stages changes to next.



Anyone could help? http://tesalliance.org/forums/public/style_emoticons/default/unsure.gif

Link to comment
Share on other sites

Greetings.

 

I am making quests for Sungarde and I´m in need for some simple scripts. I would like to use them in actors and objects, since my first experience with Papyrus was not very pleasant.

 

1- A script to an object, when I get it quest stage changes to next;

 

2- A script to an object, when I get distance "x" from it quest stages changes to next

 

3- A script for an actor, when he gets killed quest stages changes to next.

 

Anyone could help? http://tesalliance.org/forums/public/style_emoticons/default/unsure.gif

 

In essence:

1
Player.GetItemCount MyObject == 1
	SetStage MyQuest xx
EndIf

2
If Player.GetDistance xREF < xxx
	SetStage MyQuest xx
EndIf

3
Begin OnDeath
	SetStage MyQuest xx
End
	
Link to comment
Share on other sites

Ah, sorry about that. Unfortunately I have no experience with Papyrus (no, the scripting language is not the same), so over to somebody else...

Link to comment
Share on other sites

There are some example scripts you can have a look at and modify to meet your needs.

ScriptName SetStageOnPlayerPickUp Extends ObjectReference
 
Actor Property PlayerREF Auto
Quest property QuestToSet Auto
Int Property iStageToSet Auto
 
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
	If akNewContainer == PlayerREF
		QuestToSet.SetStage(iStageToSet)
		GoToState("Taken")
	EndIf
EndEvent
 
State Taken
	; Do nothing
EndState

 

I'm not that good at scripting but here is an example of a script that I put on 1 of 2 objects that the player needed to have in inventory to advance quest stage. This is a variation of a script I found on a vanilla object and I just modified it a little bit to meet my needs.

Scriptname MyScriptName extends ObjectReference  
{Sets a quest stage when this item is put in the player's inventory.}

Quest Property myQST auto
{Quest upon which to set stage. Default is the Alias's owning quest.}

	
auto State waiting	
	Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
		if (Game.GetPlayer() == akNewContainer)
			if (myQST.GetStage() == 20)
				myQST.SetStage(30)

			elseIf (myQST.GetStage() == 31)
				myQST.SetStage(35)

			endif
		endif
	EndEvent

EndState

If you were to modify this, it might work for you. But like I said I don't know much about scripting so I can't offer you much more than this.

 

Link to comment
Share on other sites

With this script, a stage will be set if the player reaches a certain distance in game units to this object. So far I know, 70 game units are 1 meter, so in this example it would be 2 meters distance. This will only work if the player and the object are in the same cell.

 

Scriptname SetStageOnDistance extends ObjectReference

Quest Property myQuest auto
int Property StageToSet auto
int Property Distance = 140 auto

auto State WaitingForPlayer
	Event OnCellAttach()
		RegisterForSingleUpdate(1.0)
	EndEvent

	Event OnUpdate()
		debug.notification("+")
		If self.GetDistance(Game.GetPlayer()) <= Distance
			myQuest.SetStage(StageToSet)
			GotoState("done")
		Else
			RegisterForSingleUpdate(1.0)
		Endif
	EndEvent

	Event OnCellDetach()
		UnregisterForUpdate()
	EndEvent
EndState
	
State done
	;do nothing
EndState

 

 

argh, seems the edit function is completely broken......

Edited by Ghaunadaur
Link to comment
Share on other sites

  • Recently Browsing   0 members

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