General RGSS/RGSS2/RGSS3 Help

Started by G_G, March 04, 2009, 12:14:28 am

Previous topic - Next topic

fugibo

Here's a tip:

Look in the Scene_Map class. You'll find a variable for events there. Find out what class is being stored there.
Next, go find either a) that class's source in the scripts or b) that class's documentation in the help file.
Finally, look for something with 'x' in it.

G_G

Gots a new question I am making a status menu for my ABS Arcade game and I want the enemies to be animated in the menu so it looks like they are walking in place. How would I go doing this?

Fantasist

Use sprites and link them to the window as needed. For example, window.visible=false will also do sprite.visible = false. Check out STCMS and see how Blizz did it. That, or you could constantly use contents.blt to paste the graphic, which I don't recommend (but I mentioned this cause it might be considerable).
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




G_G

I didnt quite get it working  :^_^': But anyways new question :P Of course :)
How do I transfer a player using script call?

shdwlink1993

You'd use:

$game_temp.player_new_map_id = <<New Map>>
$game_temp.player_new_x = <<New X>>
$game_temp.player_new_y = <<New Y>>
$game_temp.player_new_direction = <<New Direction to face>>
$scene.transfer_player


while on the map.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

G_G

March 27, 2009, 05:11:11 pm #45 Last Edit: March 28, 2009, 06:41:34 pm by game_guy
Another question :^_^':
I have something setup for a font changing size and and font changer. My script does what its supposed to do. This is the part thats not working I have the class game_system set up heres my script can someone help please?
class Game_System
  attr_accessor :font                    # font
  attr_accessor :size                    # size
  alias re_init initialize
  def initialize
    @font = "Arial"
    @size = 20
    re_init
  end
end

class Font
  alias change_font initialize
  def initialize
    change_font
    self.name = $game_system.font
    self.size = $game_system.size
  end
end


When I use $game_system.font = "Arial Black" it doesnt work. the $game_system.size = 10 doesnt work eitehr can someone help?

G_G

Quote from: game_guy on March 27, 2009, 05:11:11 pm
Another question :^_^':
I have something setup for a font changing size and and font changer. My script does what its supposed to do. This is the part thats not working I have the class game_system set up heres my script can someone help please?
class Game_System
  attr_accessor :font                    # font
  attr_accessor :size                    # size
  alias re_init initialize
  def initialize
    @font = "Arial"
    @size = 20
    re_init
  end
end

class Font
  alias change_font initialize
  def initialize
    change_font
    self.name = $game_system.font
    self.size = $game_system.size
  end
end


When I use $game_system.font = "Arial Black" it doesnt work. the $game_system.size = 10 doesnt work eitehr can someone help?


*bumps*

Landith

Make the class font part to module font and try calling it with change_font, after you set the $game_system.font = "Arial Black"

So like an example would be:


$game_system.font = "Arial Black"
change_font


and your code would be

class Game_System
  attr_accessor :font                    # font
  attr_accessor :size                    # size
  alias re_init initialize
  def initialize
    @font = "Arial"
    @size = 20
    re_init
  end
end

module Font
  alias change_font initialize
  def initialize
    change_font
    self.name = $game_system.font
    self.size = $game_system.size
  end
end


You can try that.

Blizzard

I suggest you rather use something like my Ultimate Font Override.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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.

G_G

Quote from: Blizzard on March 29, 2009, 08:41:22 am
I suggest you rather use something like my Ultimate Font Override.


Normally I would but this isn't for changing the font :P
I'm trying to learn to be a better scripter. More knowledge of RGSS the better.

Fantasist

You could learn from Ultimate Font Override, if not use it. I did the same. But in the end, my version came out pretty much the same.

PS: btw, doesn't Font#initialize have arguments? Shouldn't it be like:

alias re_init initialize
def initialize(*args)
  #stuff
  re_init(args)
end


*args will simply pass all the given arguments to the aliases method. You use this when you're not sure about the number of arguments or you don't want to handle them again when you don't need to.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




G_G

How do we cut image script wise. I seen it in Berans Ipod Script.


I want to be able to cut that up in a script so I can use it or something. But how would I go like "cutting" it up like make it display only one section of the image?

G_G

Quote from: game_guy on March 30, 2009, 11:54:27 pm
How do we cut image script wise. I seen it in Berans Ipod Script.


