Jump to content

Need Script Help: How to discount crime gold?


Guest Messenjah

Recommended Posts

Guest Messenjah

Ok, so I am working on a system where if the player completes a repeatable quest, there will be an integer property that will count up by doing a + 1 to the value of the integer. This property is called "favorpoints". This is my system that I will use to keep track of favor points. All it will do is add and subtract from the integer based on if the player has acquired enough points.

 

 

The thing that is difficult, is what I'm using it for. If the player has enough favor points, I want him/her to be able to spend the points by talking to the npc that you work for to reduce crimegold within the Reach. I was wondering how to go about writing a script to reduce the crime gold by half or by a certain percentage?

 

So, I would need to somehow call on myFaction.getcrimegold()

 

But the trick is to then take the value of that and divide it by a specified percentage in such a way that the value can be displayed to the player when he selects in-dialogue to pay the specified amount. That value should then probably be stored some way, so that the dialogue result script fragment can then setcrimegold to 0 and remove the halved value of gold from the player.

 

 

Anyone know how to go about this?

Link to comment
Share on other sites

Just to clarify, what you want to obtain is:

 

- You do the same quest multiple times and every completion increases the "favorpoints" count by 1

 

- When you reach a certain amount of "favorpoints", a dialogue becomes available on a NPC

 

- Selecting that dialogue completely removes the bounty

 

- Removing the bounty sets the "favorpoints" back to 0

 

?

Edited by gasti89
Link to comment
Share on other sites

Guest Messenjah

Yes and no. I DO want to do all of that, but that part should be reasonably easy to do.

 

 

The hard part, is difficult to explain:

 

I need a test to show up when the player asks for a favor. The text should display a message but that message will require some script. The message needs to display half of the players current crime gold. For example:

 

Player: I would like to call in a favor.

 

NPC: I can remove your bounties for <faction.getcrimegold /2> septims if you are willing to pay the amount to me now.

 

The trick is that I'm not sure how to half the gold? Is that the correct format to do this, or do I need a work-around?

Link to comment
Share on other sites

I just looked at the CrimeGuardDialogue quest.

 

What they use is <Crimegold>. Also the CrimeOrcQUest uses the same tag.

 

There's no script that calls that variable, so i suppose it's a default tag (damn, the wiki doesn't talk about it).

 

The fact is i don't know 2 things:

 

- if you can say <Crimegold/2> or <Crimegold / 2>

 

- if you can use it in a response, cause i always see them in player topics, never in responses.

 

You can try messing with them.

Link to comment
Share on other sites

  • 2 weeks later...
Guest Messenjah

Alright, <CrimeGold /2> doesn't work. So I tried something, I made my own global called ASXCrimeGold

 

Here is the script for my dialogue quest.

 

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

Float Property Discount  Auto  Conditional

Faction Property ReachCrimeGold  Auto  Conditional


ReachCrimeGold.GetCrimeGold()
Discount=ReachCrimeGold / 2
Discount as int
ASXDiscount.setValue(Discount)

 

For some reason, it won't compile the last bit. What I am trying to get it to do, is store the value of the crime in the Reach Crime Faction, divide it by half, and set that as the value of the Global Value "ASXDiscount". Then, the player can call on <ASX Discount>. However, for some reason, it WILL NOT COMPILE and I DO NOT KNOW WHY. :P

Link to comment
Share on other sites

Discount shouldn't be set as a property, since you define it as a script variable. Instead, ASXDiscount should be set as a globalvariable property

 

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

Discount = ReachCrimeGold.GetCrimeGold() / 2
ASXDiscount.SetValue(Discount)

 

But this will just mod the global variable. Then you'll have to "RemoveItem(Goldproperty, ASXDiscount as int)" or something like that.

 

Also, this script should run before you have the option to pay the gold, because if you call the global as text replacement it will show the old value if this script hasn't run already.

Link to comment
Share on other sites

Guest Messenjah
Shouldn't <code>UpdateCurrentInstanceGlobal(ASXDiscount)</code> take care of updating for you? I just followed along with the default bounty hunter quest script and it included this in the script.
Link to comment
Share on other sites

Guest Messenjah

Didn't compile:

 

Starting 1 compile threads for 1 files...
Compiling "ASX_BrothelDialogueQuest"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\ASX_BrothelDialogueQuest.psc(19,8): no viable alternative at input '='
No output generated for ASX_BrothelDialogueQuest, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on ASX_BrothelDialogueQuest

Edited by Messenjah
Link to comment
Share on other sites

Guest Messenjah

Ok, it compiles. So now on to the next problem.

 

In dialogue, I can not set up a response with this, but the topic text can contain it.

 

Here is what I have in my topic text:

 

Pay <Global=ASXDiscount>

 

The result?

 

Pay [...]

 

Why won't it show a value? It should at least show 0... which is the default value.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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