Battle dome script help (more help needed)

Started by nathmatt, February 11, 2009, 09:16:39 am

Previous topic - Next topic

nathmatt

February 11, 2009, 09:16:39 am Last Edit: April 05, 2009, 03:33:53 pm by nathmatt
this is going to be a big update to my evented addon to blizz's Abs http://forum.chaos-project.com/index.php?topic=2194.0

so just want some1 to help some to get me started dont write it for me because i would like to learn to do it myself

so first im starting with the transfer of the player so heres what i have so far just started it

Spoiler: ShowHide
Quoteclass Scene_Battle5

  case $game_map
  when 1-9
      $game_map.setup(6)
      $game_player.moveto(9, 5)
      $game_temp.player_new_direction = [2]
      $scene = Scene_Map.new
     end
    end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Blizzard

class Scene_Map

  def call_battle
    case $game_map.map_id
    when 1..9
      $game_temp.transferring = true
      $game_temp.player_new_map_id = 6
     $game_temp.player_new_x = 9
     $game_temp.player_new_y = 5
     $game_temp.player_new_direction = 2
   end
  end
 
end


You'll probably also want to it set up so it remembers the current map and coordinates so the player can return after winning the battle.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

nathmatt

February 11, 2009, 11:03:10 am #2 Last Edit: February 11, 2009, 11:08:02 am by nathmatt
k thx i will try that yea will ad that when i get closer










u typoed its
$game_temp.player_transferring = true

not
$game_temp.transferring = true

but it worked
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


nathmatt

ok i gave ran into another problem here what i have
Spoiler: ShowHide
class Scene_Map

  def call_battle1
    $game_variables [3] = $game_map.map_id
    $game_variables [1] = $game_player.x
    $game_variables [2] = $game_player.y
    case $game_map.map_id
    when 1..9
      $game_temp.player_transferring = true
      $game_temp.player_new_map_id = 6
      $game_temp.player_new_x = 9
      $game_temp.player_new_y = 5
      $game_temp.player_new_direction = 2
    end
  end
   if $game_variables [4] = 3
    $game_system.me_play($game_system.battle_end_me)
    window_result.new
    exp += $game_variables[9]
    gold += $game_variables[8]
    $game_variables [4] = 0
    $game_variables [9] = 0
    $game_variables [8] = 0
    $game_temp.player_transferring = true
    $game_temp.player_new_map_id = $game_variables [3]
    $game_temp.player_new_x = $game_variables [1]
    $game_temp.player_new_y = $game_variables [2]
    $game_temp.player_new_direction = [2]
    $game_system.bgm_play($game_temp.map_bgm)
 
  end
end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Blizzard

There are many things that are wrong, one of the being that the if branch is outside of the call_battle1 method. #_#
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

nathmatt

thx that helped some i will continue working on it
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


nathmatt

the condiont is running whether the variable is 3 or not

Spoiler: ShowHide
class Scene_Map

  def call_battle1
    $game_variables [3] = $game_map.map_id
    $game_variables [1] = $game_player.x
    $game_variables [2] = $game_player.y
    case $game_map.map_id
    when 1..9
      $game_temp.player_transferring = true
      $game_temp.player_new_map_id = 6
      $game_temp.player_new_x = 9
      $game_temp.player_new_y = 5
      $game_temp.player_new_direction = 2
    end
  if $game_variables [4] = 3
    $game_system.me_play($game_system.battle_end_me)
    $game_variables [4] = 0
    $game_variables [9] = 0
    $game_variables [8] = 0
    $game_temp.player_transferring = true
    $game_temp.player_new_map_id = $game_variables [3]
    $game_temp.player_new_x = $game_variables [1]
    $game_temp.player_new_y = $game_variables [2]
    $game_temp.player_new_direction = [2]
    $game_system.bgm_play($game_temp.map_bgm)
 
  end
end
end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Blizzard

= is for value assignment of variables. == is for comparison. ;)
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

nathmatt

i fixed that now the variable is 3 but its not activating
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Blizzard

I meant that it should be

  if $game_variables [4] == 3


not

  if $game_variables [4] = 3
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

nathmatt

February 12, 2009, 12:10:37 pm #10 Last Edit: February 12, 2009, 12:12:24 pm by nathmatt
i know i did that but the code isnt executing when the variable hits 3


could it be beacause its not constantly checking the variable ?
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Blizzard

Yes. It only checks the variable when you are supposed to enter battle. If you want it to be constantly checked, put it into Scene_Map#update.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


nathmatt

now just need to find a couple of scriptlets the wait command creating & storing a random number in a variable & gaining exp gold items weapons & armor through a variable
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


nathmatt

