RPG in a Box

RPG in a Box

View Stats:
Sprites and stats.
When using sprites for enemies, there doesn't seem to be a way to adjust their stats. The stats exist, but we can't access them in the UI.

Is there a work-around?

Edit: I removed the answer because I need more information to make this work. Sorry.

I left a follow-up post below.
Last edited by Lioness 西施; Nov 19, 2024 @ 12:54am
< >
Showing 1-6 of 6 comments
Stumpy the Squirrel  [developer] Nov 16, 2024 @ 6:45pm 
Hello! As a workaround until the settings are added to the UI for sprite-based models, you can set them via script based on the context of how the enemy is being used (e.g. in the pre-load script for a real-time enemy, in the pre-battle script for turn-based enemies, in the spawn script for spawned enemies, etc.).

For example:
entity["enemy_id"].stat["hp"] = 100;
Last edited by Stumpy the Squirrel; Nov 26, 2024 @ 12:41pm
Lioness 西施 Nov 16, 2024 @ 6:50pm 
Thank you very much!
Stumpy the Squirrel  [developer] Nov 16, 2024 @ 6:56pm 
Originally posted by Lioness 西施:
Thank you very much!

You're very welcome!
Lioness 西施 Nov 16, 2024 @ 8:23pm 
Sorry about this, but I need you again.

"Enemy" isn't recognized. "Entity" is, but that code won't change its HP.

It seems everything is classified as "entities"?

Let me explain what I'm doing:

I created a character called "Demon1" as a test.

I placed that character on the map and gave it the entity ID "demon1" (all lowercase).

entity["demon1"].stat["hp"] = 100; doesn't work.
entity["Demon1"].stat["hp"] = 100; also doesn't work.

What am I missing?
Last edited by Lioness 西施; Nov 16, 2024 @ 8:24pm
Stumpy the Squirrel  [developer] Nov 26, 2024 @ 12:41pm 
Originally posted by Lioness 西施:
Sorry about this, but I need you again.

"Enemy" isn't recognized. "Entity" is, but that code won't change its HP.

It seems everything is classified as "entities"?

Let me explain what I'm doing:

I created a character called "Demon1" as a test.

I placed that character on the map and gave it the entity ID "demon1" (all lowercase).

entity["demon1"].stat["hp"] = 100; doesn't work.
entity["Demon1"].stat["hp"] = 100; also doesn't work.

What am I missing?

Apologies! Yes, it should be "entity" instead of "enemy". I've corrected the original post.

A character's HP can't exceed their current maximum HP, so you may need to modify the "max_hp" stat before setting the "hp" stat.
Sorry for the late reply.

Just wanted to say thank you, that works.

I swear I tried that before, but I must have gotten something wrong.

For anyone who wants to do this (and myself, because writing it down helps me commit it to memory):

Stats are assigned to a map entity, not a character.
If you create a character named "Enemy" and place it in the map with the Entity ID "Demon1," then "Demon1" is the name you use.

Example:
entity["Demon1"].stat["hp"]

Use "Assign Value" in the script editor.

The stat names should be the same as those listed under the "stats" tab.

You can do this via a script, placing it after the "Load Map" function.

One last thing: I would set max_hp before hp.
Last edited by Lioness 西施; Jan 4 @ 3:21am
< >
Showing 1-6 of 6 comments
Per page: 1530 50