The RPG Maker Resource Kit

Other Game Creation => Game Creation General Chat => Topic started by: dark12345 on April 11, 2006, 11:05:55 PM

Title: a level block event?
Post by: dark12345 on April 11, 2006, 11:05:55 PM
hi , im my game i have diffrent areas coming off one town, though there noway knowing the level on the mobs in that area (unless u read teh sign which some people wont) are strong or weak, what i want to do is block u from going to that area if your, say under lvl 20...please help
Title: Re: a level block event?
Post by: Blizzard on April 12, 2006, 12:19:19 AM
Use on the teleport event a conditional branch and choose "average party level" as a condition. If it
Title: Re: a level block event?
Post by: dark12345 on April 12, 2006, 08:23:49 PM
erm it dont work like that.. knew craditional branchs and all that, but when i tried it enyway the party section dosent have a level limit
Title: Re: a level block event?
Post by: Blizzard on April 12, 2006, 08:46:52 PM
Damn, you
Title: Re: a level block event?
Post by: Anaryu on April 14, 2006, 10:33:43 PM
The other way would be to make a "Script..." event and paste this into it:

i = 0
average_level = 0
while $game_party.actors != nil
  temp = $game_party.actors.level
  average_level += temp
  i += 1
end
$game_variables[var_num] = average_level / i


Where the "var_num" is the number of the Variable you want to have that value. So if you wanted the average party level to go into variable #20, change var_num to 20 so it reads:
$game_variables[20] = average_level / i

You can add a script event on the last of the event pages.

I'd have fit a few of those lines together, but the script box doesn't let you put long lines in, and breaks the code apart when you put long ones in, causing either errors or VERY weird effects. :)

That script will put the average level of all current party members (only those in your party) into a variable which you can use. It's a bit less work than writing up a ton of cond. branches, especially if you have a lot of different characters in your game. It also grows, so that if you add more characters you won't need to update it.