Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
For example:
You're very welcome!
"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.
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:
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.