is there any way to create battle messages using variables/properties?

2 replies · 3865 views

battle formulabattle messagebattler propertiescharacter namecharacter properties

zayahx9 0 likes received

I am trying to create custom, modular battle messages using variable or properties, such as the player/character's name or possibly some stats like HP or statuses.

I've been trying to figure this out for a few days.

Example: "[character name] used [skill]." (really, I just want to be able to use character names in the battle messages for aesthetic purposes.)

I've gone thru the Battler, Player, and most likely every other file on the Github.

I've read thru some of the Github.io documentation files. Battler, player, character, and most others pertaining to the battle systems and characters.

The Gitbook documentation pages ALMOST have exactly what I'm looking for, but don't expand on other variables or properties and how to reach them from the battle message.

Now, I feel sort of silly for not knowing how to retrieve those variables, as I had taken Javascript classes as well as held a job as a web developer for some years, so I thought I should be able to figure this out.

For the list of things I have tried entering into the battle message to try and display the character name, I've tried many syntax. Every variation of the listed items have been either surrounded by nothing, by double quotes, by brackets, and by curvy brackets, parenthesis, single quotes, you name it.

ie: (u.name.it, "u.name," [u.name], {u.name})

I have tried the following inside of the Battle Message text box:

name

u.name

user.name

p.name

player.name

playername

c.name

character.name

gameplayer.name

battler.name

b.name

battler.gameplayer.name

battler.character.name

I noticed that some values do not translate like they do in the battle formulas, such as the "u.atk" stat not being recognized as a property either. Typing in [u.atk] or "u.atk" or any variation thereof results in the same text being displayed in the battle message, opposed to actually displaying the stat/property.

I guess I'm wondering if this is even possible? Is there any way to call upon properties of any object within the Battle Message?

battleMessage.png

itemSkill.png

Edited

Answers

Wano 38 likes received Admin

Try using [user]

In System/Skill you can see:

getMessage(user: Battler): string {

return this.battleMessage.name().replace('[user]', user.player.name)

.replace('[skill]', this.name());

}

zayahx9 0 likes received

@wano See here you go making me feel like a dingus. [user] worked!

I could have SWORN I tried [user] first. Thank you for the support!

Edited
Back to Questions