Calling no. of enemy troops in region/map

aprilodee

Warper
Member
Joined
Aug 13, 2019
Messages
2
Reaction score
0
First Language
English (UK)
Primarily Uses
RMMV
Sorry in advance if I can't see the wood for the trees.

Broad view: Generic 'please clear map of enemies to advance game' quest

First idea: Use conditional branching event to check for live enemy troops and then turn on switch which acts as success state when none are present.

Thing I need: Is there a script call for number/presence of enemy troops which are/are not KO in a map or region?

If no call exists, can I do the equivalent of creating a var 'n' which inc. by 1 every time an enemy troop is KO, and have the conditional branch check for var = n to trigger the switch?

Any and all advice welcomed.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,251
Reaction score
7,138
First Language
German
Primarily Uses
RMMV
wrong assumptions, you need to build your logic from the other end.

1) I'm assuming you have events pretending to be enemies, because random enemies are unlimited.
2) if that is the case, you need to use the branches of the battle processing command: if win then control variable (counting wins on map) +1
3) you as the developer knows how many enemy events you placed on the map, so your conditional branch checks if the variable is lower than that number or not.
 

aprilodee

Warper
Member
Joined
Aug 13, 2019
Messages
2
Reaction score
0
First Language
English (UK)
Primarily Uses
RMMV
wrong assumptions, you need to build your logic from the other end.

1) I'm assuming you have events pretending to be enemies, because random enemies are unlimited.
2) if that is the case, you need to use the branches of the battle processing command: if win then control variable (counting wins on map) +1
3) you as the developer knows how many enemy events you placed on the map, so your conditional branch checks if the variable is lower than that number or not.
Yep, events as enemies, no random encounters.
Perfect.
Thank you for your quick succinct help.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Is it strange that dropping acid is improving my game development?
I'm starting to wonder if I should go the Half Minute Hero route with my game. The character's main weapon is logistically way too strong. So I can't really let the player continuously grow it.... But if they had to build it up each time like HMH, that could work. Also it lets me take advantage of my randomly generated maps so much more. Hmm... This could work! :LZSexcite:
std::vector, std::map and std::string. Three reasons why I'd take C++ over C. :D
Today, 1,932 RPG Maker fans died from being too wow'ed. May they rest in peace.

Forum statistics

Threads
99,199
Messages
962,938
Members
130,779
Latest member
moge-mic
Top