For a game I'm making a custom battle system. I have NPCs which represent enemy encounters. When I touch an NPC I want a menu to be triggered which says "Enemy# Attacks" (where "Enemy#" is a string dependent on whichever NPC has touched the hero).
How can I feed in a string which is the name of whatever NPC is attacking me? As far as I understand I have to define all my enemies in my script as strings. Is there any way I can use just a single menu to do this? I obviously don't want to make menus for every single enemy. I'd rather have one menu and that runs some sort of script to check what NPC has engaged you, what that enemy's name is and what stats it has so that they can be used in a probability equation.
Even better, if someone could tell me of a way to define all my enemies using the CUSTOM engine's "Enemies" section then feed that enemies name as a string in to the menu and get it's stats to be used in the battle script.
String Question
Moderators: marionline, SDHawk
- sheamkennedy
- Liquid Metal Slime
- Posts: 1110
- Joined: Mon Sep 16, 2013 9:29 pm
- Location: Tama-shi, Tokyo, Japan
- Contact:
String Question
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
â� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
â� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Get Enemy Name can help you with a lot of that and Get Enemy Stat can help with the rest. You can use FormationSlotEnemy to streamline that even farther. All your NPC would have to do is pass on what formation to fight and the script can get what enemy it is, all the stats, and the name just like that. With some for loops it could even work for multiple enemy formations.
But you can't set the NPC extra data in the editor, which probably means it's not useful to you. However, you can set an argument to pass to a script triggered from an NPC. This is the easiest way to go: just pass the enemy ID to the script, which then reads the data from the enemy. The "Script argument" is passed as the first argument.
Also, if you aren't using the builtin formations there's not much point using them either.
I'm confused that you keep talking about menus. Why a menu rather than a textbox or text slice? I guess there will be options like running away from the enemy.
Also, if you aren't using the builtin formations there's not much point using them either.
I'm confused that you keep talking about menus. Why a menu rather than a textbox or text slice? I guess there will be options like running away from the enemy.