Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[XP]Changing the encounter rate & puzzle problem

Acera

Sponsor

I'm currently rather 'stuck' on a part in my dungeons. I've been thinking about how to balance the game out and the easiest (and most efficient (sp?)) way of doing it seemed to me to control the amount of encounters you can get in a certain area.

So here's the idea; You encounter a certain amount of monsters, lets say (for the sake of simplicity) that i only want to allow you to encounter 4 monsters. Each time you kill one your 'invulnerability' goes up by 25%, so after 4 encounters you will be 'immune' to monster attacks.

I've tried going into the database and adding a condition to a certain monster; 'Enemy [1. Ghost]'s HP 0% or below', and then on the event page 'Control Variables: [0999:Dungeon 1 - encounters] += 1'. Now I was going to put events in each map which checks if you are immune to encounters or not (conditional branches where they check if the variable is a certain number, 4 in this case). But the problem is that the variable doesn't update.

Does anyone know if it's possible to even do this, via eventing or scripting?
Thanks in advance,


EDIT(Fixed):
Anyways I have another question, and I don't want to spam up the whole forum with my questions so I'll add it here;

I've made a small 'puzzle' (if you can even call it that), where you need to press the torches in the correct order. Here are the event pages:

http://i29.photobucket.com/albums/c260/Killer620/page1.png[/img]
http://i29.photobucket.com/albums/c260/Killer620/page2.png[/img]

The other 3 torches look exactly the same, although the numbers at D1- mem change from 1 to 4 (from left to right).
Whenever I finish the puzzle but get the wrong answer (lets say, 1234 for simplicity) all the torches have to reset. But for some strange reason only the second one resets.

and no, that's not the finished map, don't even think about it  :dead:
http://i29.photobucket.com/albums/c260/ ... 1flame.png[/img]

I've tried changing the self switches to a, b, c and d, but that didn't change anything. I also tried other sequences of events but the result was the same.

~Acera
 
If the problem is the variable not updating specifically, you might consider double-checking that the event is set to add one, instead of setting it to one.  (It's easy to make this mistake because of the default settings.)

Failing that, you could always set the variable to increase at the start of the fight.

(Edit)

Whoops!  I forgot the basic part-- assuming that the map has a parallel process event going that turns random encounters off when the variable gets high enough.  Can't decrease the probability without a script, as far as I can tell. 

You could also do this weird, convoluted thing with, say, four copies of the same map with different encounter frequencies, and do a no-fade transfer between maps when the variable gets high enough.  It would probably work with enough work, but it would be a lot of trouble.
 
Well, it's a long way around requiring a script, but you could use parallel events to generate random battles.  Randomize a variable, and based on that variable, determine whether or not an encounter occurs.  Then you could increase the variable after the battle and use an outer condition branch which stops all battles after it reaches a certain point.

Or, I was going to create a system tutorial where the monsters see you and run towards you.  This allows you to set the number of fights in a room, too.  I'm not sure when I'll get around to the tutorial.  I won't be able to do it tonight (Saturday), but I'll probably do it tomorrow.
 

Acera

Sponsor

@Unka +=1 means adding one, if i was setting it to one it would be =1. I also thought of trying to put it in at the beginning of the fight but that brings up another problem. If the player runs away he would get 'credit' for killing it. If he would repeat this he would be severely underleveled once he must meet the next boss.

@Guardian visible mobs are another way to go, but I'd prefer to make them invisible (since you can evade the monsters quite easily and putting the monster speed higher looks rather strange). Although this is currently the best option if I can't get it my way.

Anyways I have another question, and I don't want to spam up the whole forum with my questions so I'll add it here;

I've made a small 'puzzle' (if you can even call it that), where you need to press the torches in the correct order. Here are the event pages:

http://i29.photobucket.com/albums/c260/Killer620/page1.png[/img]
http://i29.photobucket.com/albums/c260/Killer620/page2.png[/img]

The other 3 torches look exactly the same, although the numbers at D1- mem change from 1 to 4 (from left to right).
Whenever I finish the puzzle but get the wrong answer (lets say, 1234 for simplicity) all the torches have to reset. But for some strange reason only the second one resets.

http://i29.photobucket.com/albums/c260/Killer620/1flame.png[/img]

I've tried changing the self switches to a, b, c and d, but that didn't change anything. I also tried other sequences of events but the result was the same.

~Acera
 
Why are you using such large numbers?  Can't you just use 1-16 instead of up to 3,421?  Anyway, you've be better of using a switch or switches so that you can turn them all off with one event instead of each event trying to turn its self switch off.  I'm not sure what the problem with it is, though, because the event looks fine to me.
 

Acera

Sponsor

if you look at the screenshot, i'm checking the order in which they're pressed, first one is 3, then i multiply with 10 = 30, then i add the second number to that, 4 in this case. This'll make 34, next number is 2 so I multiply again with 10 and add 2, multiply with 10 and add one and you got 3421, the correct order in which they should be pressed.

Anyways, giving them all a different (normal) event and then (batch)switching them off seems to work, thanks =)

I'm also going for a different approach for the monsters, but I need to know if there's a way to switch off the encounter rate (the one you can set at the map properties) with a script.

I'll let every monster drop an unique item (100% drop chance) and then let an event on that map check if you have a certain amount of them, but switching off the encounters with the even will switch it off on every map. So now my question is, is there a RGSS command which allows me to turn off the encounter rate on each map? (or allow me to delete the mobs you can encounter on the map)

Thanks in advance
 
Well, with a script, you could do the following:

#Check whether a variable is a certain number (like you were trying to do)
  #If true, stop random encounters (probably something like encounter=false)
  #If false, random encounters aren't altered

#When you win a battle, increase the variable

#When executing a transfer, reset the variable

I'm not a scripter, but I'm trying to learn, and I know you can do all of that with scripts.  You can do everything except change the random encounters with events, but a script would make it easier.

Or, if you wanted, you could create 2 maps.  One with encounters, one without.  You'd just need If Variable=4 then transfer.  You'd need switches to link the two, as well, so a script would probably be easier and smoother.
 

Acera

Sponsor

Code:
$game_player.encounter_count == 0

this is a line in the Scene_map, when i try it (changing == to = -> $game_player.encounter_count = 0 ) it gives me an error.

That's basically all I need to know for now, but the only thing i've managed to do in my scripting career is fizzle around a bit with the menu and making some small edits.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top