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.

certain area battle script

i have stumbeled accross this battle script that allows you to create a certain area on the map which you can active certain trooops that youu decide to attack. the person i found  this script off isnt the guy who made it soo, he gives you 2 rectangles as a base which looks like this

rect1 = [82, 62, 95, 82]   
rect2 = [43, 44, 76, 61]

area_rects = [rect1, rect2]

and the call i am using is this

@>control variable: [0001] = 0
@>Script: if $scene.is_a?(Scene_Map)
:        : $scene.get_world_map_area_id
:        : end
@>conditional branch: Variable [00001] ==0
@>Script :$game_map.enum_encounter_list = []
@>
: Branch end
@>Conditional branch: Variable [0001] ==0
@>Script: $game_map.enum_encounter_list = [4,5]
@>
: Branch end
@>Conditional Branch: Variable [0001] ==1
@>Script: $game_map.enum_encounter_list =
[1,2,38]
@>
:Branch end

and it works perfectly i get troops 4 and 5 in the first rectangle and 1,2, and 38 in the secoond one....

this is where it messes me up when i add a third rect into the script it now reads

rect1 = [82, 62, 95, 82]   
    rect2 = [43, 44, 76, 61] 
    rect3 = [43, 29, 55, 42]
   
    area_rects = [rect1, rect2, rect3]

but i am not sure on what the call should now be, i assumed i put in another cond branch but the varialbes i add i am unsure of or what the hell i am doing here..
also what should i do if i want to be adding more rect's maby upto another 50 of them, there for the world map

if anyone understands what i just said plz help.

many thanks in advance xoxox
 
Nope, i set trooop id 7 and 8 to
@>Conditional Branch: Variable [0001] ==2

and now im getting troop 7,8 in all of the areas instead of just the 1

any ideas?

im trying to find the guy who made it but it was first posted a few years back apparently so no luck there :(
 

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