February 14, 2009, 11:52:02 am #14 Last Edit: February 14, 2009, 11:54:45 am by nathmatt
ok i got the random number the only problem is that the change name thing does not work in script i think it might be because does not know what map to be on i think im going to do the completion part with an event to make it easyer
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


nathmatt

February 14, 2009, 01:39:11 pm #15 Last Edit: April 05, 2009, 03:34:30 pm by nathmatt
k haveing trouble with the change event name

Spoiler: ShowHide
class Scene_Map

  def call_battle1
    $game_variables [3] = $game_map.map_id
    $game_variables [1] = $game_player.x
    $game_variables [2] = $game_player.y
    $game_variables [5] = rand(2) # 1st enemy
    $game_variables [6] = rand(2) # 2nd Enemy
    $game_variables [7] = rand(2) # 3rd enemy
   case $game_map.map_id
    when 1..9
      $game_temp.player_transferring = true
      $game_temp.player_new_map_id = 6
      $game_temp.player_new_x = 9
      $game_temp.player_new_y = 5
      $game_temp.player_new_direction = 2
    end
   case $game_variables [5]
   when 0
   $game_map.rename_event(01, '\\e[1]')
   when 1
   $game_map.rename_event(01, '\\e[2]')
   end
   case $game_variables [6]
   when 0
   $game_map.rename_event(02, '\\e[1]')
   when 1
   $game_map.rename_event(02, '\\e[2]')
   end
   case $game_variables [7]
   when 0
   $game_map.rename_event(03, '\\e[1]')
   when 1
   $game_map.rename_event(03, '\\e[2]')
   end
  end
end
   
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Aqua

There's no space between $game_variables and the


  • So it should be
    $game_variables[3]

nathmatt

February 14, 2009, 04:52:02 pm #17 Last Edit: April 05, 2009, 03:35:04 pm by nathmatt
the space dosent matter still works


edit
Spoiler: ShowHide
if $game_variables [4] == 3
    $game_system.me_play($game_system.battle_end_me)
    Window_Result.new
    $game_switches [1] = true
    $game_variables [4] = 0
    $game_variables [9] = 0
    $game_variables [8] = 0
    $game_variables [15] = 0
    $game_temp.player_transferring = true
    $game_temp.player_new_map_id = $game_variables [3]
    $game_temp.player_new_x = $game_variables [1]
    $game_temp.player_new_y = $game_variables [2]
    $game_temp.player_new_direction = [2]
    $game_system.bgm_play($game_temp.map_bgm)
  end
  if $game_variables [15] == 20
    $game_variables [50] = $game_map.map_id
    case $game_variables [5]
    when 0
    $game_map.rename_event(01, '\e[1]')
    when 1
    $game_map.rename_event(01, '\e[2]')
    end
    case $game_variables [6]
    when 0
    $game_map.rename_event(02, '\e[1]')
    when 1
    $game_map.rename_event(02, '\e[2]')
    end
    case $game_variables [7]
    when 0
    $game_map.rename_event(03, '\e[1]')
    when 1
    $game_map.rename_event(03, '\e[2]')
   end
   $game_variables [15] += 1
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


nathmatt

February 15, 2009, 07:05:35 pm #18 Last Edit: February 20, 2009, 06:34:39 pm by nathmatt
putting this here so i will have a fresh copy if i mess it up will trying to make it better

adding resolved here so ppl can see this script & can use it as is if they want
first 1
Spoiler: ShowHide
Quoteclass Scene_Map
 
    def call_battle1
    $game_variables [3] = $game_map.map_id
    $game_variables [1] = $game_player.x
    $game_variables [2] = $game_player.y
    $game_system.menu_disabled = true
    if $game_system.caterpillar != true
       $game_system.caterpillar = true
      end
     
   
    case $game_variables [12]
    when 1
      $game_variables [5] = rand(2) + 5 # 1st enemy
      $game_variables [6] = rand(2) + 5 # 2nd Enemy
      $game_variables [7] = rand(2) + 5 # 3rd enemy
      $game_temp.player_transferring = true
      $game_temp.player_new_map_id = 2
      $game_temp.player_new_x = 9
      $game_temp.player_new_y = 5
      $game_temp.player_new_direction = 2
      when 2
      $game_variables [5] = rand(2) + 5 # 1st enemy
      $game_variables [6] = rand(2) + 5 # 2nd Enemy
      $game_variables [7] = rand(2) + 5 # 3rd enemy
      $game_temp.player_transferring = true
      $game_temp.player_new_map_id = 3
      $game_temp.player_new_x = 9
      $game_temp.player_new_y = 9
      $game_temp.player_new_direction = 2
    end
end
end
    def call_update_script
    call_map1
    call_map2
    check_terrain
    end
 
    def call_map1
      if  $game_map.map_id == 2
      if  $game_variables [11] == 0..20
     enemy1
     enemy2
     enemy3
   end
   $game_variables [11] += 1