I want to be able to cut that up in a script so I can use it or something. But how would I go like "cutting" it up like make it display only one section of the image?

*bump*

It is a whole image. All the numbers are put together.

shdwlink1993

Something like this would work (I think):

self.bitmap = RPG::Cache.picture('Numbers', 0)
self.ox = bitmap.width / 10
self.oy = bitmap.height
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Fantasist

That won't cut the image, it'll only set the ox. For cutting the image, you'd need self.src_rect.set(x, y, w, h). Check it out in Arrow_Actor class, see how it selects the cursor parts from the windowskin.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews





G_G

I need some major help and it involves my new script with the background changer. I am so stuck on this and can't figure it out.
Here's my script.

module GameGuy
  Tilesets_Apply          = [1]
  Terrain1                = "001-Grassland01"
  Terrain2                = "002-Woods01"
  Terrain3                = "003-Forest01"
  Terrain4                = "004-Mountain01"
  Terrain5                = "004-Mountain01"
  Terrain6                = "004-Mountain01"
  Terrain7                = "004-Mountain01"
end
class Scene_Map
  alias re_update update
  def update
    re_update
    if GameGuy::Tilesets_Apply.include?($data_tilesets[$game_map.tileset_name])
      if $game_map.terrain_tag($game_player.x, $game_player.y) == 1
        $game_map.battleback_name = GameGuy::Terrain1
      elsif $game_map.terrain_tag($game_player.x, $game_player.y) == 2
        $game_map.battleback_name = GameGuy::Terrain2
      elsif $game_map.terrain_tag($game_player.x, $game_player.y) == 3
        $game_map.battleback_name = GameGuy::Terrain3
      elsif $game_map.terrain_tag($game_player.x, $game_player.y) == 4
        $game_map.battleback_name = GameGuy::Terrain4
      elsif $game_map.terrain_tag($game_player.x, $game_player.y) == 5
        $game_map.battleback_name = GameGuy::Terrain5
      elsif $game_map.terrain_tag($game_player.x, $game_player.y) == 6
        $game_map.battleback_name = GameGuy::Terrain6
      elsif $game_map.terrain_tag($game_player.x, $game_player.y) == 7
        $game_map.battleback_name = GameGuy::Terrain7
      end
    end
  end
end


Its an unreleased non working version. Anyways I want to make it so you have to enter the tileset id's in the
Tilesets_Apply so that the background changer only works on the tileset id's you entered in there
but I am having troubles getting to that.

Please someone help :(

Fantasist

Tilesets_Apply          = [1]


if GameGuy::Tilesets_Apply.include?($data_tilesets[$game_map.tileset_name])


I'm not sure, but I don't think $data_tilesets[$game_map.tileset_name] is a number, it has to be one of those RPG:: objects. Try checking that out. If that IS the case, something like this might work:
if GameGuy::Tilesets_Apply.include?($data_tilesets[$game_map.tileset_name].id)

PS: This is all off my head, there is every chance I could be wrong.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




nathmatt

actually this works tested

Spoiler: ShowHide
module GameGuy
  Tilesets_Apply          = [1, 3]
  Terrain1                = "001-Grassland01"
  Terrain2                = "002-Woods01"
  Terrain3                = "003-Forest01"
  Terrain4                = "004-Mountain01"
  Terrain5                = "004-Mountain01"
  Terrain6                = "004-Mountain01"
  Terrain7                = "004-Mountain01"
end
class Scene_Map
  alias re_update update
  def update
    re_update
   if GameGuy::Tilesets_Apply.include?($game_map.map_id)
      if $game_player.terrain_tag == 1
        $game_map.battleback_name = GameGuy::Terrain1
      elsif $game_player.terrain_tag == 2
        $game_map.battleback_name = GameGuy::Terrain2
      elsif $game_player.terrain_tag == 3
        $game_map.battleback_name = GameGuy::Terrain3
      elsif $game_player.terrain_tag == 4
        $game_map.battleback_name = GameGuy::Terrain4
      elsif $game_player.terrain_tag == 5
        $game_map.battleback_name = GameGuy::Terrain5
      elsif $game_player.terrain_tag == 6
        $game_map.battleback_name = GameGuy::Terrain6
      elsif $game_player.terrain_tag == 7
        $game_map.battleback_name = GameGuy::Terrain7
      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


Fantasist

lol nathmatt! I only made things complicated >.< *powers up*
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews