Jump to content

script issue


icecreamassassin

Recommended Posts

Arg I am so frustrated...

 

So I have this script, and this is what it is SUPPOSED to do:

 

- you have gold when the mod loads (ok)

- the mod changes most of it into paper bills (ok)

- you enter dialog and the bills are removed and added to your gold (ok)

- you exit dialog and most of your money changes back into bills..... only works if you gold has not changed during the dialog

- you go back into dialog and your bills again are converted back into gold and removed (ok, again as long as nothing has changed)

- you acquire some gold from chests, dead enemies, etc then go back to a merchant (now it gets broken, the bills convert ok but then when you leave, it only converts the money you had before acquiring additional gold outside of dialog

 

- you should be able to buy and sell and if you have more gold than you started dialog with it will convert it down, and if you have less, it does nothing but replace the paper bills if necessary.

 

Ok. so the script works just fine when I had it in my orginal mod, but I have removed it and placed it in a seperate optional ESP that is to be loaded after the base mod ESP, and now it doesn't work. What am I doing wrong here?

 

scn CRcurrencyhandlerscript

float fQuestDelayTime

short convertedfunds
short customerservice

short doonce
short account
short interestdays
short convertedfunds
short cycle

; paper currency convertion variables
long CRWRKTTL
long CRGOLDCT
long CRBANKNOTECT
long CRCURRENTGOLD
long CRBUYSELLAMT
short state

;paper currency counts
long fivebill
long tenbill
long twentybill
long fiftybill
long hundredbill
long fivehundredbill
long thousandbill
long fivestack
long tenstack
long twentystack
long fiftystack
long hundredstack
long fivehundredstack
long thousandstack

long leftovers

Begin MenuMode 1009

if menumode 1009 == 1
		set CRgold to player.getitemcount gold001
endif

       if state == 0

               ;presets currency exchange variables
               set CRBANKNOTECT to 0
               set CRWRKTTL to 0
               
               ;player starts with X gold
               set CRGOLDCT to player.getitemcount gold001
		 
               ;bill type and count player has 
               set fivebill to player.getitemcount MEOclutterseptimsbill0005
               set tenbill to player.getitemcount MEOclutterseptimsbill0010
               set twentybill to player.getitemcount MEOclutterseptimsbill0020
               set fiftybill to player.getitemcount MEOclutterseptimsbill0050
               set hundredbill to player.getitemcount MEOclutterseptimsbill0100
               set fivehundredbill to player.getitemcount MEOclutterseptimsbill0500
               set thousandbill to player.getitemcount MEOclutterseptimsbill1000
               set fivestack to player.getitemcount MEOclutterseptimsstack0005
               set tenstack to player.getitemcount MEOclutterseptimsstack0010
               set twentystack to player.getitemcount MEOclutterseptimsstack0020
               set fiftystack to player.getitemcount MEOclutterseptimsstack0050
               set hundredstack to player.getitemcount MEOclutterseptimsstack0100
               set fivehundredstack to player.getitemcount MEOclutterseptimsstack0500
               set thousandstack to player.getitemcount MEOclutterseptimsstack1000

;total gold value of all paper money player has
set CRBANKNOTECT to CRBANKNOTECT + ( ( fivebill * 5 ) + ( tenbill * 10 ) + ( twentybill * 20 ) + ( fiftybill * 50 ) + ( hundredbill * 100 ) + ( fivehundredbill * 500 ) + ( thousandbill * 1000 ) + ( fivestack * 500 ) + ( tenstack * 1000 ) + ( twentystack * 2000 ) + ( fiftystack * 5000 ) + ( hundredstack * 10000 ) + ( fivehundredstack * 50000 ) + ( thousandstack * 100000 ) )

               ;total starting funds of gold and bank notes player has
               set CRWRKTTL to CRBANKNOTECT + CRGOLDCT 

               Message "   "
               Message "   "
               player.additem gold001 CRBANKNOTECT
               player.removeitem MEOclutterseptimsbill0005 fivebill
               player.removeitem MEOclutterseptimsbill0010 tenbill
               player.removeitem MEOclutterseptimsbill0020 twentybill
               player.removeitem MEOclutterseptimsbill0050 fiftybill
               player.removeitem MEOclutterseptimsbill0100 hundredbill
               player.removeitem MEOclutterseptimsbill0500 fivehundredbill
               player.removeitem MEOclutterseptimsbill1000 thousandbill
               player.removeitem MEOclutterseptimsstack0005 fivestack
               player.removeitem MEOclutterseptimsstack0010 tenstack
               player.removeitem MEOclutterseptimsstack0020 twentystack
               player.removeitem MEOclutterseptimsstack0050 fiftystack
               player.removeitem MEOclutterseptimsstack0100 hundredstack
               player.removeitem MEOclutterseptimsstack0500 fivehundredstack
               player.removeitem MEOclutterseptimsstack1000 thousandstack



               set state to 1
       endif

end


Begin GameMode

set fQuestdelayTime to .04

if state == 1
   Set CRCURRENTGOLD to player.getitemcount gold001
											
if CRCURRENTGOLD < CRGOLDCT
	set state to 0
elseif CRCURRENTGOLD >= CRGOLDCT
	set CRWRKTTL to CRCURRENTGOLD - CRGOLDCT
	set state to 2
endif
endif

if state == 2
    
       while (CRWRKTTL >= 5)
               if CRWRKTTL >= 100000
                       message "   "
                       message "   "
                       player.additem MEOclutterseptimsstack1000 1		; 100k
                       player.removeitem gold001 100000
                       set CRWRKTTL to CRWRKTTL - 100000
               elseif CRWRKTTL >= 50000 && CRWRKTTL < 100000
                       message "   "
                       message "   "
                       player.additem MEOclutterseptimsstack0500 1		; 50k
                       player.removeitem gold001 50000
                       set CRWRKTTL to CRWRKTTL - 50000
               elseif CRWRKTTL >= 10000 && CRWRKTTL < 50000
                       message "   "
                       message "   "
                       player.additem MEOclutterseptimsstack0100 1		; 10k
                       player.removeitem gold001 10000
                       set CRWRKTTL to CRWRKTTL - 10000
               elseif CRWRKTTL >= 5000 && CRWRKTTL < 10000
                       message "   "
                       message "   "
                       player.additem MEOclutterseptimsstack0050 1		; 5k
                       player.removeitem gold001 5000
                       set CRWRKTTL to CRWRKTTL - 5000
               elseif CRWRKTTL >= 2000 && CRWRKTTL < 5000
                       message "   "
                       message "   "
                       player.additem MEOclutterseptimsstack0020 1		; 2k
                       player.removeitem gold001 2000
                       set CRWRKTTL to CRWRKTTL - 2000
               elseif CRWRKTTL >= 1000 && CRWRKTTL < 2000
                       message "   "
                       message "   "
                       player.additem MEOclutterseptimsstack0010 1		; 1k
                       player.removeitem gold001 1000
                       set CRWRKTTL to CRWRKTTL - 1000                 
               elseif CRWRKTTL >= 500 && CRWRKTTL < 1000
                       message "   "
                       message "   "
                       player.additem MEOclutterseptimsbill0500 1		; 500
                       player.removeitem gold001 500
                       set CRWRKTTL to CRWRKTTL - 500
               elseif CRWRKTTL >= 100 && CRWRKTTL < 500
                       message "   "
                       message "   "
                       player.additem MEOclutterseptimsbill0100 1		; 100
                       player.removeitem gold001 100
                       set CRWRKTTL to CRWRKTTL - 100
               elseif CRWRKTTL >= 50 && CRWRKTTL < 100
                       message "   "
                       message "   "
                       player.additem MEOclutterseptimsbill0050 1		; 50
                       player.removeitem gold001 50
                       set CRWRKTTL to CRWRKTTL - 50
               elseif CRWRKTTL >= 20 && CRWRKTTL < 50
                       message "   "
                       message "   "
                       player.additem MEOclutterseptimsbill0020 1		; 20
                       player.removeitem gold001 20
                       set CRWRKTTL to CRWRKTTL - 20
               elseif CRWRKTTL >= 10 CRWRKTTL < 20
                       message "   "
                       message "   "
                       player.additem MEOclutterseptimsbill0010 1		; 10
                       player.removeitem gold001 10
                       set CRWRKTTL to CRWRKTTL - 10
               elseif CRWRKTTL >= 5 && CRWRKTTL < 10
                       message "   "
                       message "   "
                       player.additem MEOclutterseptimsbill0005 1		; 5
                       player.removeitem gold001 5
                       set CRWRKTTL to CRWRKTTL - 5
               endif   
       loop

       set state to 0
endif


if convertedfunds >= 0 && convertedfunds < 10
if player.getitemcount gold001 > 10000 && 	player.getitemcount gold001 < 15000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0100 1		; 10k
	player.removeitem gold001 10000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 15000 && player.getitemcount gold001 < 20000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0100 1		; 10k
	player.additem MEOclutterseptimsstack0050 1		; 5k
	player.removeitem gold001 15000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 20000 && player.getitemcount gold001 < 30000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0100 2		; 20k
	player.removeitem gold001 20000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 30000 && player.getitemcount gold001 < 40000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0100 3		; 30k
	player.removeitem gold001 30000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 40000 && player.getitemcount gold001 < 50000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0100 4		; 40k
	player.removeitem gold001 40000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 50000 && player.getitemcount gold001 < 60000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.removeitem gold001 50000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 60000 && player.getitemcount gold001 < 75000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.additem MEOclutterseptimsstack0100 1		; 10k
	player.removeitem gold001 60000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 75000 && player.getitemcount gold001 < 100000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.additem MEOclutterseptimsstack0050 5		; 25k
	player.removeitem gold001 75000
	set convertedfunds to convertedfunds + 1	
elseif player.getitemcount gold001 > 100000 && player.getitemcount gold001 < 125000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 1		; 100k
	player.removeitem gold001 100000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 125000 && player.getitemcount gold001 < 150000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 1		; 100k
	player.additem MEOclutterseptimsstack0100 2		; 20k
	player.additem MEOclutterseptimsstack0050 1		; 5k
	player.removeitem gold001 125000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 150000 && player.getitemcount gold001 < 175000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.additem MEOclutterseptimsstack1000 1		; 100k
	player.removeitem gold001 150000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 175000 && player.getitemcount gold001 < 200000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 1		; 100k
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.additem MEOclutterseptimsstack0100 2		; 20k
	player.additem MEOclutterseptimsstack0050 1		; 5k
	player.removeitem gold001 175000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 200000 && player.getitemcount gold001 < 225000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 2		; 200k
	player.removeitem gold001 200000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 225000 && player.getitemcount gold001 < 250000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 2		; 200k
	player.additem MEOclutterseptimsstack0100 2		; 20k
	player.additem MEOclutterseptimsstack0050 1		; 5k
	player.removeitem gold001 225000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 250000 && player.getitemcount gold001 < 275000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 2		; 200k
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.removeitem gold001 250000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 275000 && player.getitemcount gold001 < 300000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 2		; 200k
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.additem MEOclutterseptimsstack0100 2		; 20k
	player.additem MEOclutterseptimsstack0050 1		; 5k
	player.removeitem gold001 275000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 300000 && player.getitemcount gold001 < 500000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 3		; 300k
	player.removeitem gold001 300000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 500000  && player.getitemcount gold001 < 1000000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 5		; 500k
	player.removeitem gold001 500000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 1000000  
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 10		; 1mil
	player.removeitem gold001 1000000
	set convertedfunds to convertedfunds + 1
else
	set convertedfunds to 10
endif
elseif convertedfunds == 10
set leftovers to player.getitemcount gold001
set leftovers to leftovers - 1000
if leftovers > 50000
	messagebox "The majority of your gold has been converted into paper bank notes. Imperial Bank Notes are treated just like normal gold by all merchants and will total with your regular gold while speaking with them. Most of your remaining funds have been placed into a savings account in your name. merely speak to a teller in the imperial bank about opening a savings account to gain access to the rest of your gold."
	set CRpersonalaccount to leftovers
	player.removeitem gold001 leftovers
	set convertedfunds to 11
else
	messagebox "The majority of your gold has been converted into paper bank notes. Imperial Bank Notes are treated just like normal gold by all merchants and will total with your regular gold while speaking with them. You can also visit the bank and exchange them for gold and deposit the gold into a personal account."
	set convertedfunds to 11
endif
endif

end

Link to comment
Share on other sites

The reason why the script doesn't work is probably because you don't have the original ESP file as the master of the optional ESP. Try checking it by loading your optional ESP file.

 

I'm afraid I don't understand the problem you're trying to describe with the bill conversions.

Link to comment
Share on other sites

so how would I make the add-on require the main ESP as a master, and wouldn't that require making the main file an ESM? I'd rather not have the main file be a master file in that sense.

 

also I know my description was really vague, I'll try and clarify.

 

basically the mod loads and converts your money, then whenever you go into dialog it converts any paper money you have into gold, and then when you exit, converts gold back into paper money.

 

If you leave dialog with less gold in total (gold plus bills) than what you had in physical gold when you started dialog, it does nothing. Otherwise if you have equal or more gold total than your base starting gold, it subtracts your base starting gold from a value to determine how much of your total gold (gold and bills) needs to be converted back into paper money. It's supposed to set this value to that any gold you gain or loose during bartering is taken into account, and I haven't really changed anything with the code itself when I moved it over to the other ESP, and it was working properly by all accounts in the original mod

 

EDIT: I went back and looked at the most recent version before I split the ESP and apparently the old version is actually messed up as well. In a slightly different way. I think I;m just going to remove this function until I can find a clean and simple way of making it work. I'm thinking that I should be able to strip down the variables and make it a little more readable as far as the logic is concerned and find an easier way of facilitating the coin changing. This is so disappointing.

Edited by icecreamassassin
Link to comment
Share on other sites

Saving a file with CSE will add all loaded esm and esp files as masters to the current file. Right-clicking a mod in Wrye Bash and selecting "Add Master" allows you to set files as masters to the selected file.

 

And I understand how your mod is supposed to work (I did read your last couple of threads). What I don't understand is what you're saying right here:

 

- you acquire some gold from chests, dead enemies, etc then go back to a merchant (now it gets broken, the bills convert ok but then when you leave, it only converts the money you had before acquiring additional gold outside of dialog
Link to comment
Share on other sites

sorry, I mean basically if you acquire gold outside of dialog (like from looting and chests etc) the script should convert any excess gold down into bills when you exit dialog...

 

Anyways I think I am going to drop this extensive code unless you have a magical cure for it :) instead I just want to have the add-on file have a script to do the paper money change out when the mod loads like this:

 

scn CRcurrencyhandlerscript

float fQuestDelayTime

short convertedfunds
short customerservice

short doonce
short account
short interestdays
short convertedfunds
short cycle

; paper currency convertion variables
long CRWRKTTL
long CRGOLDCT
long CRBANKNOTECT
long CRCURRENTGOLD
long CRBUYSELLAMT
short state

;paper currency counts
long fivebill
long tenbill
long twentybill
long fiftybill
long hundredbill
long fivehundredbill
long thousandbill
long fivestack
long tenstack
long twentystack
long fiftystack
long hundredstack
long fivehundredstack
long thousandstack

long leftovers

Begin GameMode

set fQuestDelayTime to .02

if convertedfunds >= 0 && convertedfunds < 10
if player.getitemcount gold001 > 10000 && 	player.getitemcount gold001 < 15000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0100 1		; 10k
	player.removeitem gold001 10000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 15000 && player.getitemcount gold001 < 20000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0100 1		; 10k
	player.additem MEOclutterseptimsstack0050 1		; 5k
	player.removeitem gold001 15000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 20000 && player.getitemcount gold001 < 30000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0100 2		; 20k
	player.removeitem gold001 20000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 30000 && player.getitemcount gold001 < 40000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0100 3		; 30k
	player.removeitem gold001 30000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 40000 && player.getitemcount gold001 < 50000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0100 4		; 40k
	player.removeitem gold001 40000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 50000 && player.getitemcount gold001 < 60000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.removeitem gold001 50000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 60000 && player.getitemcount gold001 < 75000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.additem MEOclutterseptimsstack0100 1		; 10k
	player.removeitem gold001 60000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 75000 && player.getitemcount gold001 < 100000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.additem MEOclutterseptimsstack0050 5		; 25k
	player.removeitem gold001 75000
	set convertedfunds to convertedfunds + 1	
elseif player.getitemcount gold001 > 100000 && player.getitemcount gold001 < 125000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 1		; 100k
	player.removeitem gold001 100000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 125000 && player.getitemcount gold001 < 150000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 1		; 100k
	player.additem MEOclutterseptimsstack0100 2		; 20k
	player.additem MEOclutterseptimsstack0050 1		; 5k
	player.removeitem gold001 125000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 150000 && player.getitemcount gold001 < 175000
message "  "
message "  "
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.additem MEOclutterseptimsstack1000 1		; 100k
	player.removeitem gold001 150000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 175000 && player.getitemcount gold001 < 200000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 1		; 100k
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.additem MEOclutterseptimsstack0100 2		; 20k
	player.additem MEOclutterseptimsstack0050 1		; 5k
	player.removeitem gold001 175000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 200000 && player.getitemcount gold001 < 225000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 2		; 200k
	player.removeitem gold001 200000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 225000 && player.getitemcount gold001 < 250000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 2		; 200k
	player.additem MEOclutterseptimsstack0100 2		; 20k
	player.additem MEOclutterseptimsstack0050 1		; 5k
	player.removeitem gold001 225000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 250000 && player.getitemcount gold001 < 275000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 2		; 200k
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.removeitem gold001 250000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 275000 && player.getitemcount gold001 < 300000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 2		; 200k
	player.additem MEOclutterseptimsstack0500 1		; 50k
	player.additem MEOclutterseptimsstack0100 2		; 20k
	player.additem MEOclutterseptimsstack0050 1		; 5k
	player.removeitem gold001 275000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 300000 && player.getitemcount gold001 < 500000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 3		; 300k
	player.removeitem gold001 300000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 500000  && player.getitemcount gold001 < 1000000
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 5		; 500k
	player.removeitem gold001 500000
	set convertedfunds to convertedfunds + 1
elseif player.getitemcount gold001 > 1000000  
message "  "
message "  "
	player.additem MEOclutterseptimsstack1000 10		; 1mil
	player.removeitem gold001 1000000
	set convertedfunds to convertedfunds + 1
else
	set convertedfunds to 10
endif
elseif convertedfunds == 10
set leftovers to player.getitemcount gold001
set leftovers to leftovers - 1000
if leftovers > 50000
	messagebox "Gold is heavy, and as such most of your gold has been converted to Imperial Bank Notes. Most merchants offer merchant services where they will exchange gold for notes or vice versa, or for a small fee, advance gold to you from your bank account if you have one. The bank also offers various services for managing your money. Since you had a large amount of money, the extra funds which were not converted have been placed in a savings account in your name at the bank."
	set CRpersonalaccount to leftovers
	player.removeitem gold001 leftovers
	set convertedfunds to 11
else
	messagebox "Gold is heavy, and as such most of your gold has been converted to Imperial Bank Notes. Most merchants offer merchant services where they will exchange gold for notes or vice versa, or for a small fee, advance gold to you from your bank account if you have one. The bank also offers various services for managing your money."		
	set convertedfunds to 11
endif
endif

end

 

Problem is though when I do this, it requires that I have the MEO money editor ID's listed in the code be in the mod. I've added them over and when I try and use the dialog in game to swap out gold for bills or bills for gold, or use the depository to change bills to gold, nothing happens because those functions use the MEO editor ID's from the base mod and the Add-on mod overwrites them when they are included.

 

Alternately I've loaded up the base ESP file (not active) and made the script above in a quest and saved the new plugin as the addon and the CS crashes every time I try and save. I assume that by saving this new ESP with uses of editor ID's that are not in the new ESP is causing it, but I'm sure I;m just doing something really wrong. I think the problem lies with setting up a master/dependent status between the two ESP's I guess I'll DL wyrebash and try and figure out how to set the master status because the CS is not doing it no matter how I load and save the plug ins.

Link to comment
Share on other sites

From what I can tell from your scripts, this is what you want to do:

 

- if the player has over 10,000 gold, convert gold to bills

- if the player has 10 bills, stop converting gold to bills

- if the player has 10 bills, and over 51,000 gold, remove all the gold (except for 1,000) and put it into a "bank"

 

I'm still not sure I understand the problem with acquiring money outside of dialogue... I guess what you want is for the player to have a maximum of X gold at any time? And acquiring money outside of dialogue will increase the player's gold past X, but the script does not automatically deposit that to the "bank" account?

 

If so, that's because the code you're using to convert the player's money at the beginning (to set a maximum) runs only once and never again. You would need to somehow reset the "convertedfunds" variable back to 0 whenever you need to enforce the limit.

 

I'm pretty sure I can re-write your code to be shorter, but I prefer using OBSE functions...

 

EDIT: Actually, I remember I posted a shortened version in one of your other threads.

Edited by fg109
Link to comment
Share on other sites

  • Recently Browsing   0 members

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