Jump to content

Need Script Help: How to discount crime gold?


Guest Messenjah

Recommended Posts

Uhm have you tried using a save with the quest not yet started (or at stage 0 if start game enabled)?

 

Wiki says global value is stored at quest startup, so maybe if you load a save with the quest already going, the newly created global won't store.

Link to comment
Share on other sites

Guest Messenjah

Heh, I re-started the mod. I didn't think I would need to because the dialogue has never run before and that quest is not really a quest. It just contains all of my dialogue for my quest.

 

Anyway, it seems to work. The problem is, how do we get it to check the global value and this script before I call on the global value? There will be some dialogue beforehand.

 

For example:

 

Player: I could use a favor.

Quest-Giver: Yes, but favors do not come freely. Pay me half and I will take care of the rest.

Player: Pay <ASXDiscout> gold.

Quest-Giver: Thank you, I will make sure that this is taken care of.

Link to comment
Share on other sites

You can put the above script on the START fragment of "Yes but favor don't........"

 

Then put

 

GetOwningQuest().UpdateCurrentInstanceGlobal(ASXDiscount)

 

on the END fragment.

 

Finally, put the script for removing money and modding the crimegold at the START of the next topic.

Link to comment
Share on other sites

Guest Messenjah

Scriptname ASX_BrothelDialogueQuest extends Quest  Conditional

Int Property RaajahFriend =  0 Auto  Conditional

Int Property ContractRunning = 0 Auto  Conditional 

Quest Property BrothelQuest  Auto  Conditional

Int Property FavorPoints = 0 Auto  Conditional

Int Property SuraniGreet  Auto  Conditional

Int Property AcceptJob  Auto  Conditional

GlobalVariable Property ASXDiscount  Auto  Conditional

Faction Property ReachCrimeGold  Auto  Conditional
MiscObject Property Gold  Auto  Conditional

Float Discount


;Updates ASXDiscount to discounted value. Used during initial dialogue.

Function UpdateGold()
Discount = ReachCrimeGold.GetCrimeGold() / 2
ASXDiscount.SetValue(Discount)
UpdateCurrentInstanceGlobal(ASXDiscount)
EndFunction

;Function used to remove correct ammount of gold from player inventory and removes crime gold from the correct faction.
Function PayGold()

Game.GetPlayer().RemoveItem(Gold, Discount as int)
ReachCrimeGold.SetCrimeGold(0)
ReachCrimeGold.SetCrimeGoldViolent(0)
ReachCrimeGold.SetPlayerEnemy(False)

EndFunction

 

 

That is my current script. I actually tried attaching your suggested script as you said and it made no difference. Gold still shows a value of 0 no matter what I do. :(

 

The functions are called on as I describe above.

Link to comment
Share on other sites

Uhm, let's try copying what Beth did with the Nirnroot quest.

 

Replace your count storing function with this

 

Discount = ReachCrimeGold.GetCrimeGold() / 2
ASXDiscount.value = Discount
UpdateCurrentInstanceGlobal(ASXDiscount)

 

I'm proceeding blindly, sorry.

Link to comment
Share on other sites

hmm...

 

	UpdateCurrentInstanceGlobal(ASXDiscount)
Discount = ReachCrimeGold.GetCrimeGold() / 2
ASXDiscount.ModValue(-Discount)
UpdateCurrentInstanceGlobal(ASXDiscount)

 

.. but I'm wondering if the global value for "CrimeGold", whatever it is called, might also need to have its current instance updated???

Edited by steve40
Link to comment
Share on other sites

ASXDiscount is set to 0 by default, so putting "-Discount" will return a negative number.

 

Also, the Nirnroot quest doesn't use any function, just says "Discount = ASXDiscount.value" O.o

 

Finally, that same quest doesn't call UpdateCurrentInstanceGlobal at the start of the script.

 

CrimeGold isn't a global, nor an actor value. I think it's a number that updates on his own and gets used by the xxxCrimeGold() functions.

Link to comment
Share on other sites

Guest Messenjah
However, the global, "WEBountyCollectorCrimeGold" is a global, and is called on the same way that CrimeGold is. Check out the WEBountyCollector quest script and see what they did. My code is based roughly on that and your quest because it should handle in a similar fashion.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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