Jump to content

Creation Kit: Simple Tax help


Guest

Recommended Posts

Posted

Hello folks. I'm trying to create a simple follower mod for myself and I'm wondering if anyone would have a script handy that would allow me to remove a percentage of my character's septims every day, giving those septims to the follower. I'd like this to be a percentage system instead of a fixed amount each day, but I don't know if Skyrim allows this. Any help is appreciated.

Posted

It is not complex to do something like this.

Inside a script, you can wait for a day.

Then you get the value of gold from the player, this will be an int, and you can just multiply it by a number between 0 and 1 that is the percentage you wanna the player to have.

Then set back the value to the player and maybe show a message.

 

Do you need specific help on Papyrus to write something like this?

Posted

Thanks CPU, that's good to hear. If you could help me out with Papyrus I'd appreciate that. I don't currently have my desktop handy though so I can't go into the kit.

Posted

Some basic code to do it

 

MiscObject property Gold001 auto
Actor property PlayerRef auto
Actor property TheFollower auto
	Function SomeFunction()                       
  RegisterForUpdateGameTime(24) ; Wait 24 hours
endFunction
 
Event OnUpdateGameTime()
    if theFollowerIsFollower ; use whatever will make you know that you have this follower
        int gold = PlayerRef.getItemCount(Gold001)
        int goldToFollower = (gold * 0.1) as int ; Remove 10% of the gold
        TheFollower.AddItem(Gold001, goldToFollower)
        PlayerRef.RemoveItem(Gold001, goldToFollower)
        debug.notification(goldToFollower + " septims go to the follower " + TheFollower.GetDisplayName())
  endIf
endEvent
 
	
Posted
8 hours ago, CPU said:

Some basic code to do it

 

MiscObject property Gold001 auto
Actor property PlayerRef auto
Actor property TheFollower auto
	Function SomeFunction()                       
  RegisterForUpdateGameTime(24) ; Wait 24 hours
endFunction
 
Event OnUpdateGameTime()
    if theFollowerIsFollower ; use whatever will make you know that you have this follower
        int gold = PlayerRef.getItemCount(Gold001)
        int goldToFollower = (gold * 0.1) as int ; Remove 10% of the gold
        TheFollower.AddItem(Gold001, goldToFollower)
        PlayerRef.RemoveItem(Gold001, goldToFollower)
        debug.notification(goldToFollower + " septims go to the follower " + TheFollower.GetDisplayName())
  endIf
endEvent
 
	

ur code is dirty AF xD

Why "Function" keyword is so ahead?... 

and what even "SomeFunction" means?...

 

    ; use 24.0 instead of 24 so Papyrus is not casting it to Float
    ; if You do 24 after compiling Papyrus is casting it from INT to Float Every time
    ; but 24.0 is already Float so Papyrus dont have to cast it :) ( Hello Lina <33 )

 

Open Spoiler to copy Code:

Spoiler
Scriptname TakeMyMoney extends Actor

	MiscObject Property qGold Auto
	Actor Property qPlayer Auto
	Actor Property qFollower Auto				; Reference to Your Follower
	Faction Property qFollowerFaction Auto		; Reference to 0005C84E
	 ; 0005C84E is CurrentFollowerFaction, if you use default Follower system
	 ; Your follower will have that Faction if is currently following Player

Event OnInit()
	RegisterForSingleUpdateGameTime( 24.0 )
EndEvent

Event OnUpdateGameTime()
	If( qFollower.IsInFaction( qFollowerFaction ) )
		Int xGold = qPlayer.GetItemCount( qGold )
		xGold *= 0.1	; or whatever value, 0.05 will be 5%, 0.25 will be 25%
		
		qPlayer.RemoveItem( qGold , xGold )
		qFollower.AddItem( qGold, xGold )
		; first we always REMOVE things, then we add new things
		; Programming rule :3... hehe xD
		; You don't make New array before u delete old Array... right?... 
	
	EndIf
	RegisterForSingleUpdateGameTime( 24.0 )
EndEvent
; TheEnd

 

 

s1.png.4f433868cf180aecdcaa355f7674b9d2.png

 

 

I didn't tested it ( compiled ) because im still redownloading everything on my Computer...

 I deleted Skyrim few days ago xDD

 

 

//Edit:

Maybe i should say some more about that....

 

 

little tutorial how to use it

 

1) Open Gameplay Tab and enter "Papyrus Manager" 

2) In papyrus Manager right click on Menu and pick "New" - You will create new Script

3) Give it name, it can be anything and extension... extension is not rly important... u can type "Actor" or "ObjectReference" etc.

4) Compile !!! ( Right click on Your Script in List -> Compile )

5) You need to create Holder for that Script ( it can be Your follower )

6) Open Object where you want to place Your Script, go to Scripts, and click "Add"

7) Find You Script by name and click OK

8) Open Your script ( Clikc "Open Properties" )

9) Fill properties... 

 so qPlayer is Player ( Cell: Any, Reference: Player )

 qFollower is Your folower ( click "Pick from Render Window" and click Your Folower )

 qGold is Gold ( just find in list of items ( search for gold001 ) )

 qFollowerFaction ( same as Gold, just search for "CurrentFollowerFaction" in list )

 

Then Click OK and its done !...

 Script will register for update after You start Your game

 

if You already started ur game and saved with Your Follower in game, you may need to start new game ( or just delete in CK Your follower and place new Follower in different place ( so its ID change and Skyrim will think its new Actor !! ) )

Posted

Thanks a lot Chaos! I will try your script once I have access to my desktop.

 

One question, in your script, does the npc have to be an active follower for it to work, or will it also work when they are not following the pc? I think the former would be better if it is possible to implement that.

Posted
1 hour ago, Gunnaria said:

Thanks a lot Chaos! I will try your script once I have access to my desktop.

 

One question, in your script, does the npc have to be an active follower for it to work, or will it also work when they are not following the pc? I think the former would be better if it is possible to implement that.

Script start when You load game for the first time and then work all the time

 But it have IF statement to check if follower is Your current folower, and take money from You only if he is current follower

 

But You can easly add option to enable / disable script, but there are many ways to do it and every way need different implementation 

 - Dialogue 

 - MCM

 - Quest

 - Spell ?

 - Anything else...

it depends on u want to active / deactivate script ;x...

Archived

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

  • Recently Browsing   0 members

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