Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

[Answered] Transfering one variable to anothe4

17 years ago

Can I save a certain variable value as a different variable. E.g.

You walk into a bank. You have 72 dollars. You talk to the banker, and deposit the money into the bank. You then leave.   Later, you come back. You make a withdrawl of all your money, so now you have 72 dollars again.

can i do it something like this?

Hi, welcome to the bank. Your account currently contains %%MONEYSTORD%% dollars. Would you like to make a withdrawl?

    Yes

How much will you withdraw

   1 dollar   (Add 1 to MONEY, subtract 1 from MONEYSTORD)
   5 dollars   (Add 5 to money, subtract 5 from MONEYSTORD)
   10 dollars   (Add 10 to MONEY, subtract 10 from MONEYSTORD)
   50 dollars
    (Add 50 to MONEY, subtract 50 from MONEYSTORD)
   (Here's my real question. is this possible?)
   All money   (Add %%MONEYSTORD%% to MONEY, reset MONEYSTORD to 0)

supposing you had 72 dollars

please help a loser out!

signed, Expander (aka the loser)

[Answered] Transfering one variable to anothe4

17 years ago

yes and the other numbers would be restricted for the money saved

and could the same thing be with a deposit? (EG 1, 5, 10, 50, 100, 200, 500, 1000, etc, all)

but you would have to have the money.

if this can't be done, move to FWW.

signed expander

[Answered] Transfering one variable to anothe4

17 years ago
This is possible with scripting

[Answered] Transfering one variable to anothe4

17 years ago

crap

any way w/o scripting? that's greek to me

[Answered] Transfering one variable to anothe4

17 years ago

Everything is possible but the "All money" transaction.

 

Your way around it is to do a shitload of links, all the way up to immeasurably high numbers.  Then restrict the ability to click on them if they don't have that amount of money in the bank.

[Answered] Transfering one variable to anothe4

17 years ago
You can do "all money" transactions, but tsmpaul beat me to how to show it. Try and learn scripting, Expander, it can do almost anything.

[Answered] Transfering one variable to anothe4

17 years ago

Scripting isn't the terror you might think it is. You're already alomost scripting just from your description of what you want done.

Make this link:

1 dollar

with this script:

-------------------------------------------------------------
IF %MONEYSTORD > 0 THEN
BEGIN
%MONEY := %MONEY + 1
%MONEYSTORD := %MONEYSTORD - 1
END
-------------------------------------------------------------

What you are doing in the script is this. First line - checking to see if there is any money for the player to take out. Is moneystord greater than zero? If it is, you want some things to happen. Put a Begin in front of the things you want to happen, and an END at the end of it. Next we have the things you want to happen. We take money, and we want it to equal the current value of money, plus 1. Then we take moneystord, and we make it equal the current value of moneystord, minus 1. Changing the numbers plussed and minussed changes the amount of money in the transaction.

However, the first line needs to change so that it makes sure the new amount can be taken from the bank:

5 dollars:
IF %MONEYSTORD > 4 THEN

10 dollars:
IF %MONEYSTORD > 9 THEN

and so on.

As for "All Money" link:

---------------------------------------------------------
%MONEY := %MONEY + %MONEYSTORD
%MONEYSTORD := 0
---------------------------------------------------------

You want Money to equal the current amount of money, plus moneystord, then make moneystord equal zero.

Do the reverse to put all your money into the bank:

--------------------------------------------------------------------
%MONEYSTORD := %MONEYSTORD + %MONEY
%MONEY := 0
--------------------------------------------------------------------

I hope this helps you break into scripting!

[Answered] Transfering one variable to anothe4

17 years ago
This sorta thing is exactly why you deserve everyone's trophy :D