Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Questions[RESOLVED]

I'm using RMXP

I am creating a game where you can hire workers, and I want to figure out how to charge 20 coins per worker. Because im using the number insert thingy.
Likewise I want to know how to place workers using the number insert that per worker the variable "workforce" will increase one time per every worker inserted
 
I really don't understand what you mean...you may need to explain this better. If you are saying that you want the player to be able to input a number of workers for hire, then simply take the variable that stores the number and multiply it by the worker cost (20 if you want), and subtract that from Gold. You'll need a conditional branch in there too in case the player doesn't have enough money, so the character could say "Sorry, you don't have enough funds to hire that many workers" or something.

If I understand your second question correctly, you want there to be as many "workers" on screen as the quantity of the number insert variable. I don't think this can really be done efficiently without a script, but if you want to do it using events, you could do it this way:

Make several "worker" characters and place them where you like, then make each have a variable condition (the number insert variable), and number them from 1 to whatever you think the maximum number of workers should be. (So if you want the maximum number of workers to be 10, then you would actually have 10 worker events in your map editor, but they would only appear in-game as their variable condition is met).

That's pretty much the only way you could do it using events, since in RMXP there's no way to instantiate or "create" new characters in real-time.
 
Err sorry but I am not clear and you got me wrong. I know how to do those.

You know the number insert command in the events right?

For example if you hire 23 workers, so 23*20 = 460 coins

And if not enough money, place a message saying that.

I don't want to have limited choices like only 100, 200, 300 and sort of stuff.

For the second question its quite the same, but for events.
Say if the player inserts 653 workers, the "workforce" variable will be 653.

If not enough "worker" variable, then place a message that is saying that.
 
Yeah, both of those things can be done using a conditional branch. When you use Insert Number, it gets placed into a variable, let's call it Quantity. So make a conditional branch that says:

If Quantity * 20 <= PlayerGold
Then
(Accept the player's transaction)
Else
"Sorry, you do not have enough funds."

Since variable computations in RMXP are a pain, you will have to compute Quantity*20 as its own variable prior to the conditional branch. You will also have to set PlayerGold prior to the conditional branch as a variable.

Hopefully that's what you're looking for. Let me know if this doesn't make sense and perhaps I can post a picture of what it would look like in the event window.
 
Immune, I appreciate a screenshot please, and how do I make one variable as the gold?

Unka, im planning on making a game that allows you to own businesses. Its nothing much
 
I made this for you. Its a simple event that asks the player if he wants to buy workers, lets the player choose how many workers would he like to buy, multiples that by 20 and checks if it's an amount bigger or equal to the player's money. If it's lower than the player's money (represented by a variable) it tells him he doesn't have enough. If the player has enough money, it takes the amount it costs (from the same variable that we multiplied by 20), then takes the same variable, divides it by 20 and then increase a variable which is the amount of workers the player has.
In another words, it does the job.
purchasingworkers.png
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top