end
if  $game_map.map_id == 3
      if  $game_variables [11] == 0..20
     enemy1
     enemy2
     enemy3
   end
   $game_variables [11] += 1
end
end

  def call_map2
  if $game_variables [4] == 3
    $game_system.me_play($game_system.battle_end_me)
    $game_system.hud = false
    Window_Result.new
    call_wait
  end
end

def call_wait
   if $game_variables [10] == 40
     call_get
    $game_variables [10] = 0
    $game_variables [11] = 0
    $game_variables [4] = 0
    $game_variables [9] = 0
    $game_variables [8] = 0
    $game_temp.player_transferring = true
    $game_temp.player_new_map_id = $game_variables [3]
    $game_temp.player_new_x = $game_variables [1]
    $game_temp.player_new_y = $game_variables [2]
    $game_temp.player_new_direction = 2
    $game_system.bgm_play($game_temp.map_bgm)
    $game_system.hud = true
    $game_system.menu_disabled = false
    if $game_switches [1] == true
    $game_system.caterpillar = false
    end
  else
  $game_variables [10] +=1
  end
end
  def call_get
    exp = 0
    gold = 0
    exp += $game_variables[9]
    gold += $game_variables[8]
    for i in 0...$game_party.actors.size
      actor = $game_party.actors
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
    end
  end
    $game_party.gain_gold(gold)
  end
  def check_terrain
    character = $game_player
    $game_variables [12] = character.terrain_tag
  end


secound 1
Spoiler: ShowHide
class Scene_Map
 
