Guest Messenjah Posted August 6, 2012 Share Posted August 6, 2012 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 More sharing options...
gasti89 Posted August 6, 2012 Share Posted August 6, 2012 (edited) 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 August 6, 2012 by gasti89 Link to comment Share on other sites More sharing options...
Guest Messenjah Posted August 7, 2012 Share Posted August 7, 2012 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 More sharing options...
gasti89 Posted August 8, 2012 Share Posted August 8, 2012 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 More sharing options...
Guest Messenjah Posted August 19, 2012 Share Posted August 19, 2012 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 More sharing options...
gasti89 Posted August 19, 2012 Share Posted August 19, 2012 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 More sharing options...
Guest Messenjah Posted August 19, 2012 Share Posted August 19, 2012 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 More sharing options...
Guest Messenjah Posted August 19, 2012 Share Posted August 19, 2012 (edited) 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 August 19, 2012 by Messenjah Link to comment Share on other sites More sharing options...
gasti89 Posted August 19, 2012 Share Posted August 19, 2012 (edited) Aww sorry, try typing "Float Discount" EDIT: you may also need to cast "(ReachCrimeGold.GetCrimeGold() / 2) as float Edited August 19, 2012 by gasti89 Link to comment Share on other sites More sharing options...
Guest Messenjah Posted August 19, 2012 Share Posted August 19, 2012 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 More sharing options...
Recommended Posts