is there any way to...
 
Notifications
Clear all

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

2 Posts
2 Users
0 Reactions
15 Views
0
Topic starter
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?

 

This topic was modified 2 days ago 2 times by zayahx9
1 Answer
0

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 Topic starter 12/06/2025 3:27 pm
This post was modified 19 hours ago by zayahx9

@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!

Share: