Doctor, doctor, give me the news - I have a bad case of variable blues

JayIsrael

Veteran
Veteran
Joined
May 16, 2019
Messages
102
Reaction score
28
First Language
English
Primarily Uses
RMMV
Working on my first game ever (so you'll be seeing a lot of posts from me as I try to pry your precious delicious knowledge from your collective brains), and so far variables are the things I have most avoided while working with RPG Maker because they stink of math and I do hate math... However, I have set it up so that you can talk to the characters in your party, by pressing a button on your keyboard which corresponds with their name - one party member is a doctor, and I would like to have it so that if you talk to this doctor, and your HP is below a certain number, the doctor will offer to heal you - and you will gain HP. So this would require a conditional branch and a variable - maybe more than one?
I just don't know how to do it.

Any help would be greatly appreciated.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
one control variable command to get the current number of HP (it's one option in the game data section
a conditional branch comparing the variable with the number you set.
then the change HP command to heal.

as for your personal cure - follow the link to the starting point in my signature, then look for the link to the "Variables Guide" - that is a tutorial game.
Because as you just realised - it is impossible to make a game with anything more complex than "go there" quests if you don't know how to use variables for counting and mathematics.
 

JayIsrael

Veteran
Veteran
Joined
May 16, 2019
Messages
102
Reaction score
28
First Language
English
Primarily Uses
RMMV
Thank you for the quick response.
I don't think I can use that guide, as it is an exe file, and I use a Mac. Also, I think it is a guide for a different version of RPG Maker. I use RPG Maker MV.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
The guide is in ACE, but the idea is the same. The only thing that is different is anything referencing scripting.
 

JayIsrael

Veteran
Veteran
Joined
May 16, 2019
Messages
102
Reaction score
28
First Language
English
Primarily Uses
RMMV
The guide is in ACE, but the idea is the same. The only thing that is different is anything referencing scripting.
I don't think I can view the guide as it is an exe file and I am using a Mac. Is there a video of this guide ? Or a .rpgproject file? Or a dmg?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
The tutorial is a full downloadable game. Are you saying that you cannot run any RM game except those specifically made for Mac?
There are no half-way decent videos on variables and switches as far as I am aware.
 

JayIsrael

Veteran
Veteran
Joined
May 16, 2019
Messages
102
Reaction score
28
First Language
English
Primarily Uses
RMMV
The tutorial is a full downloadable game. Are you saying that you cannot run any RM game except those specifically made for Mac?
There are no half-way decent videos on variables and switches as far as I am aware.
Yeah, I noticed that variables was not a popular topic in video tutorials. There was one i saw that tried to explain it using pie and cake - but I just found it far too confusing.
And yes - Macs can not play games made for PCs, exe files, just as PCs can't play games made for Macs, dmg files. If you have a game out, and you created it as a exe file, but did not make a version formatted for dmg, then Mac users can not play your game.
I can play .rpgproject files since I have the Steam version of RPG maker.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
But as I explained, if you are downloading this properly, then you should have the rpgproject file. Here is what I have in the folder from the download:

upload_2019-5-20_21-28-0.png

As you can see, it's the full project, not just an .exe file.
 

JayIsrael

Veteran
Veteran
Joined
May 16, 2019
Messages
102
Reaction score
28
First Language
English
Primarily Uses
RMMV
But as I explained, if you are downloading this properly, then you should have the rpgproject file. Here is what I have in the folder from the download:

View attachment 115992

As you can see, it's the full project, not just an .exe file.
I can't seem to open that file either. That is for RPG MakerVXAce, I am using RPG Maker MV. The project file names are different. I tried opening it and my Mac told me that it didn't know how.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
@Kes there is no MacOS-Version for VXA, so he can't open that project either.

There are only two ways around this:
1) using bootcamp or a virtualimager to install Windows on the Mac
2) trying if the variables guide could be converted to MV

There is a good chance that a conversion might work as it should only use events, but I don't know how @Celianna made that game, if she used script functions then conversion will fail.

@JayIsrael on the eventing side and the database, there is absolutely no difference between Ace and MV. On the mapping side only improvements on MV (which is why the conversion can only go Ace->MV, not back). The main difference is the language of the engine which switch to javascript for portability, and that means that all tries to use older script-code from Ace (which was Ruby-based) will automatically fail in MV.

A conversion can be tried by anyone who has both Ace and MV installed, but I can't do it at the moment
 

JayIsrael

Veteran
Veteran
Joined
May 16, 2019
Messages
102
Reaction score
28
First Language
English
Primarily Uses
RMMV
@Kes there is no MacOS-Version for VXA, so he can't open that project either.

There are only two ways around this:
1) using bootcamp or a virtualimager to install Windows on the Mac
2) trying if the variables guide could be converted to MV

There is a good chance that a conversion might work as it should only use events, but I don't know how @Celianna made that game, if she used script functions then conversion will fail.

@JayIsrael on the eventing side and the database, there is absolutely no difference between Ace and MV. On the mapping side only improvements on MV (which is why the conversion can only go Ace->MV, not back). The main difference is the language of the engine which switch to javascript for portability, and that means that all tries to use older script-code from Ace (which was Ruby-based) will automatically fail in MV.

A conversion can be tried by anyone who has both Ace and MV installed, but I can't do it at the moment

You guys have been incredibly gracious to take your time to help me.

I was fortunate enough to get walked through what I was looking for by a Reddit user named TheDugglerPrime. I am CC&Ping his solution below, in case anyone searches this topic with a similar question.


"So, what your chain of event commands should look like:

Set Variable[0001]: = Character X HP

Set Variable[0002]: = Character X MHP

Set Variable[0002]: / 5 (or another number, whatever the divisor you need in order to achieve the threshold percentage; 5 would result in checking against 20%).

Conditional Branch: Variable[0001] < Variable[0002]

-Here's where your HP restore code would be, inside the indented conditional branch True clause

It's a rough outline, but basically what the above code would do is store the character's current HP in Variable 0001, their max HP in Variable 0002, then divide Variable 0002 to figure out what 20% of their max HP should be. Then, the conditional branch checks to see if their current HP is less than 20% of their max. If it is true, the indented event commands will then run, which is where you'd put the "Change character HP +100" and any dialogue that would come with that. If it's false, then you can either enable an Else clause on the conditional branch and have alternate code run for that outcome, or just have nothing happen.

A lot of this stuff can be applied to other areas of game flow as well, so this is all stuff I recommend getting comfortable with - a game that doesn't use any conditional branching at all is going to be very bare-bones in terms of what kind of play experience it can deliver."
 

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
Thank you for reminding me I should be working on an MV variables guide!

But yes, you are correct. The Variables Guide is an VX Ace version and an .exe so you cannot play it at all.
 

JayIsrael

Veteran
Veteran
Joined
May 16, 2019
Messages
102
Reaction score
28
First Language
English
Primarily Uses
RMMV
Thank you for reminding me I should be working on an MV variables guide!

But yes, you are correct. The Variables Guide is an VX Ace version and an .exe so you cannot play it at all.
I am still an enormous idiot when it comes to variables, so when you have an MV variables guide done, please don't hesitate to let me know.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,115
First Language
English
Primarily Uses
RMMV
I'd highly recommend starting from the beginning of the series but #15, #16, and #17 deal with variables and switches.


(by the way, no need to quote everyone's entire post on your reply, it makes it more to scroll through when reading this on mobile :smile:)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top