GoldHorse Delivery Service Script Problems

Post » Thu Feb 03, 2011 2:07 am

http://tesnexus.com/downloads/file.php?id=33191

I am writing a script which will grant the PC money based on their level every week. The money is supposed to be stashed in a chest.

Now, this is the current script, but it doesn't seem to add anything to the chest:

begin GameModeif (GetStageDone GoldHorseRanks, 81 == 1) || (GetStageDone GoldHorseRanks, 76 == 1)  ;if the quest is completed, we need to compute weekly profits  if (oldgameday != gameday) ;compute a week    set gamedays to gamedays + 1    set oldgameday to gameday  endif  if (gamedays == 7) ;if end of week is reached, flag profit gather time	Set PlayerLevel to Player.Getlevel	set profittime to profittime + 1	Message "It's Payday!"	Set ChestGoldCount to (100 * PlayerLevel)	aaaPMC.AddItem Gold001 ChestGoldCount	set gamedays to 0  endifendifend

User avatar
Bek Rideout
 
Posts: 3401
Joined: Fri Mar 02, 2007 7:00 pm

Post » Wed Feb 02, 2011 9:00 pm

Do you get the payday message?
You could do that part much simpler, simply set a variable
set payday to GameDaysPassed + 7
then you want to start the weakly payments, now check for

If payday <= GameDaysPassed
set payday to GameDaysPassed + 7
Message "It's Payday!"
........

endif
this should trigger every 7 day
User avatar
Jamie Moysey
 
Posts: 3452
Joined: Sun May 13, 2007 6:31 am

Post » Wed Feb 02, 2011 2:25 pm

The Message is received, it's just that the money is not added to the chest...

But I will add that part nontheless, as it's much simpler. :)
User avatar
roxanna matoorah
 
Posts: 3368
Joined: Fri Oct 13, 2006 6:01 am

Post » Thu Feb 03, 2011 12:37 am

Is "aaaPMC" the base form, or the specific instance of it you placed? If it's the base form, then you're updating what would be created as a new chest of that type, rather than adding content to the existing one.
User avatar
Dan Endacott
 
Posts: 3419
Joined: Fri Jul 06, 2007 9:12 am

Post » Thu Feb 03, 2011 4:10 am

aaaPMC is the ref, so it should be placed into the chest... :/
User avatar
Andy durkan
 
Posts: 3459
Joined: Fri Aug 03, 2007 3:05 pm

Post » Thu Feb 03, 2011 2:35 am

If you get the message 'Its Payday' then you have your chest set up wrong or your getlevel is not working.

Try these 'debug' changes.

        Set PlayerLevel to Player.Getlevel         set profittime to profittime + 1         Message "It's Payday! %.2f", PlayerLevel         Set ChestGoldCount to (100 * PlayerLevel)         aaaPMC.AddItem Gold001 ChestGoldCount         aaaPMC.AddItem Gold001 3         set gamedays to 0 


This will display in the message what the player level is.
And the chest should get at least exactly 3 gold in it.

Also, make sure you are using a clean save game since script changes may not work with a dirty save game.
User avatar
Nicholas C
 
Posts: 3489
Joined: Tue Aug 07, 2007 8:20 am

Post » Thu Feb 03, 2011 5:47 am

Thank you Willie. :)

Will try it out at once.
User avatar
Tracey Duncan
 
Posts: 3299
Joined: Wed Apr 18, 2007 9:32 am


Return to IV - Oblivion