On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Any Plans For Fog Wars?

A topic by AzureWhitetail created 27 days ago Views: 114 Replies: 8
Viewing posts 1 to 2

I'm not sure if that's what it's typically called in TBS games, but basically, I'm hoping for a feature that allows enemies to be hidden until a unit with a large enough viewing range gets close enough to reveal them.

You can look at the Fog Wars in Advance Wars to see what I'm talking about, but a similar feature also exists in Battle for Wesnoth, and some of the Fire Emblem games.

Developer

Thanks for the suggestion, i'll take it into consideration when I get the chance

Awesome!

I do have one more question that isn't related to the topic, though. Is it possible to change variables in mid-battle, based off of number of enemies, number of allies, or turn count?

Developer

Yes, you can do so via events

(1 edit)

I hate to bother you over trivial things, but I've been trying to figure this out for two days, and nothing seems to be working....

I was able to get the total number of enemies and allies in battle by using

$gameMap._actors.length

and

$gameMap.enemies.length

through Control Variables, but I can't, for the life of me, figure out a script call that makes the Variable only track remaining allies/enemies (In other words, actors/enemies that doesn't have the Knockout status).  Is it possible to do this with this battle system? Or at the very least, is it possible to remove all dead Actors/Enemies from battle?

Developer

Enemy count can be gotten from $gameMap._enemies.length

To set a variable using script call, the code is $gameVariables.setValue(id, value) where id is the variable ID and value is the value to set it to.

eg: $gameVariables.setValue(1, $gameMap._enemies.length) will set the variable 1 to the total number of enemies.

To get the total number of living enemies, you need to filter the array:

$gameMap._enemies.filter(map_enemy => !!map_enemy._battler.isAlive()).length will give the number of enemies that are alive

(+1)

Oh, I see! All this time, I was doing script calls through Control Variables. It didn't occur to me that using a normal script call would be the answer to my problem. Thanks for the advice!

Developer

You should be able to use a script as well.

Oh, didn't know I could put all those characters in a single line through Control Variables. Sorry about that, my scripting knowledge isn't all that great.