icecreamassassin Posted September 9, 2011 Share Posted September 9, 2011 (edited) So I really need to figure out some way to prompt the player for a numerical input which will set a variable, either a global or a script long variable, so that the script can then basically cycle through several value checks and add items to the player's inventory and reduce down the number by appropriate values until it's at 0. ex: A player has 246,850 gold that they want to convert to paper money. The field pops up and they enter this amount, the script then sees they entered a value more than 100,000 so it gives them a stack of money worth 100,000 then reduces the value to 146,850, and repeats the check, again giving a stack worth 100,000 then sets it to 46,850 which is cycles again and gives 25,000 then 10,000 and 10,000 again then 1000, then 500, then 100, 100, 100, and finally 50. The value is then reduced to 0 after several cycles and the script terminates. Each step of the way gold is removed for the appropriate paper money value. So... How do I employ a user defined numerical value? I can script the rest no problem, but not sure where to accomplish this. I am assuming it will involve some OBSE which I know next to nothing about. Any help is much appreciated Edited September 9, 2011 by icecreamassassin Link to comment Share on other sites More sharing options...
HeyYou Posted September 9, 2011 Share Posted September 9, 2011 Probably have to use the OBSE text input function....... Link to comment Share on other sites More sharing options...
icecreamassassin Posted September 9, 2011 Author Share Posted September 9, 2011 yeah I figured that'd be a route that may be the way to go, but am not really sure how to get started with OBSE. I mean I've used it for a couple things, but not sure how to implement it in this case. I got to thinking about it last night though, that the vanilla game already has text input functionality with the naming system, but i dunno if that is hard coded or is accessible via script functions using basic scripting. And if it is, if it's even usable for variable values or just raw text fields. Link to comment Share on other sites More sharing options...
Keirgarth Posted September 10, 2011 Share Posted September 10, 2011 why not just set variables that the player can choose from? This would make it difficult to remove all the cash, but if you set the script up to exchange the chosen amount plus any amount below that, it might work ok. Link to comment Share on other sites More sharing options...
icecreamassassin Posted September 10, 2011 Author Share Posted September 10, 2011 I already have it set that way, and the main issue is that there are several bill types I'd like to try and utilize but the preset choice options are tricky when managing the denominations of currency. I think that what I may do is have the choices to convert X Y or Z amount of gold into bills, but then have the change back be facilitated by dropping the notes into a "depository" which determines what item has been put there and if it's and "X bill" give X gold, a "Y bill" give Y money, and so on. What the problem has been is that because of the multiple denominations, you get bank notes in varies types but then when requesting gold back, you have to figure out specifically which bill type the exchange calls for for the given amount, which is just not intuitive enough of the way I have the script at this point. I'll keep playing with it a guess Link to comment Share on other sites More sharing options...
fg109 Posted September 10, 2011 Share Posted September 10, 2011 I don't think that you can pull up the vanilla text input menu through any console/scripting commands. The only ways I can see is to either use the OBSE or MenuQue's text input functions. This is an example with OBSE: scn example float number short input string_var string Begin MenuMode if (input == 1) UpdateTextInput endif End Begin GameMode if (*something*) && (input == 0) let input := 1 OpenTextInput "Type in a number. You can use decimal points.%r|Complete" 0 20 Return endif if (input == 1) let input := 0 let string := GetInputText let number := GetInputText ;I think this will work as long as the player typed in a number let number := ToNumber string ;This will work for sure CloseTextInput endif End I haven't tried messing with text input in the UI so I don't know how to do it properly with MenuQue. Link to comment Share on other sites More sharing options...
icecreamassassin Posted September 10, 2011 Author Share Posted September 10, 2011 Thanks again for help, I just ended up making a "depository" where the player can cash in paper money for gold and just left the teller with specific choices on amounts of cash to change out, so I think I'm content, now to try and figure out how to use the bills directly in commerce, any ideas there? I thought about using a Quest script that checks for the bills in your inventory and then when in dialog it silently sets a global variable and removes the bills and adds gold so you have the funds to use, then when the dialog ends, if the variable is less than the gold you have left it converts the funds (variable) back to paper bills. Any thoughts? Link to comment Share on other sites More sharing options...
fg109 Posted September 10, 2011 Share Posted September 10, 2011 So you mean something like this? 1. Player enters dialog2. Quest script records the amount of gold the player carries3. Quest script calculates the value of player's bills4. Quest script removes the bills and adds gold5. Player exits dialog6. If player's gold is less than the recorded amount, ignore the rest of the steps7. Quest script removes gold until player has the recorded amount8. Quest script adds bills corresponding to amount of gold removed I don't think there will be any problems with it. Link to comment Share on other sites More sharing options...
Recommended Posts