Scripts / how to get input from player and use it or save it

Author
Message
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 9th Nov 2016 10:37
hi everyone

I have this script in my game were I want the player to go to an atm and deposit or draw money.
the script first check if the player has money , and when he does , I want to have an input from the player , his name and also the amount of money he would like to deposit, problem is I don't know how to get an input from the player and how to save it for later use. I have attach my script so far. its not much but its all I have. ( still learning )



Thanks for any help
Windows 7 Professional 64-bit
Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz (4 CPUs), ~2.7GHz RAM 4GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 9th Nov 2016 12:08 Edited at: 9th Nov 2016 12:49
Hi PCSKILLER, I sure someone will pick this up for you but... You need to put in the basic global variables so you can use and keep track of your money from level to level.

g_bankAmount -- How much is in the bank.
g_pocketMoney -- How much money you are carrying.

Then how is it going to be deposit, withdrawn and in which quantities as local variables.

local fiveCash = 5
local tenCash = 10
local fiftyCash = 50
etc.

Then you can setup icons or text panels to choose from. No need for player text input boxes.

Just add each input to a variable to add or remove the quantity.

Think about this first then, I'm sure someone can help with the rest.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 9th Nov 2016 13:18
Hi gd thanks for the reply.

I have a money script witch I use in the game when the player picks up the money then it can be anything from a 5 , 10 , 50 or 100 Rand that he is going to pick up.


I was just thinking it would be nice if the player can at the atm enter his account number, and then it will display his name and money that he has banked before. but I need the get his name in to a file or somewhere , were I can use it again when he use the atm.
Windows 7 Professional 64-bit
Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz (4 CPUs), ~2.7GHz RAM 4GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 9th Nov 2016 15:27 Edited at: 9th Nov 2016 15:29
This link may help for the account number.

Number Keypad scripting help
You will need to remove the animation code

---SetAnimation(0);
---PlayAnimation(e);


and change the password to eight digits

local password = {3,1,9,2,6,8,1,9}

then change number key count to 9 from 5

if numberpadPressQuantity == 9 then

Then add your script.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3
PM
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 9th Nov 2016 15:38 Edited at: 9th Nov 2016 15:39
Making his name to be use across scripts you will have to use a globe g_AccountName

Example would be

Do the same with all the other variables.
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3
PM
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 11th Nov 2016 15:02 Edited at: 11th Nov 2016 15:09
Hi PCSKILLER, I was looking at a way to get this to work with an ATM and came up with this WIP.



I start with 100 pounds in my pocket then check my balance at the ATM. Go back to main menu and deposit cash then exit ATM. Then use the ATM again with a new transaction and withdraw some more cash.

Let me know what you think.


Just notice I spelt pocket wrong in the you tube lol
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 14th Nov 2016 21:18
Hi gd this looks awesome, ten times better better as what i was trying to do.
Did you made the atm yourself, it looks cool.
i was thinking to give the player the game character name , so that i do not need to ask him to input a name, at the atm.

realy licked the video.
Windows 7 Professional 64-bit
Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz (4 CPUs), ~2.7GHz RAM 4GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11
gd
8
Years of Service
User Offline
Joined: 21st Jul 2016
Location: Small Darkroom with no red light
Posted: 15th Nov 2016 00:20
Hi PCSKILLER, I did not make the ATM myself but it was a free model from the net with a little re-texture. I have just made a credit card as a collectable entity which works fine. I'm just making it work with a PIN and the ATM script.

I'm also thinking of making a hole in the wall ATM too, so you can whack it on the side of a building.

The credit card could be issued in the bank by a NPC. The idea behind this; you start the game with no money as you have lost your wallet. You have to find a NPC to give you some money to call the bank. The bank then tells you to come into your branch of the bank, so they can issue you with a new credit card. Now you can use your banks ATM to store cash and make withdrawals.

You could make it a credit card or debit card its up to you. With a credit card you could start the player of with some money but they have to pay it back based on a game timer. If they don't they could be hunted by the county court bailiffs. Just like real life to add depth to your game lol.

Some ATM's could also have charges applied or exchange rates.

I will upload the ATM when I have finish the scripting and sounds

How yours going?
Dark Base 900 Pro OJ: Rampage V Ed.10, i7 6950x non-OC, DDR4-3333 64 GB RAM, Win 10/64, Asus Strix GeForce 1080 x 2 MDA mode, Water cooled with an old Victorian cast iron radiator and a industrial leather belt driven fan - That's what you call Steampunked.

Laptop - M17xR3
PM
PCS
8
Years of Service
User Offline
Joined: 7th Jul 2016
Playing:
Posted: 17th Nov 2016 20:11
hi gd, i am working so many long hours, i do not get a lot of time to work on my project. and i am also new to the game making business , an still learning very slowly lua. lol. so my project is coming on to slow.
Windows 7 Professional 64-bit
Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz (4 CPUs), ~2.7GHz RAM 4GB NVIDIA GeForce GT 730
DirectX Version: DirectX 11

Login to post a reply

Server time is: 2024-12-22 23:37:48
Your offset time is: 2024-12-22 23:37:48