Jump to content


Photo

Input Number Issues

variables

  • This topic is locked This topic is locked
8 replies to this topic

#1 Dark Messiah

Dark Messiah

    Rude Dude

  • Ace Member
  • 32 posts
  • LocationOhio
  • RM Skill - Writer

Posted 28 March 2013 - 05:11 PM

Hello all!

I would like to set up a sort of donation bowl at random churches in my game. So far, I've got it so that when you click on it, it does a check on your current money. Then when you go to decide how much you want to donate, I use an Input Number option, then subtract that variable from my current gold. Only problem is that there is no limit, it seems. Heres an example:
 

Spoiler

 

If you look at it, I can basically set the number to whatever I want, despite my current money count. Then when I go to donate again, that number sticks, even though I didn't have enough. I was hoping someone knew a way around the events to make it so that when you go to input the number, it can block you if your funds are insufficient.


Posted Image

#2 Arin the Radiant

Arin the Radiant

    Everything...should just disappear.

  • Banned
  • 955 posts
  • LocationWith Al Pacino.
  • RM Skill - Jack of All Trades

Posted 28 March 2013 - 05:24 PM

You have to also make a Conditional Branch, so that you don't accidentally expend all of your money. Something simple like > 0 Gold.


Rabbit Killer:

Spoiler

aVbAM22.png

 

1kHBOb8.gif

genesis_vs_sephiroth_by_jlegend83-d4cu68


#3 Dark Messiah

Dark Messiah

    Rude Dude

  • Ace Member
  • 32 posts
  • LocationOhio
  • RM Skill - Writer

Posted 28 March 2013 - 05:31 PM

Well, I had it set up that way already. The part where if your gold is > 0, then continue to the event. It's more or less being able to donate MORE than what you have. I wouldn't wanna restrict the user from being charitable enough to donate everything s/he has, but you can't donate what you don't have, ya know? It's like overdrawing your bank account, except there's no negative number, it just stops at 0.

Party has 50 yen.

Donate 60 yen to the bowl.

0 yen left in the party, but donation bowl has 60 yen now. The numbers don't add up.


Edited by Dark Messiah, 28 March 2013 - 05:32 PM.

Posted Image

#4 Galv

Galv

    Forum Defender

  • Staff Manager/Global Mod
  • 4,930 posts
  • LocationAustralia
  • RM Skill - Jack of All Trades

Awards Bar:

Users Awards

Posted 28 March 2013 - 05:40 PM

Sounds like you've done something wrong with your variable/gold checking - post a screeny of the event commands

galv-plea.png sig-kickstarter_zpsda2cb57e.png


gs-banner_zpsfc59b073.png bb-logo_zps34dc32d8.pngconstellation1_zps9e598b08.png


#5 Dark Messiah

Dark Messiah

    Rude Dude

  • Ace Member
  • 32 posts
  • LocationOhio
  • RM Skill - Writer

Posted 29 March 2013 - 01:11 AM

Spoiler

 

As you can see, it's kind of a hot mess.


Posted Image

#6 Galv

Galv

    Forum Defender

  • Staff Manager/Global Mod
  • 4,930 posts
  • LocationAustralia
  • RM Skill - Jack of All Trades

Awards Bar:

Users Awards

Posted 29 March 2013 - 01:23 AM

Your variable 6 is called 'Party Gold' but I don't see anywhere that sets that variable to be equal to the party gold.
Using Control Variables you need to set the variable to Game Data > Other > Gold every time before using the variable

galv-plea.png sig-kickstarter_zpsda2cb57e.png


gs-banner_zpsfc59b073.png bb-logo_zps34dc32d8.pngconstellation1_zps9e598b08.png


#7 Dark Messiah

Dark Messiah

    Rude Dude

  • Ace Member
  • 32 posts
  • LocationOhio
  • RM Skill - Writer

Posted 29 March 2013 - 01:37 AM

Oh really? I only did that once, and that was in my starting maps (the ones I do to set up the premise and Character Creation script), along with any other variables that I anticipated would be recurring, like my character class variable I had asked about previously, or the player's current battle count. So I have to set the variable to the Gold every single time? Cuz I just realized a Common Event will combine all the churches into one event, so I'll have to separate them with a different variable for every church.


Edited by Dark Messiah, 29 March 2013 - 01:38 AM.

Posted Image

#8 estriole

estriole

    Advanced Member

  • Ace Member
  • 1,679 posts
  • LocationIndonesia
  • RM Skill - Coder

Posted 29 March 2013 - 01:41 AM

as galv said. variable that store party gold need to be updated before you make comparison with donated money. game variable don't update by itself. unless you use script for the conditional branch and use $game_party.gold

example conditional branch from above your case (put in script box in conditional branch)

 

$game_variables[9] >= $game_party.gold

Edited by estriole, 29 March 2013 - 01:42 AM.


#9 Dark Messiah

Dark Messiah

    Rude Dude

  • Ace Member
  • 32 posts
  • LocationOhio
  • RM Skill - Writer

Posted 29 March 2013 - 06:57 AM

I think I got it!

 

Spoiler

 

After adding a few conditional branches, I was able to get it to function properly. I tried this with a duplicate event using a second donation variable, and they kept separate amounts! So, not sure if this would be useful for anyone, but follow this structure and it should work! I even set it so that the Reputation doesn't get spammed like crazy every time you donate. Now it will only work on newly activated donation bowls. The self-switch trick was actually picked up from Galv's Multiple Containers script, so thanks for that little tip as well. :P

Thanks for all your help, guys!


Edited by Dark Messiah, 29 March 2013 - 06:59 AM.

Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users