HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need help with a Bank Trigger

04-26-2004, 10:40 PM#1
cfmonkey45
Ok... I had an idea similar to what the guys in Life of a Peasant 9.9 had: by typing in -deposit (Number you Want). Then with that, the money in the bank continually increased, then when you typed -balance it would show you how much money you have in the bank. Then you could withdraw it by typing -withdraw (Numver you want) and you get that money out.

So I want to know how to do that because I wanted to do something similar in another map using that way.

Oh ya and the bank was just a terrain with walls and gates.
04-26-2004, 11:18 PM#2
Deathperception
Well basically it seems that you want to make a banking system using variables to store how much money each player has at first I thought I could make you a demo map easy until I remembered this.

There is a problem with when you deposit money for instance lets say I had 50 gold and i typed -deposit 10 I should still have 40 gold on me right? Well since in WC you must specify exactly how much gold you want to remove from the players pocket this will erupt into quite a large trigger. Not an impossible one but a very large one. But I may be wrong I gotta go into the mapmaker to refresh my memory.
04-27-2004, 12:31 AM#3
ThyFlame
Alright. Any value accepted.

-deposit XXX
-withdraw XXX
-balance


Moved.
04-27-2004, 01:14 AM#4
Deathperception
Yup I was wrong can just specify an integer to give current gold ;) not a long trigger at all. But someone helped you already saved me like 15 mins of work thanks ^_^. Nicely done banking system.
04-27-2004, 01:25 AM#5
Deathperception
Personally its nice that people like me and others can make triggers like this for you but remember look at the triggers and try to comprehend how they work otherwise your not learning anything.

If the word variable scares you don't let it all it is is a little line of code to store some data in this trigger the variable is called an integer to store a number and in other triggers you might want to use strings that store text. Look at some tutorials on the forums and on other sites and experiment with variables and you'll find they are really not that complicated and that they can make triggering in Warcraft alot simpler. :D
04-27-2004, 01:44 AM#6
pappi.chullo
That was a pretty good system, only that it had math calculation problems. I used the keysersoze cheat for gold to test it. I deposited 1000, then withdrew 10000. My balance was 666... lol
04-27-2004, 04:06 AM#7
ThyFlame
No, it's fine. Look at the interest trigger. I think I set it at 1/15th (7%) interest every 30 seconds.

The most notable thing about this trigger is that it accepts any number. I've been doing a lot of work with substrings, so the idea came to mind.
04-27-2004, 09:57 PM#8
cfmonkey45
Hey thanks guys!!!! :D :D :D :D I FINALLY NO HOW TO DO A BANK SYSTEM!!!!!!!!! :D :D :D :D THANKS :D :D :D
04-27-2004, 10:29 PM#9
ThyFlame
Don't spam smileys... and yes, this is a decent bank system. There is a lot that can be done via substrings that people don't realize. Ah well. Next question?
04-28-2004, 12:10 AM#10
QuatreDan
Quote:
Originally Posted by ThyFlame
No, it's fine. Look at the interest trigger. I think I set it at 1/15th (7%) interest every 30 seconds.

The most notable thing about this trigger is that it accepts any number. I've been doing a lot of work with substrings, so the idea came to mind.

Real comparison? Just wondering because I was searching for ways to prevent string triggers that used numbers from crashing if letters were used instead, and I found that adding a Real comparison was the trick. Is that what you used to allow any number to be used? :(
04-28-2004, 12:34 AM#11
ThyFlame
If it gets a letter, it will record the value as 0 and simply tell you your balance, without any changes.

The substring only cuts out the part after the -deposit_ (_ = a space), so it only gets numbers. If the string contains a non-numeric value, the letter will cause it to become 0. So, that is not a problem.
04-28-2004, 03:00 AM#12
QuatreDan
Quote:
Originally Posted by ThyFlame
If it gets a letter, it will record the value as 0 and simply tell you your balance, without any changes.

The substring only cuts out the part after the -deposit_ (_ = a space), so it only gets numbers. If the string contains a non-numeric value, the letter will cause it to become 0. So, that is not a problem.

:\ No, I haven't looked at the map; I'm asking you map maker to map maker. Is it using real comparisons that makes what you're talking about happen? Because I know that every time I don't use a real comparison, and a letter is typed where a number should be, the game crashes. I'm not just talking out of my butt here.
04-28-2004, 08:31 PM#13
ThyFlame
No real comparisons are used. I use only a substring to get the amount, which is promptly converted into an integer. Reals are not used. Can't have decimal amounts of gold anyway.
05-01-2004, 10:33 PM#14
Deathperception
By the way for the person that gave me that wise remark by reputation points I am not taking credit for anyone else's work the fact that you even stated this infuriates me :< I am simply stating a fact. It is also sadder that you hid behind the reputation system so I wouldn't even know your name. I'd rather send this to you privately via PM or e-mail rather then post this for anyone to see.

Personally if you can't take someones elses opinions or advice without insulting or aggravating them don't talk at all.

I am probably blowing this out of proportion a little but I "have had it with dealing with peoples wise and aggravating remarks and just taking it" Especially when I didn't even remotely hurt or insult them. I just had to state this.

With that I'm going to forget about the whole thing ^_^ and please be more careful in selecting your words.
05-01-2004, 10:55 PM#15
deep_dheep
Sorry to tell you but the idea is old like my grandma