Using Variables When Changing Vocab?

Synapsiz

Villager
Member
Joined
Jun 16, 2014
Messages
9
Reaction score
0
First Language
Dutch
Primarily Uses
Hello,

I created a project where mana is used as a shield bar.

So that any damage will first deplete the mana bar to 0, before doing any damage to the actual HP.

This all works fine.

the problem is that when damage is only done to the mana and not to health

example: 400 hp , 200 shields => 400 hp 112 shields

This message shows up: [enemy] took no damage!

I want to change that message to: [enemy] took X Hp damage and Y shield damage.

I found the line I would need to change in the Vocab section (line 66 of the Vocab module) but I have no clue how I can set the correct values of X and Y in there.

Any help will be much appreciated!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
That isn't as easy as it sounds, because you need programming knowledge to do it.


You see the %s that are scattered through the vocabs? Those are placeholders where the engine enters the names and values.


However, it is the programming line that uses the vocab that provides that data, sou you have to change not only the vocab but also the lines of the engine calling that specific vocab - all of them.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Moving to RGSSx Script Support
 

Synapsiz

Villager
Member
Joined
Jun 16, 2014
Messages
9
Reaction score
0
First Language
Dutch
Primarily Uses
Thanks Andar for the reply and Shaz for moving the topic.

I was hoping for there to be an easy solution, but it seems that I will have to dig deeper.

Luckily I have some experience in coding (and intend to learn more), so I might still be able to reach a solution.

That said, I have no experience with ruby in particular and I only just recently started with RpgMaker.

So I'm a bit hesitant to just start making changes at random in fear I break some important parts of the code.

After the reply from Andar I started to search for places in the code where the data could be passed from and found some promising lines in the Scene_Battle script.

Mostly the lines that have something to do with the log window.

However, as I'm inexperienced in both ruby and the RpgMaker I haven't been able to pinpoint an exact place where the data is passed. (line 497 looked most promising)

Am I searching in the right direction here?

On a related note: If you define a function that is already defined. How will RpgMaker handle that situation?

Will it just use the last given definition?

( I have seen people do something like this in example scripts, but I'd like conformation if possible before i try it myself)

If so, this would be helpful when making changes to the behavior of the game without changing the original script files.

And again, thanks in advance for anyone willing to help.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
That said, I have no experience with ruby in particular and I only just recently started with RpgMaker.
The text formatting used in the vocabs is not specific to Ruby, it's used in a lot of languages.
The following link goes to an explanation of it in the Delphi language, but you can find similiar descriptions for other languages as well - there are only minor differences between the languages:


http://www.delphibasics.co.uk/RTL.asp?Name=Format


What happens when you define a function with an existing name depends on how you define it.


Usually, it overrides all older functions with the same name, but you can create an alias to append to the older function as well.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
In this case, it's not a matter of changing the message. It's a matter of making a NEW message in vocab, and finding when the original would have been displayed, and determining whether you WANT the original to be displayed or the new one, and making it happen. I imagine there WILL be some occasions where the [enemy] took no damage is still a perfectly valid notification.
 

Synapsiz

Villager
Member
Joined
Jun 16, 2014
Messages
9
Reaction score
0
First Language
Dutch
Primarily Uses
Again thank you Andar and Shaz

I have not yet managed to change the message successfully but thanks to you both I am a lot closer now.

Appart from the link posted by Andar I also found an entry in the VXACE help file describing this syntax.

And changing what message is called should be doable from the Game_ActionResult script.

I feel that if i take some more time reading over those help files and trying to understand what is happening in the script I should be able to get the result I want.

Unless someone else has something to add I consider my question answered,

Thanks for the help!
 

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,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top