Jump to content

[Scripts] Adding Bounty/Crime Gold via Script?


Nymra

Recommended Posts

Posted

I want to add "1000 Crime Gold" to Slaveruns "Escaped Slave" Script.


Problem:
It tells me Error: CrimeFactionWhitrun is undefined. 

How do I define it?
I was diggin in other peoples scripts, but could not find a similar one yet.

Tried to copy the "Add Crime Gold" from POPs Debug but I could not locate it  @Inte :P

The only addition I made to date is the bold line. 

Quote

Scriptname SLV_PeriodicReporting extends Quest  

Function StartPeriodicReportingTimer()

if !Game.GetPlayer().IsInFaction(zbf_Slave) || !MCMMenu.ForceReporting
    return
endif

Float Time = Utility.GetCurrentGameTime()
MiscUtil.PrintConsole("Current Time:" + Time)

; Just tell us when x hours have passed in game
if MCMMenu.ReportingTime
    int reportingtime = MCMMenu.ReportingTime
    if reportingtime < 1
        reportingtime = 1
    endif
    RegisterForSingleUpdateGameTime(reportingtime * 24 ) ; 24 * 1
    Time = Time + reportingtime ;* 24
else
     RegisterForSingleUpdateGameTime(168) ; 24 * 7
    Time = Time + 7 ;168
endif
StorageUtil.SetFloatValue(None, "SLV_ReportBackHours", Time )
MiscUtil.PrintConsole("Reporting Time:" + Time)
EndFunction 

Event OnUpdateGameTime()
if !Game.GetPlayer().IsInFaction(zbf_Slave) || !MCMMenu.ForceReporting
    return
endif

SLV_SlaveOnTheRun.setvalue(1)
CrimeFactionWhiterun.modcrimegold(1000)
Debug.MessageBox("You failed to report back to Bellamy in time and are now an escaped slave. Every loyal citicen who obeys slavery law is ordered to catch you.")
endEvent
Faction Property zbf_Slave Auto
SLV_MCMMenu Property MCMMenu Auto
GlobalVariable Property SLV_SlaveOnTheRun Auto
GlobalVariable Property GameHour Auto

 

Posted

Worse scripting i ever seen xD

 

You need to create Property...

Faction Property <NAME> Auto

 

Here:

Spoiler

Scriptname SLV_PeriodicReporting extends Quest  
{ Add Crime gold to Faction Property }
	
	; ADDED THIS LINE BELOW
	Faction Property FactionRef Auto
	{ Select Faction to add Crime Gold }
	
	
	Faction Property zbf_Slave Auto
	SLV_MCMMenu Property MCMMenu Auto
	GlobalVariable Property SLV_SlaveOnTheRun Auto
	GlobalVariable Property GameHour Auto
	

Function StartPeriodicReportingTimer()
	If( ( !Game.GetPlayer().IsInFaction( zbf_Slave ) ) || ( !MCMMenu.ForceReporting ) )
		Return
	EndIf
	Float Time = Utility.GetCurrentGameTime()
	MiscUtil.PrintConsole("Current Time:" + Time)

; Just tell us when x hours have passed in game
	If( MCMMenu.ReportingTime )
		int reportingtime = MCMMenu.ReportingTime
		If( reportingtime < 1 )
			reportingtime = 1
		
		EndIf
		RegisterForSingleUpdateGameTime(reportingtime * 24 ) ; 24 * 1
		Time = Time + reportingtime ;* 24
	
	Else
		RegisterForSingleUpdateGameTime(168) ; 24 * 7
		Time = Time + 7 ;168
	EndIf

	StorageUtil.SetFloatValue(None, "SLV_ReportBackHours", Time )
	MiscUtil.PrintConsole("Reporting Time:" + Time)
EndFunction 

Event OnUpdateGameTime()
	If( ( !Game.GetPlayer().IsInFaction( zbf_Slave ) ) || ( !MCMMenu.ForceReporting ) )
		Return
	EndIf
	SLV_SlaveOnTheRun.setvalue(1)
	CrimeFactionWhiterun.modcrimegold(1000)
	Debug.MessageBox("You failed to report back to Bellamy in time and are now an escaped slave. Every loyal citicen who obeys slavery law is ordered to catch you.")
EndEvent

 

 

Posted

In CK open the Quest-> Script-> Edit properies -> Add the Faction. Then in Quest -> Script -> Edit source -> Save.

 

To delete the same way.
If you want to delete a property in the Script, go to Quest-> Script-> Properties-> Delete. Then edit script and save.
Not only delete and compile with editor alone. This generates warnings in the papyrus.log. And logging is a performance killer.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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