def enemy1
case $game_variables [5]
  when 0 then enemy1 = $game_map.rename_event(01, '\e[1]')
  when 1 then enemy1 = $game_map.rename_event(01, '\e[2]')
  when 2 then enemy1 = $game_map.rename_event(01, '\e[3]')
  when 3 then enemy1 = $game_map.rename_event(01, '\e[4]')
  when 4 then enemy1 = $game_map.rename_event(01, '\e[5]')
  when 5 then enemy1 = $game_map.rename_event(01, '\e[6]')
  when 6 then enemy1 = $game_map.rename_event(01, '\e[7]')
  when 7 then enemy1 = $game_map.rename_event(01, '\e[8]')
  when 8 then enemy1 = $game_map.rename_event(01, '\e[9]')
  when 9 then enemy1 = $game_map.rename_event(01, '\e[10]')
  when 10 then enemy1 = $game_map.rename_event(01, '\e[11]')
  when 11 then enemy1 = $game_map.rename_event(01, '\e[12]')
  when 12 then enemy1 = $game_map.rename_event(01, '\e[13]')
  when 13 then enemy1 = $game_map.rename_event(01, '\e[12]')
  when 14 then enemy1 = $game_map.rename_event(01, '\e[13]')
  when 15 then enemy1 = $game_map.rename_event(01, '\e[14]')
  when 16 then enemy1 = $game_map.rename_event(01, '\e[15]')
  when 17 then enemy1 = $game_map.rename_event(01, '\e[16]')
  when 16 then enemy1 = $game_map.rename_event(01, '\e[15]')
  when 17 then enemy1 = $game_map.rename_event(01, '\e[18]')
  when 18 then enemy1 = $game_map.rename_event(01, '\e[19]')
  when 19 then enemy1 = $game_map.rename_event(01, '\e[20]')
  when 20 then enemy1 = $game_map.rename_event(01, '\e[21]')
  when 21 then enemy1 = $game_map.rename_event(01, '\e[22]')
  when 22 then enemy1 = $game_map.rename_event(01, '\e[23]')
  when 23 then enemy1 = $game_map.rename_event(01, '\e[24]')
  when 24 then enemy1 = $game_map.rename_event(01, '\e[25]')
  when 25 then enemy1 = $game_map.rename_event(01, '\e[26]')
  when 26 then enemy1 = $game_map.rename_event(01, '\e[27]')
  when 27 then enemy1 = $game_map.rename_event(01, '\e[28]')
  when 28 then enemy1 = $game_map.rename_event(01, '\e[29]')
  when 29 then enemy1 = $game_map.rename_event(01, '\e[30]')
  when 30 then enemy1 = $game_map.rename_event(01, '\e[31]')
  when 31 then enemy1 = $game_map.rename_event(01, '\e[32]')
  when 32 then enemy1 = $game_map.rename_event(01, '\e[33]')
  when 33 then enemy1 = $game_map.rename_event(01, '\e[34]')
  when 34 then enemy1 = $game_map.rename_event(01, '\e[35]')
  when 35 then enemy1 = $game_map.rename_event(01, '\e[36]')
  when 36 then enemy1 = $game_map.rename_event(01, '\e[37]')
  when 37 then enemy1 = $game_map.rename_event(01, '\e[38]')
  when 38 then enemy1 = $game_map.rename_event(01, '\e[39]')
  when 39 then enemy1 = $game_map.rename_event(01, '\e[40]')
  when 40 then enemy1 = $game_map.rename_event(01, '\e[41]')
  when 41 then enemy1 = $game_map.rename_event(01, '\e[42]')
  when 42 then enemy1 = $game_map.rename_event(01, '\e[43]')
  when 43 then enemy1 = $game_map.rename_event(01, '\e[44]')
  when 44 then enemy1 = $game_map.rename_event(01, '\e[45]')
  when 45 then enemy1 = $game_map.rename_event(01, '\e[46]')
  when 46 then enemy1 = $game_map.rename_event(01, '\e[47]')
  when 47 then enemy1 = $game_map.rename_event(01, '\e[48]')
  when 48 then enemy1 = $game_map.rename_event(01, '\e[49]')
  when 49 then enemy1 = $game_map.rename_event(01, '\e[50]')
     
  end
  def enemy2
  case $game_variables [6]
  when 0 then enemy2 = $game_map.rename_event(02, '\e[1]')
  when 1 then enemy2 = $game_map.rename_event(02, '\e[2]')
  when 2 then enemy2 = $game_map.rename_event(02, '\e[3]')
  when 3 then enemy2 = $game_map.rename_event(02, '\e[4]')
  when 4 then enemy2 = $game_map.rename_event(02, '\e[5]')
  when 5 then enemy2 = $game_map.rename_event(02, '\e[6]')
  when 6 then enemy2 = $game_map.rename_event(02, '\e[7]')
  when 7 then enemy2 = $game_map.rename_event(02, '\e[8]')
  when 8 then enemy2 = $game_map.rename_event(02, '\e[9]')
  when 9 then enemy2 = $game_map.rename_event(02, '\e[10]')
  when 10 then enemy2 = $game_map.rename_event(02, '\e[11]')
  when 11 then enemy2 = $game_map.rename_event(02, '\e[12]')
  when 12 then enemy2 = $game_map.rename_event(02, '\e[13]')
  when 13 then enemy2 = $game_map.rename_event(02, '\e[12]')
  when 14 then enemy2 = $game_map.rename_event(02, '\e[13]')
  when 15 then enemy2 = $game_map.rename_event(02, '\e[14]')
  when 16 then enemy2 = $game_map.rename_event(02, '\e[15]')
  when 17 then enemy2 = $game_map.rename_event(02, '\e[16]')
  when 16 then enemy2 = $game_map.rename_event(02, '\e[15]')
  when 17 then enemy2 = $game_map.rename_event(02, '\e[18]')
  when 18 then enemy2 = $game_map.rename_event(02, '\e[19]')
  when 19 then enemy2 = $game_map.rename_event(02, '\e[20]')
  when 20 then enemy2 = $game_map.rename_event(02, '\e[21]')
  when 21 then enemy2 = $game_map.rename_event(02, '\e[22]')
  when 22 then enemy2 = $game_map.rename_event(02, '\e[23]')
  when 23 then enemy2 = $game_map.rename_event(02, '\e[24]')
  when 24 then enemy2 = $game_map.rename_event(02, '\e[25]')
  when 25 then enemy2 = $game_map.rename_event(02, '\e[26]')
  when 26 then enemy2 = $game_map.rename_event(02, '\e[27]')
  when 27 then enemy2 = $game_map.rename_event(02, '\e[28]')
  when 28 then enemy2 = $game_map.rename_event(02, '\e[29]')
  when 29 then enemy2 = $game_map.rename_event(02, '\e[30]')
  when 30 then enemy2 = $game_map.rename_event(02, '\e[31]')
  when 31 then enemy2 = $game_map.rename_event(02, '\e[32]')
  when 32 then enemy2 = $game_map.rename_event(02, '\e[33]')
  when 33 then enemy2 = $game_map.rename_event(02, '\e[34]')
  when 34 then enemy2 = $game_map.rename_event(02, '\e[35]')
  when 35 then enemy2 = $game_map.rename_event(02, '\e[36]')
  when 36 then enemy2 = $game_map.rename_event(02, '\e[37]')
  when 37 then enemy2 = $game_map.rename_event(02, '\e[38]')
  when 38 then enemy2 = $game_map.rename_event(02, '\e[39]')
  when 39 then enemy2 = $game_map.rename_event(02, '\e[40]')
  when 40 then enemy2 = $game_map.rename_event(02, '\e[41]')
  when 41 then enemy2 = $game_map.rename_event(02, '\e[42]')
  when 42 then enemy2 = $game_map.rename_event(02, '\e[43]')
  when 43 then enemy2 = $game_map.rename_event(02, '\e[44]')
  when 44 then enemy2 = $game_map.rename_event(02, '\e[45]')
  when 45 then enemy2 = $game_map.rename_event(02, '\e[46]')
  when 46 then enemy2 = $game_map.rename_event(02, '\e[47]')
  when 47 then enemy2 = $game_map.rename_event(02, '\e[48]')
  when 48 then enemy2 = $game_map.rename_event(02, '\e[49]')
  when 49 then enemy2 = $game_map.rename_event(02, '\e[50]')
  end
  def enemy3
  case $game_variables [7]
  when 0 then enemy3 = $game_map.rename_event(03, '\e[1]')
  when 1 then enemy3 = $game_map.rename_event(03, '\e[2]')
  when 2 then enemy3 = $game_map.rename_event(03, '\e[3]')
  when 3 then enemy3 = $game_map.rename_event(03, '\e[4]')
  when 4 then enemy3 = $game_map.rename_event(03, '\e[5]')
  when 5 then enemy3 = $game_map.rename_event(03, '\e[6]')
  when 6 then enemy3 = $game_map.rename_event(03, '\e[7]')
  when 7 then enemy3 = $game_map.rename_event(03, '\e[8]')
  when 8 then enemy3 = $game_map.rename_event(03, '\e[9]')
  when 9 then enemy3 = $game_map.rename_event(03, '\e[10]')
  when 10 then enemy3 = $game_map.rename_event(03, '\e[11]')
  when 11 then enemy3 = $game_map.rename_event(03, '\e[12]')
  when 12 then enemy3 = $game_map.rename_event(03, '\e[13]')
  when 13 then enemy3 = $game_map.rename_event(03, '\e[12]')
  when 14 then enemy3 = $game_map.rename_event(03, '\e[13]')
  when 15 then enemy3 = $game_map.rename_event(03, '\e[14]')
  when 16 then enemy3 = $game_map.rename_event(03, '\e[15]')
  when 17 then enemy3 = $game_map.rename_event(03, '\e[16]')
  when 16 then enemy3 = $game_map.rename_event(03, '\e[15]')
  when 17 then enemy3 = $game_map.rename_event(03, '\e[18]')
  when 18 then enemy3 = $game_map.rename_event(03, '\e[19]')
  when 19 then enemy3 = $game_map.rename_event(03, '\e[20]')
  when 20 then enemy3 = $game_map.rename_event(03, '\e[21]')
  when 21 then enemy3 = $game_map.rename_event(03, '\e[22]')
  when 22 then enemy3 = $game_map.rename_event(03, '\e[23]')
  when 23 then enemy3 = $game_map.rename_event(03, '\e[24]')
  when 24 then enemy3 = $game_map.rename_event(03, '\e[25]')
  when 25 then enemy3 = $game_map.rename_event(03, '\e[26]')
  when 26 then enemy3 = $game_map.rename_event(03, '\e[27]')
  when 27 then enemy3 = $game_map.rename_event(03, '\e[28]')
  when 28 then enemy3 = $game_map.rename_event(03, '\e[29]')
  when 29 then enemy3 = $game_map.rename_event(03, '\e[30]')
  when 30 then enemy3 = $game_map.rename_event(03, '\e[31]')
  when 31 then enemy3 = $game_map.rename_event(03, '\e[32]')
  when 32 then enemy3 = $game_map.rename_event(03, '\e[33]')
  when 33 then enemy3 = $game_map.rename_event(03, '\e[34]')
  when 34 then enemy3 = $game_map.rename_event(03, '\e[35]')
  when 35 then enemy3 = $game_map.rename_event(03, '\e[36]')
  when 36 then enemy3 = $game_map.rename_event(03, '\e[37]')
  when 37 then enemy3 = $game_map.rename_event(03, '\e[38]')
  when 38 then enemy3 = $game_map.rename_event(03, '\e[39]')
  when 39 then enemy3 = $game_map.rename_event(03, '\e[40]')
  when 40 then enemy3 = $game_map.rename_event(03, '\e[41]')
  when 41 then enemy3 = $game_map.rename_event(03, '\e[42]')
  when 42 then enemy3 = $game_map.rename_event(03, '\e[43]')
  when 43 then enemy3 = $game_map.rename_event(03, '\e[44]')
  when 44 then enemy3 = $game_map.rename_event(03, '\e[45]')
  when 45 then enemy3 = $game_map.rename_event(03, '\e[46]')
  when 46 then enemy3 = $game_map.rename_event(03, '\e[47]')
  when 47 then enemy3 = $game_map.rename_event(03, '\e[48]')
  when 48 then enemy3 = $game_map.rename_event(03, '\e[49]')
  when 49 then enemy3 = $game_map.rename_event(03, '\e[50]')
    end
   end
  end
end 
end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


nathmatt

February 24, 2009, 05:38:11 pm #20 Last Edit: April 05, 2009, 03:36:31 pm by nathmatt
ok im trying to acces the terrain tags out of scene map tryed this $game_map.terrain_tag but it dosent work
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


G_G

April 05, 2009, 03:45:13 pm #22 Last Edit: April 05, 2009, 04:34:18 pm by game_guy
try
$game_player.terrain_tag

not sure if it'll work

Aqua

terrain_tag(x, y)


X and Y are the coordinates you wish to get the tag for.

nathmatt

i used this character = $game_player $variables7 = character.terrain_tag when i was in scene map but now im useing scene battle & wants be to def terrain_tag
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Aqua

Sorry... my bad

$scene_map.terrain_tag(x, y)


Sooo you'd have to store the player's x and y and put it there.

nathmatt

April 05, 2009, 07:07:06 pm #26 Last Edit: April 05, 2009, 07:10:37 pm by nathmatt
ok i have another question im tring use loop do but every time i do it locks up

heres my script

Spoiler: ShowHide
class Scene_Battle
   
  def main
    $game_temp.in_battle = true
    $game_temp.forcing_battler = nil
    @troop_id = $game_temp.battle_troop_id
    @character = $game_player
    @terrain_tag = Table.new(384)
    $game_variables [1] = @troop_id[0]
    $game_variables [2] = @troop_id[1]
    $game_variables [3] = @troop_id[2]
    @map_id = $game_map.map_id
    @player_x = $game_player.x
    @player_y = $game_player.y
    $game_system.menu_disabled = true
    $game_system.caterpillar = true
    @phase = 1
    loop do
      Graphics.update
      Input.update
      update1
      if $scene != self
        break
      end
    end
    $game_map.refresh
    end
  end
 
  def update1
    $game_system.update
    if @wait_count == nil
      @wait_count = 0
      return
    end
    if @wait_count > 0
      @wait_count -= 1
      return
    end
    if $game_map.map_id == 3
    case $terrain_t
    when 1
    teleport = [ 9, 9, 10, 2]
    when 2
    teleport = [ 8, 9, 6, 2]
    when 3
    teleport = [ 7, 9, 6, 2]
    return  teleport
  end
   if $game_map.map_id == 5
    case $terrain_t
    when 1
    teleport = [ 2, 8, 5, 2]
    when 2
    teleport = [ 2, 8, 5, 2]
    when 3
    teleport = [ 2, 8, 5, 2]
    return  teleport
  end
  if $game_map.map_id == 6
    case $terrain_t
    when 1
    teleport = [ 2, 8, 5, 2]
    when 2
    teleport = [ 2, 8, 5, 2]
    when 3
    teleport = [ 2, 8, 5, 2]
    return  teleport
    end
    case @phase
    when 1 
      update_phase1
    when 2 
      update_phase2
    when 3 
      update_phase3
    when 4 
      update_phase4
    end
  end
end

def update_phase1
$game_temp.player_transferring = true
$game_temp.player_new_map_id = teleport[0]
$game_temp.player_new_x = teleport[1]
$game_temp.player_new_y = teleport[2]
$game_temp.player_new_direction = teleport[3]
@phase = 2
end

def update_phase2
if $game_map.map_id !=  @map_id
   @wait_count = 40
   end
  if  @wait_count > 0
     enemy1
     enemy2
     enemy3
     @phase = 3
   end
   
def update_phase3
  if $game_variables [4]  == 3
    $game_system.me_play($game_system.battle_end_me)
    $game_system.hud = false
    $window =  Window_Result.new
    @wait_count = 40
  end
if @wait_count == 0
$window.dispose
    exp = $total1
    gold = $total2
    treasures = $total3
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
    $game_party.gain_gold(gold)
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    $total1 = 0
    $total2 = 0
    $total3 = 0
    $game_variables [4] = 0
    @phase = 4
  end
   
  def update_phase4
  $game_temp.player_transferring = true
    $game_temp.player_new_map_id = @map_id
    $game_temp.player_new_x = @player_x
    $game_temp.player_new_y = @player_y
    $game_temp.player_new_direction = 2
    $game_system.bgm_play($game_temp.map_bgm)
    $game_system.hud = true
    $game_system.menu_disabled = false
    if $game_switches [1] == true
    $game_system.caterpillar = false
     end
    end
   end   
  end
end
end
 
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Aqua

You need a way for the loop to end or else it'll keep on going forever and "lock up".

G_G

Quote from: Aqua on April 05, 2009, 06:58:53 pm
Sorry... my bad

$scene_map.terrain_tag(x, y)


Sooo you'd have to store the player's x and y and put it there.


Use this so you dont need to keep track of player x and y through variables
$scene_map.terrain_tag($game_player.x, $game_player.y)

nathmatt

my problem is i need it too keep looping forever while the battles going so when the battle ends i can leave the map or im stuck there btw the terrain thing didnt work because it wasnt rredefing the update method 
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Aqua

You know... you gotta assign it to something...

$terraintag = $scene_map.terrain_tag($game_player.x, $game_player.y)


Why not just flip a switch when the battles end.
Then if that switch is on, you'll leave the map and turn off the switch.

Blizzard

"character.terrain_tag" calls "$game_map.terrain_tag(character.x, character.y)". -_- You can just use "$game_player.terrain_tag".
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

nathmatt

April 07, 2009, 10:10:47 am #32 Last Edit: April 10, 2009, 12:22:58 pm by nathmatt
ok heres my script but its not working

Spoiler: ShowHide
lass Game_System
  attr_accessor :terrains
 
  alias gog_terrains_init initialize
  def initialize
    gog_terrains_init
    @terrains = {
      1 => [ 9, 8, 5, 2, 2, 0],
      2 => [ 8, 8, 5, 2, 2, 0],
      3 => [ 7, 8, 5, 2, 2, 0],
      4 => [ 2, 8, 5, 2, 2, 0],
      5 => [ 2, 8, 5, 2, 2, 0],
      6 => [ 2, 8, 5, 2, 2, 0],
      7 => [ 2, 8, 5, 2, 2, 0]
    }
  end
end

  class Scene_Map
   
  def call_battle
    $game_temp.battle_calling = false
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    $game_player.make_encounter_count
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    $game_system.se_play($data_system.battle_start_se)
    $game_system.bgm_play($game_system.battle_bgm)
    $game_player.straighten
    $game_temp.in_battle = true
    $game_temp.forcing_battler = nil
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    @map_id = $game_map.map_id
    @player_x = $game_player.x
    @player_y = $game_player.y
    @rand = teleport(4)
    @extra = teleport(5)
    $game_variables [1] = rand(@rand) + @extra # 1st enemy
    $game_variables [2] = rand(@rand) + @extra # 2nd Enemy
    $game_variables [3] = rand(@rand) + @extra  # 3rd enemy
    $game_system.menu_disabled = true
    $game_system.caterpillar = true
    @phase = 1
  end
 
   
   alias map_update update
  def update
    map_update
      @check_terrain
      @update_phase1
      @update_phase2
      @update_phase3
      @update_phase4
    end
    if @wait_count == nil
      @wait_count = 0
    elsif @wait_count > 0
      @wait_count -= 1
      return
    end
  end
 
  def check_terrain
    if $game_player.terrain_tag == 1
      teleport  = $game_system.terrains[1]
    elsif $game_player.terrain_tag == 2
      teleport  = $game_system.terrains[2]
    elsif $game_player.terrain_tag == 3
      teleport  = $game_system.terrains[3]
    elsif $game_player.terrain_tag == 4
      teleport  = $game_system.terrains[4]
    elsif $game_player.terrain_tag == 5
      teleport  = $game_system.terrains[5]
    elsif $game_player.terrain_tag == 6
      teleport  = $game_system.terrains[6]
    elsif $game_player.terrain_tag == 7
      teleport  = $game_system.terrains[7]
    end
  end
 
def update_phase1
$game_temp.player_transferring = true
$game_temp.player_new_map_id = teleport[0]
$game_temp.player_new_x = teleport[1]
$game_temp.player_new_y = teleport[2]
$game_temp.player_new_direction = teleport[3]
@phase = 2
end

def update_phase2
if @phase == 2 
if $game_map.map_id !=  @map_id
   @wait_count = 40
   end
  if  @wait_count > 0
     enemy1
     enemy2
     enemy3
     @phase = 3
   end
end
end
   
def update_phase3
  if @phase == 3 
  if $game_variables [4]  == 3
    $game_system.me_play($game_system.battle_end_me)
    $game_system.hud = false
    $window =  Window_Result.new
    @wait_count = 40
  end
if @wait_count == 0
$window.dispose
    exp = $total1
    gold = $total2
    treasures = $total3
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
    $game_party.gain_gold(gold)
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    $total1 = 0
    $total2 = 0
    $total3 = 0
    $game_variables [4] = 0
    @phase = 4
  end
