Change respawn rate for mines?

Post » Thu Jun 21, 2012 1:33 am

I have been looking everywhere for a value that would change the respawn rate of mines in the game. I didn't see respawn rate in the activator menus for mines, I didn't see it in scripts that relate to mining, and I didn't see it in global settings. Now I am wondering if this tweak is even possible.
User avatar
Eibe Novy
 
Posts: 3510
Joined: Fri Apr 27, 2007 1:32 am

Post » Thu Jun 21, 2012 2:10 am

I searched thoose too, but as far as I understand you can't make the ore deposites respawn, unless you combine one of the flora scripts with the ore mining script.
User avatar
jenny goodwin
 
Posts: 3461
Joined: Wed Sep 13, 2006 4:57 am

Post » Wed Jun 20, 2012 5:28 pm

Well it looks like I am going to have to go through some more scripts then for any hope. The only thing remotely close that I found in scripts relating to mining, was an event function called onReset().
User avatar
J.P loves
 
Posts: 3487
Joined: Thu Jun 21, 2007 9:03 am

Post » Thu Jun 21, 2012 12:00 am

Well it looks like I am going to have to go through some more scripts then for any hope. The only thing remotely close that I found in scripts relating to mining, was an event function called onReset().

The mining ore's all share one and the same script named 'MineOreScript.pex'. This is how it looks:

Spoiler
scriptName MineOreScript extends objectReference;;This script handles the Ore Veins and handshakes with the mining furniture;===================================================================sound property DrScOreOpen auto{sound played when Ore is acquired}formlist property mineOreToolsList auto{Optional: Player must have at least one item from this formlist to interact}Message Property FailureMessage Auto  {Message to say why you can't use this without RequiredWeapon}Message Property DepletedMessage Auto  {Message to say that this vein is depleted}MiscObject Property Ore Auto  {what you get from this Ore Vein}LeveledItem property lItemGems10 auto{Optional: Gems that may be mined along with ore}int Property ResourceCount = 3 Auto{how many resources you get per drop}int property ResourceCountTotal = 5 auto{how many resources this has before it is depleted}int property ResourceCountCurrent = -1 auto Hidden{Used to track the current remaining resources}int property StrikesBeforeCollection = 1 Auto{how many times this is struck before giving a resource}int property StrikesCurrent = -1 Auto hidden{Current number of strikes}int property AttackStrikesBeforeCollection = 1 Auto{how many times this is struck by attacks before giving a resource}int property AttackStrikesCurrent = -1 Auto hidden{Current number of attack strikes}mineOreFurnitureScript property myFurniture auto hidden{the furniture for this piece of ore, set in script}objectReference property objSelf auto hidden{objectReference to self}AchievementsScript property AchievementsQuest autoLocation Property CidhnaMineLocation AutoQuest Property MS02 AutoQuest Property DialogueCidhnaMine AutoObjectReference Property CidhnaMinePlayerBedREF Auto;===================================================================;;EVENT BLOCK;===================================================================event onCellAttach();     debug.Trace(self + ": is running onCellAttach")    blockActivation()    SetNoFavorAllowed()    objSelf = self as objectReference    if !getLinkedRef();         debug.Trace(self + ": does not have a linked ref, going to depleted state")        depleteOreDueToFailure()    endifendEventevent onActivate(objectReference akActivator);     debug.Trace(self + " has been activated by " + akActivator)        ;Actor is attempting to mine    if akActivator as actor        ;if the actor is the player        if akActivator == game.getPlayer()            ;if this is not depleted and the player has the right item            If ResourceCountCurrent == 0                DepletedMessage.Show()            elseif playerHasTools() == false                FailureMessage.Show()            ;enter the furniture            else                If Game.GetPlayer().GetCurrentLocation() == CidhnaMineLocation && MS02.ISRunning() == False;                     debug.Trace(self + "Player is in Cidhna Mine, activate the bed to serve time")                    CidhnaMinePlayerBedREF.Activate(Game.GetPlayer())                    DialogueCidhnaMine.SetStage(45)                    Return                EndIf;                 debug.Trace(self + " should cause " + akActivator + " to activate " + getLinkedRef())                if getLinkedRef()                    myFurniture = getLinkedRef() as mineOreFurnitureScript                    myFurniture.lastActivateRef = objSelf                    getLinkedRef().activate(akActivator)                    AchievementsQuest.incHardworker(2)                Else;                     debug.Trace(self + ": error this ore does not have a linkedRef")                endif            endif        Else            if getLinkedRef()                getLinkedRef().activate(akActivator)            Else;                 debug.Trace(self + ": error this ore does not have a linkedRef")            endif        EndIf            ;Furniture is telling ore it has been struck        ElseIf akActivator == GetLinkedRef();         debug.Trace(self + ": has been activated by" + akActivator)        ProccessStrikes()            ;Something unexpected has activated the ore    Else;         debug.Trace(self + "has been activated by: " + akActivator + " why?")    endifendEvent;;;May add on hit with pickaxe here laterEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked);     debug.Trace(self + ": onHit - akAgressor = " + akAggressor + "; akSource = " + akSource)    if akAggressor == game.getPlayer()        if mineOreToolsList.hasForm(akSource)                        proccessAttackStrikes()        endif    endifendEventevent onReset();     debug.Trace(self + ": is running onReset")    ;THIS WASN'T WORKING RIGHT    self.Reset()    self.clearDestruction()    self.setDestroyed(False)    ; if getLinkedRef()        resourceCountCurrent = -1    ; else        ; depleteOreDueToFailure()    ; endifendEvent;===================================================================;;FUNCTION BLOCK;===================================================================bool function playerHasTools()    if Game.GetPlayer().GetItemCount(mineOreToolsList) > 0;         debug.Trace(self + ": playerHasTools is returning true")        return true    Else;         debug.Trace(self + ": playerHasTools is returning false")        return false    endIfendFunctionfunction proccessAttackStrikes()    if AttackStrikesCurrent <= -1        AttackStrikesCurrent = AttackStrikesBeforeCollection    EndIf    AttackStrikesCurrent -= 1        if AttackStrikesCurrent == 0        AttackstrikesCurrent = AttackStrikesBeforeCollection        giveOre()    endIfendFunctionfunction proccessStrikes()    if StrikesCurrent <= -1        StrikesCurrent = StrikesBeforeCollection    EndIf    StrikesCurrent -= 1        if StrikesCurrent == 0        strikesCurrent = StrikesBeforeCollection        giveOre()    endIfendFunctionfunction giveOre()    if ResourceCountCurrent == -1        ResourceCountCurrent = ResourceCountTotal    EndIf        if ResourceCountCurrent > 0        ResourceCountCurrent -= 1;         debug.Trace(self + ": ResourceCountCurrent = " + ResourceCountCurrent)        if ResourceCountCurrent == 0            ;             debug.Trace(self + ": ResourceCountCurrent == 0 - depleted" )            self.damageObject(50)            getLinkedRef().activate(objSelf)            DrScOreOpen.play(self)            self.setDestroyed(true)            ; if this vein has ore and/or gems defined, give them.            if ore                (game.getPlayer()).addItem(Ore, ResourceCount)            endif            if lItemGems10                (game.getPlayer()).addItem(lItemGems10)            endif            DepletedMessage.Show()        else            DrScOreOpen.play(self)            ; if this vein has ore and/or gems defined, give them.            if ore                (game.getPlayer()).addItem(Ore, ResourceCount)            endif            if lItemGems10                (game.getPlayer()).addItem(lItemGems10)            endif        endif    elseif ResourceCountCurrent == 0        getLinkedRef().activate(objSelf)        (getLinkedRef() as MineOreFurnitureScript).goToDepletedState()        DepletedMessage.Show()    endifEndFunctionfunction depleteOreDueToFailure()    self.damageObject(50)    ;THIS WASN'T WORKING RIGHT    self.setDestroyed(true)    ResourceCountCurrent = 0endFunction

You'll have to put a function into it, so it makes mining ore's respawning. I bet you'll find something useful inside the wood choping or harvest plants script. As far as I can tell there is no variable inside the mining ore script thattells the ore's to respawn.
User avatar
Jennie Skeletons
 
Posts: 3452
Joined: Wed Jun 21, 2006 8:21 am

Post » Wed Jun 20, 2012 5:18 pm

The mining ore's all share one and the same script named 'MineOreScript.pex'. This is how it looks:

Spoiler
scriptName MineOreScript extends objectReference;;This script handles the Ore Veins and handshakes with the mining furniture;===================================================================sound property DrScOreOpen auto{sound played when Ore is acquired}formlist property mineOreToolsList auto{Optional: Player must have at least one item from this formlist to interact}Message Property FailureMessage Auto  {Message to say why you can't use this without RequiredWeapon}Message Property DepletedMessage Auto  {Message to say that this vein is depleted}MiscObject Property Ore Auto  {what you get from this Ore Vein}LeveledItem property lItemGems10 auto{Optional: Gems that may be mined along with ore}int Property ResourceCount = 3 Auto{how many resources you get per drop}int property ResourceCountTotal = 5 auto{how many resources this has before it is depleted}int property ResourceCountCurrent = -1 auto Hidden{Used to track the current remaining resources}int property StrikesBeforeCollection = 1 Auto{how many times this is struck before giving a resource}int property StrikesCurrent = -1 Auto hidden{Current number of strikes}int property AttackStrikesBeforeCollection = 1 Auto{how many times this is struck by attacks before giving a resource}int property AttackStrikesCurrent = -1 Auto hidden{Current number of attack strikes}mineOreFurnitureScript property myFurniture auto hidden{the furniture for this piece of ore, set in script}objectReference property objSelf auto hidden{objectReference to self}AchievementsScript property AchievementsQuest autoLocation Property CidhnaMineLocation AutoQuest Property MS02 AutoQuest Property DialogueCidhnaMine AutoObjectReference Property CidhnaMinePlayerBedREF Auto;===================================================================;;EVENT BLOCK;===================================================================event onCellAttach();	 debug.Trace(self + ": is running onCellAttach")	blockActivation()	SetNoFavorAllowed()	objSelf = self as objectReference	if !getLinkedRef();		 debug.Trace(self + ": does not have a linked ref, going to depleted state")		depleteOreDueToFailure()	endifendEventevent onActivate(objectReference akActivator);	 debug.Trace(self + " has been activated by " + akActivator)		;Actor is attempting to mine	if akActivator as actor		;if the actor is the player		if akActivator == game.getPlayer()			;if this is not depleted and the player has the right item			If ResourceCountCurrent == 0				DepletedMessage.Show()			elseif playerHasTools() == false				FailureMessage.Show()			;enter the furniture			else				If Game.GetPlayer().GetCurrentLocation() == CidhnaMineLocation && MS02.ISRunning() == False;					 debug.Trace(self + "Player is in Cidhna Mine, activate the bed to serve time")					CidhnaMinePlayerBedREF.Activate(Game.GetPlayer())					DialogueCidhnaMine.SetStage(45)					Return				EndIf;				 debug.Trace(self + " should cause " + akActivator + " to activate " + getLinkedRef())				if getLinkedRef()					myFurniture = getLinkedRef() as mineOreFurnitureScript					myFurniture.lastActivateRef = objSelf					getLinkedRef().activate(akActivator)					AchievementsQuest.incHardworker(2)				Else;					 debug.Trace(self + ": error this ore does not have a linkedRef")				endif			endif		Else			if getLinkedRef()				getLinkedRef().activate(akActivator)			Else;				 debug.Trace(self + ": error this ore does not have a linkedRef")			endif		EndIf			;Furniture is telling ore it has been struck		ElseIf akActivator == GetLinkedRef();		 debug.Trace(self + ": has been activated by" + akActivator)		ProccessStrikes()			;Something unexpected has activated the ore	Else;		 debug.Trace(self + "has been activated by: " + akActivator + " why?")	endifendEvent;;;May add on hit with pickaxe here laterEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked);	 debug.Trace(self + ": onHit - akAgressor = " + akAggressor + "; akSource = " + akSource)	if akAggressor == game.getPlayer()		if mineOreToolsList.hasForm(akSource)						proccessAttackStrikes()		endif	endifendEventevent onReset();	 debug.Trace(self + ": is running onReset")	;THIS WASN'T WORKING RIGHT	self.Reset()	self.clearDestruction()	self.setDestroyed(False)	; if getLinkedRef()		resourceCountCurrent = -1	; else		; depleteOreDueToFailure()	; endifendEvent;===================================================================;;FUNCTION BLOCK;===================================================================bool function playerHasTools()	if Game.GetPlayer().GetItemCount(mineOreToolsList) > 0;		 debug.Trace(self + ": playerHasTools is returning true")		return true	Else;		 debug.Trace(self + ": playerHasTools is returning false")		return false	endIfendFunctionfunction proccessAttackStrikes()	if AttackStrikesCurrent <= -1		AttackStrikesCurrent = AttackStrikesBeforeCollection	EndIf	AttackStrikesCurrent -= 1		if AttackStrikesCurrent == 0		AttackstrikesCurrent = AttackStrikesBeforeCollection		giveOre()	endIfendFunctionfunction proccessStrikes()	if StrikesCurrent <= -1		StrikesCurrent = StrikesBeforeCollection	EndIf	StrikesCurrent -= 1		if StrikesCurrent == 0		strikesCurrent = StrikesBeforeCollection		giveOre()	endIfendFunctionfunction giveOre()	if ResourceCountCurrent == -1		ResourceCountCurrent = ResourceCountTotal	EndIf		if ResourceCountCurrent > 0		ResourceCountCurrent -= 1;		 debug.Trace(self + ": ResourceCountCurrent = " + ResourceCountCurrent)		if ResourceCountCurrent == 0			;			 debug.Trace(self + ": ResourceCountCurrent == 0 - depleted" )			self.damageObject(50)			getLinkedRef().activate(objSelf)			DrScOreOpen.play(self)			self.setDestroyed(true)			; if this vein has ore and/or gems defined, give them.			if ore				(game.getPlayer()).addItem(Ore, ResourceCount)			endif			if lItemGems10				(game.getPlayer()).addItem(lItemGems10)			endif			DepletedMessage.Show()		else			DrScOreOpen.play(self)			; if this vein has ore and/or gems defined, give them.			if ore				(game.getPlayer()).addItem(Ore, ResourceCount)			endif			if lItemGems10				(game.getPlayer()).addItem(lItemGems10)			endif		endif	elseif ResourceCountCurrent == 0		getLinkedRef().activate(objSelf)		(getLinkedRef() as MineOreFurnitureScript).goToDepletedState()		DepletedMessage.Show()	endifEndFunctionfunction depleteOreDueToFailure()	self.damageObject(50)	;THIS WASN'T WORKING RIGHT	self.setDestroyed(true)	ResourceCountCurrent = 0endFunction

You'll have to put a function into it, so it makes mining ore's respawning. I bet you'll find something useful inside the wood choping or harvest plants script. As far as I can tell there is no variable inside the mining ore script thattells the ore's to respawn.
Thanks. That is along the lines of what I was starting to assume I would have to do. I actually found the onReset() event function in this script, and my plan was to write a function that triggers the onReset() event. I will have to take a look at those other systems that reset, and find out how they do it.
User avatar
Joey Avelar
 
Posts: 3370
Joined: Sat Aug 11, 2007 11:11 am

Post » Wed Jun 20, 2012 1:27 pm

I haven't checked, so I have no idea how the wood chopping or harvest plants scripts look. But if you don't mind changing the MineOreScript, try adding these lines:

Float Property LastUsedTime = -1 AutoEvent OnLoad()    if (LastUsedTime > 0)        if (Utility.GetCurrentGameTime() - LastUsedTime > 3)            Reset()        endif    endifEndEventfunction giveOre()    if ResourceCountCurrent == -1        ResourceCountCurrent = ResourceCountTotal    EndIf        if ResourceCountCurrent > 0        LastUsedTime = Utility.GetCurrentGameTime()        ResourceCountCurrent -= 1        ;stuff
User avatar
Enny Labinjo
 
Posts: 3480
Joined: Tue Aug 01, 2006 3:04 pm

Post » Thu Jun 21, 2012 1:49 am

Just read it on the UESP Wiki. Mine deposites do in fact respawn every month or so.
User avatar
Joey Bel
 
Posts: 3487
Joined: Sun Jan 07, 2007 9:44 am

Post » Wed Jun 20, 2012 8:23 pm

Just read it on the UESP Wiki. Mine deposites do in fact respawn every month or so.
That wasn't the question. I wanted to be able to change that value from about a month to something else. The script option seems to be the most promising solution right now.
User avatar
Chris Jones
 
Posts: 3435
Joined: Wed May 09, 2007 3:11 am

Post » Wed Jun 20, 2012 7:10 pm

I haven't checked, so I have no idea how the wood chopping or harvest plants scripts look. But if you don't mind changing the MineOreScript, try adding these lines:

Float Property LastUsedTime = -1 AutoEvent OnLoad()	if (LastUsedTime > 0)		if (Utility.GetCurrentGameTime() - LastUsedTime > 3)			Reset()		endif	endifEndEventfunction giveOre()	if ResourceCountCurrent == -1		ResourceCountCurrent = ResourceCountTotal	EndIf		if ResourceCountCurrent > 0		LastUsedTime = Utility.GetCurrentGameTime()		ResourceCountCurrent -= 1		;stuff
I implemented these into the script, compiled and saved. It still doesn't seem to work, but I haven't tried a new game, or probably haven't been able to induce the effect correctly. I am going to continue to try to get this to work by tweaking the script some more.
User avatar
Pixie
 
Posts: 3430
Joined: Sat Oct 07, 2006 4:50 am


Return to V - Skyrim