Jump to content

(help) designing a complex money management script


Delzaron

Recommended Posts

Hi everyone

 

As you maybe saw in Elf prince blog, I wish to reload the Mansion mod.

 

But it need a complex script :

 

For each day, the mod need to calculate the benefits/loss of each brothel the player and the Night Mistress owns.

 

So, each day/week :

- each whore earn xxx money for the Mansion

- more a brothel is famous, more he have customers, so more money... (I plan you be able to buy 5 brothels + a caban per village + a whore per Inn... so, a lot of whores !)

- the taxes cost a fix amount of money + the charges (maintain the building, taxes, etc...) cost. Some regions could be more expensive than other...

- The whores bed, clothes, food, health... costs are included in the whore tarifs...

- player earn 40% of the benefits after charges and taxes... if there is benefits.

 

More :

- for each sex scene between whore and client in the brothel, the brothel earn xxx money.

- if there are too lot of depts, the brothel is closed... so the mod fail if the first brothel close.

 

And more : this mod needs followers : yes, you 'll able to hire them as whores... so, they need to join the brothel, and live inside... i know, with mods, we can say to a follower to live here, but, with vanilla skyrim ?

 

 

I exepct to use Int variables for number of whores, brothel reputation, etc... but how I could multipfly these int by a factor, to get the appropriate amount of gold ? and depts (I will create iron tokens for that... and the script should recognize a iron token, and neutralise it with gold if it's posisble)...

 

 

For brothel reputation, i plan to create a radiant "advertissing quest" : place posters in local Inn, use one of the whores for a show in the inn or the market (or do it yourself !)

 

 

Thanks in advance !

Link to comment

Technically you don't need a complex script for this.

 

Just a few formulas with a few parameters, and decide when they will be called.

 

Let me give you an example based on what you wrote.

 

 

 

 
float[] mansionReputation ; a float (lets say between 0.5 and 2.0) that is proportional to the mansion reputation. You can do it for each whore, but will be harder to keep track of it and increase the levels, the index of the mansion should be pre-defined.
 
Actor[] theWhores ; An array with all whores inside
int[] mansionForTheWhore ; if a whore is in position n, then in position n of this array you have the static number identifying the mansion
; other arrays can keep track of beds, clothes, etc.
int[] whoreBenefit
int[] whoreCost
 
int Function calculateRevenue()
  int total = 0
  int i = mansionReputation.legth
  while i
    i-=1
    if mansionReputation[i] != 0.0 ; The mansion is in use
      localRevenue = 0
      int j = theWhores.length
      while j
        j-=1
        if mansionForTheWhore[j]==i ; This whore is in the current mansion
          localRevenue += 5 + whoreBenefit[j] - whoreCost[i] - ....
        endIf
      endWhile
      total += mansionReputation[i] * localRevenue
    end if
  endWhile
  return total
endFunction

 

Then call the function about once a day, and add the result as gold for the player

 

Link to comment

Hum... that can be good.... except :

 

All whores : all whores, they can be in several brothels, but they are still working for the "company"

 

Maybe it's posisble to copy that script for each establishement, and launch the script if a variable says " this place is open to business".

 

What is an "array" ?

 

How you multiply the number of whores by an amount to calculate the benefit ?

 

Benenfits should be putted as gold in a box... or, when you'll talk to the Mistress, she will give the week benefits... and, the relicate of precedent weeks, if you didn't asked for them... so, in a month, can be a large amount of money.

 

 

I met also a problme with the followers recruitment : as you know, I'm tryting the system I want to implant in the Mansion in TID.... i create a short quest where you can hire followers and some non followers NPCs for your suite... for NPCs, that works well, but not with followers : they continue to follow the player, and refuse to go into the new house (or, when you recruit them for the house, they fill a package (sandbox + specific cell))...

Link to comment

Just passing and haven't read all the words in your initial post, but I always feel stealing code ideas from other people can be quite rewarding. Have you thought about looking at the workings of Skyrim Tycoon? , (http://www.nexusmods.com/skyrim/mods/34959/? ), for some propositions. Can possibly imagine underlying bits of that could make a full economic pimping with factions, (and drugs), style of economic overlay for a general Skyrim based experience. (Obviously just for ideas, and not for what it actually does for it's gaming style).

Link to comment

Just passing and haven't read all the words in your initial post, but I always feel stealing code ideas from other people can be quite rewarding. Have you thought about looking at the workings of Skyrim Tycoon? , (http://www.nexusmods.com/skyrim/mods/34959/? ), for some propositions. Can possibly imagine underlying bits of that could make a full economic pimping with factions, (and drugs), style of economic overlay for a general Skyrim based experience. (Obviously just for ideas, and not for what it actually does for it's gaming style).

 

No, I wish to make something simplier than that...

 

And I'll blocked on the Maria Eden script I'm studying (the one I posted in the actor dialogue event issue topic)(By the way, you were right, it was an actor event nodes problem : the scene is automatically launched now !).

Link to comment

I build a test in TID...

 

You tag the follower "On sell" by dialogues (the follower get the slave faction, and fill the followerOnsell alias). Y

ou can talk to Simza, and sell your follower to her. She will only accept one.

The follower fill a alias named : follower Simza.

 

Now, I want the follower make 60 gold each day, or 15 gold each time she have sex with a client...

Player will get the money by talking to Simza.

 

For limit the number of follower you can sell to Simza, I made a int variable : 0 (Simza have a free position), 1 (simza staff is complete).

 

How I can adapt your script ? Does It will good to place it in the FollowerSimza Alias?

Link to comment

If you get the money just by talking to a NPC, then you may want a slightly different script.

 

First be sure you have in a script attached to a quest (as you probably already have) all the variables you need.

Now, I suppose that if you don't talk to Simza for 2 days, at the end you get 120 gold, correct?

To do this you have to keep track of the time.

"Add 15 gold each time the slave has sex", if the sex anim is started by you, then it is easy, but if you want to include ANY animation started also by other mods, then you need to hook SexLab.

 

Link to comment

If you get the money just by talking to a NPC, then you may want a slightly different script.

 

First be sure you have in a script attached to a quest (as you probably already have) all the variables you need.

Now, I suppose that if you don't talk to Simza for 2 days, at the end you get 120 gold, correct?

To do this you have to keep track of the time.

"Add 15 gold each time the slave has sex", if the sex anim is started by you, then it is easy, but if you want to include ANY animation started also by other mods, then you need to hook SexLab.

 

Of course, the slave will make money if she have sex with clients, not with player...

And, by default, the slave makes 60 gold per day.

 

A while script should be good.

- with a timer (so, one day)

- if the SimzaVar and the cell is ok (so, the slave is in the brothel) -> slaves make money,

- if not (the whore is outside the brothel) -> no money, return...

 

Function FollowerSimzaMoney()

while

  GameDaysPassed +1 or something like that (at minimal, i could use a utility.wait())

 Act actor = FollowerSimza.getactorref() as Act

  if SimzaFollowerVar == 1 && act.getiscell(SimzaBrothel) && act.isinFaction(aTIDIbnSlavewhoreFaction))

    ; " Follower is in simza brothel, and registered as whore")

   aTIDSimzaREF.additem(gold001, 60)

    return

  endIf

endWhile

EndFunction

 

Link to comment

Archived

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

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use