end
end
   
  def update_phase4
    if @phase == 4
   $game_temp.player_transferring = true
    $game_temp.player_new_map_id = @map_id
    $game_temp.player_new_x = @player_x
    $game_temp.player_new_y = @player_y
    $game_temp.player_new_direction = 2
    $game_system.bgm_play($game_temp.map_bgm)
    $game_system.hud = true
    $game_system.menu_disabled = false
    if $game_switches [1] == true
    $game_system.caterpillar = false
    $game_temp.in_battle = false
     end
    end
   end   
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


nathmatt

April 10, 2009, 10:47:48 am #33 Last Edit: April 10, 2009, 12:25:14 pm by nathmatt
Quote from: nathmatt on April 07, 2009, 10:10:47 am
ok heres my script but its not working

Spoiler: ShowHide
lass Game_System
  attr_accessor :terrains
 
  alias gog_terrains_init initialize
  def initialize
    gog_terrains_init
    @terrains = {
      1 => [ 9, 8, 5, 2, 2, 0],
      2 => [ 8, 8, 5, 2, 2, 0],
      3 => [ 7, 8, 5, 2, 2, 0],
      4 => [ 2, 8, 5, 2, 2, 0],
      5 => [ 2, 8, 5, 2, 2, 0],
      6 => [ 2, 8, 5, 2, 2, 0],
      7 => [ 2, 8, 5, 2, 2, 0]
    }
  end
end

  class Scene_Map
   
  def call_battle
    $game_temp.battle_calling = false
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    $game_player.make_encounter_count
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    $game_system.se_play($data_system.battle_start_se)
    $game_system.bgm_play($game_system.battle_bgm)
    $game_player.straighten
    $game_temp.in_battle = true
    $game_temp.forcing_battler = nil
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    @map_id = $game_map.map_id
    @player_x = $game_player.x
    @player_y = $game_player.y
    @rand = teleport(4)
    @extra = teleport(5)
    $game_variables [1] = rand(@rand) + @extra # 1st enemy
    $game_variables [2] = rand(@rand) + @extra # 2nd Enemy
    $game_variables [3] = rand(@rand) + @extra  # 3rd enemy
    $game_system.menu_disabled = true
    $game_system.caterpillar = true
    @phase = 1
  end
 
   
   alias map_update update
  def update
    map_update
      @check_terrain
      @update_phase1
      @update_phase2
      @update_phase3
      @update_phase4
    end
    if @wait_count == nil
      @wait_count = 0
    elsif @wait_count > 0
      @wait_count -= 1
      return
    end
  end
 
  def check_terrain
    if $game_player.terrain_tag == 1
      teleport  = $game_system.terrains[1]
    elsif $game_player.terrain_tag == 2
      teleport  = $game_system.terrains[2]
    elsif $game_player.terrain_tag == 3
      teleport  = $game_system.terrains[3]
    elsif $game_player.terrain_tag == 4
      teleport  = $game_system.terrains[4]
    elsif $game_player.terrain_tag == 5
      teleport  = $game_system.terrains[5]
    elsif $game_player.terrain_tag == 6
      teleport  = $game_system.terrains[6]
    elsif $game_player.terrain_tag == 7
      teleport  = $game_system.terrains[7]
    end
  end
 
def update_phase1
$game_temp.player_transferring = true
$game_temp.player_new_map_id = teleport[0]
$game_temp.player_new_x = teleport[1]
$game_temp.player_new_y = teleport[2]
$game_temp.player_new_direction = teleport[3]
@phase = 2
end

def update_phase2
if @phase == 2 
if $game_map.map_id !=  @map_id
   @wait_count = 40
   end
  if  @wait_count > 0
     enemy1
     enemy2
     enemy3
     @phase = 3
   end
end
end
   
def update_phase3
  if @phase == 3 
  if $game_variables [4]  == 3
    $game_system.me_play($game_system.battle_end_me)
    $game_system.hud = false
    $window =  Window_Result.new
    @wait_count = 40
  end
if @wait_count == 0
$window.dispose
    exp = $total1
    gold = $total2
    treasures = $total3
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
    $game_party.gain_gold(gold)
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    $total1 = 0
    $total2 = 0
    $total3 = 0
    $game_variables [4] = 0
    @phase = 4
  end
end
end
   
  def update_phase4
    if @phase == 4
   $game_temp.player_transferring = true
    $game_temp.player_new_map_id = @map_id
    $game_temp.player_new_x = @player_x
    $game_temp.player_new_y = @player_y
    $game_temp.player_new_direction = 2
    $game_system.bgm_play($game_temp.map_bgm)
    $game_system.hud = true
    $game_system.menu_disabled = false
    if $game_switches [1] == true
    $game_system.caterpillar = false
    $game_temp.in_battle = false
     end
    end
   end   


ok i changed it thanks to GameGirl lol GameGuy & WCW i think tran week lol but its still not working
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script