Ruby/RGSSx questions that don't deserve their own thread

Mr. Minister

Veteran
Veteran
Joined
Mar 14, 2012
Messages
33
Reaction score
2
First Language
English
Primarily Uses
RMMV
So, I've been working on my custom menus and making a few graphical changes for my game and have run into a snag. Nothing major, but I would love to be able to place the little arrow that appears at the bottom center of a message box to the right rather than have it centered. I have looked all through the scripts but I can't find where it is drawn or anything. I may not even be able to change it, but I hope I can. I've attached a screen capture to this post for further clarification (please excuse the stupid test dialog lol.)

View attachment 59
 

Kread-EX

You're all bakas
Veteran
Joined
Mar 16, 2012
Messages
863
Reaction score
81
First Language
French
Primarily Uses
You can't. You'll have to use a Sprite instead of a Window to do that. As, create a picture for your message and display it with event commands while keeping a transparent box.

Or you can also recode completely the Window class too. Up to you.
 
Last edited by a moderator:

vampireshark

Warper
Member
Joined
Apr 6, 2012
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMVXAce question:

After having worked with RMVX, I'm used to the convention of the unit (HP/MP) being displayed after the number (so, for example, 50 HP). However, once I began toying around with RMVXAce and ran a battle simulation, it didn't work as I wished it to.

For example, under Vocab, the following line appears:

37. ActorRecovery = "%s recovered %s %s!"

The output, for example, was that "X recovered HP 50!" For me, this is completely unacceptable. I tried running it as it worked in VX, (37. ActorRecovery = "%1$s recovered %3$s %2$s!"), but I got an error message. How can I switch the syntax order?

(And I apologize in advance if the question's already been answered or if this belongs elsewhere.)
 
Last edited by a moderator:

Mihel

Veteran
Veteran
Joined
Mar 13, 2012
Messages
382
Reaction score
42
Primarily Uses
@vampireshark haven't tested it, but try this.



Code:
class Game_ActionResult
  #--------------------------------------------------------------------------
  # * Get Text for HP Damage
  #--------------------------------------------------------------------------
  def hp_damage_text
	if @hp_drain > 0
	  fmt = @battler.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain
	  sprintf(fmt, @battler.name, @hp_drain, Vocab::hp)
	elsif @hp_damage > 0
	  fmt = @battler.actor? ? Vocab::ActorDamage : Vocab::EnemyDamage
	  sprintf(fmt, @battler.name, @hp_damage)
	elsif @hp_damage < 0
	  fmt = @battler.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery
	  sprintf(fmt, @battler.name, -hp_damage, Vocab::hp)
	else
	  fmt = @battler.actor? ? Vocab::ActorNoDamage : Vocab::EnemyNoDamage
	  sprintf(fmt, @battler.name)
	end
  end
  #--------------------------------------------------------------------------
  # * Get Text for MP Damage
  #--------------------------------------------------------------------------
  def mp_damage_text
	if @mp_drain > 0
	  fmt = @battler.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain
	  sprintf(fmt, @battler.name, @mp_drain, Vocab::mp)
	elsif @mp_damage > 0
	  fmt = @battler.actor? ? Vocab::ActorLoss : Vocab::EnemyLoss
	  sprintf(fmt, @battler.name, @mp_damage, Vocab::mp)
	elsif @mp_damage < 0
	  fmt = @battler.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery
	  sprintf(fmt, @battler.name, -@mp_damage, Vocab::mp)
	else
	  ""
	end
  end
end
 

Caffeinix

Wannabe Game Designer
Member
Joined
Mar 13, 2012
Messages
4
Reaction score
0
First Language
English
Primarily Uses
What's the best way of performing an action when a new map is loaded? Adding code to Game_Map::setup(map_id) works, but there's no easy way to access your scene or spriteset from the Game_Map class as far as I can tell. Is there something in Scene_Map or Spriteset_Map that I can use instead?

(Note that in particular I do NOT just want to listen to scene changes, because I don't want my code to run when the player returns from the menu screen, and transferring from one map to another doesn't change the active scene.)
 

Kread-EX

You're all bakas
Veteran
Joined
Mar 16, 2012
Messages
863
Reaction score
81
First Language
French
Primarily Uses
The thing is, Game_Map is not always setup during Scene_Map so trying to access the spriteset during setup can cause issue. If you need the code to only run upon map construction Scene_Map isn't an option either. You'll probably have to divide the work and handle it both within Game_Map and Spriteset_Map.
 

Caffeinix

Wannabe Game Designer
Member
Joined
Mar 13, 2012
Messages
4
Reaction score
0
First Language
English
Primarily Uses
The thing is, Game_Map is not always setup during Scene_Map so trying to access the spriteset during setup can cause issue. If you need the code to only run upon map construction Scene_Map isn't an option either. You'll probably have to divide the work and handle it both within Game_Map and Spriteset_Map.
Hm... that makes sense. The solution I came up with is pretty ugly:



Code:
$mymodule_spriteset = nil
class Game_Map
  alias mymodule_game_map_setup setup
  def setup(map_id)
	mymodule_game_map_setup(map_id)
	if !$mymodule_spriteset.nil?
	  $mymodule_spriteset.do_awesome_things
	end
  end
end


class Spriteset_Map
  alias mymodule_spriteset_map_initialize initialize
  def initialize
	mymodule_spriteset_map_initialize
	$mymodule_spriteset = self
  end

  alias mymodule_spriteset_map_dispose dispose
  def dispose
	$mymodule_spriteset = nil
	mymodule_spriteset_map_dispose
  end
  def do_awesome_things
	 # Awesome things occur here.
  end
end
Nonetheless, it seems to work reliably, and since I don't add any instance variables to Game_Map it doesn't break save/load behavior. The extra global makes me sad inside though. Does that look like a reasonable way of doing it, or is there a bug lurking?
 
Last edited by a moderator:

Kread-EX

You're all bakas
Veteran
Joined
Mar 16, 2012
Messages
863
Reaction score
81
First Language
French
Primarily Uses
I don't understand why you need to use Game_Map in this case. In your example, you can just stick everything in Spriteset_Map and get rid of both the Game_Map#setup alias and the global variables.

You previously mentioned that you wanted your code to only run once when the map is created. But the spriteset is disposed upon scene changes which means what you did with it will need to be done again.

If you could tell me what those 'awesome things' are, I'll be able to understand better.
 

kaname

Veteran
Veteran
Joined
Apr 10, 2012
Messages
35
Reaction score
2
First Language
german
Primarily Uses
RMVXAce question: Is there a quick way to change the RegionID of a square dynamically? Say, Tile X,Y has region ID 2, but I want to change it to 5 during gameplay.
 

Jamaz

Villager
Member
Joined
Apr 5, 2012
Messages
17
Reaction score
5
First Language
English
Primarily Uses
Do enemies accumulate/use TP by default or do I need to use/write a script for that feature?
 
Last edited by a moderator:

Onkei69

Veteran
Veteran
Joined
Mar 16, 2012
Messages
30
Reaction score
2
First Language
French
Primarily Uses
I was wondering, when should I define a module rather than a class ?

Are there drawbacks in using modules ?
 

Chaos17

Dreamer
Veteran
Joined
Mar 13, 2012
Messages
1,311
Reaction score
485
First Language
French
Do enemies accumulate/use TP by default or do I need to use/write a script for that feature?
Ennemies use TP by default, if I am not wrong.
 

BigEd781

undefined method 'stupid_title' found for nil:NilC
Veteran
Joined
Mar 1, 2012
Messages
940
Reaction score
304
First Language
Dothraki
Primarily Uses
N/A
I was wondering, when should I define a module rather than a class ?

Are there drawbacks in using modules ?
So, modules have two major uses:

1. They act as a namespace, i.e., a way to group methods and constants to avoid naming clashes. This is typically how modules are used in RM scripts.

2. The implement mixin functionality. I almost never see this used in the context of RPG Maker, but it is great for larger systems.

In case you unfamiliar with the concept of a mixin, here is an article that explains it in more depth than I would here. It is an alternative to inheritance (side not: inheritance is often used incorrectly as a way to use methods from one class in another class. This is not the intent of inheritance.)

http://juixe.com/tec...mixins-in-ruby/
 
Last edited by a moderator:

kingmakerspider

That little devil...
Veteran
Joined
May 3, 2012
Messages
309
Reaction score
30
First Language
English
Primarily Uses
I actually don't know if I should make a thread for this or not... So if I should-- let me know and i will. Here goes:

Okay here's the issue. I am using tankentai Sideview battle system (version 3.3b if that matters) and it came with the "experimental kaduki script" setup by Mr.Bubble.

It works fine for my game, but I've noticed that whenever ANY state is afflicted on a character it changes the character's battle animation back to the left-facing walking animation.

And since I'm using the kaduki battle sprites... This is rather irritating, especially when you have states such as "auto-life" on some characters the ENTIRE battle. so...

I wanted to know how to fix this so that STATES (unless added to a list) didn't change the animation... and the ones I could add to a list would instead use the "critical" animation.

The one that looks like they're low on health, you know? I would appreciate the help here...

I'm trying to get a playable demo of my game released soon and this is one of the things I would like to fix by then.
 

Mr. Bubble

Makes stuff.
Member
Joined
Mar 1, 2012
Messages
853
Reaction score
163
I actually don't know if I should make a thread for this or not... So if I should-- let me know and i will. Here goes:

Okay here's the issue. I am using tankentai Sideview battle system (version 3.3b if that matters) and it came with the "experimental kaduki script" setup by Mr.Bubble.
I have to ask: where are people constantly finding these old versions of Tankentai? 3.3 is close to three years old. The latest version is 3.4e.
 

kingmakerspider

That little devil...
Veteran
Joined
May 3, 2012
Messages
309
Reaction score
30
First Language
English
Primarily Uses
I have to ask: where are people constantly finding these old versions of Tankentai? 3.3 is close to three years old. The latest version is 3.4e.
Yeah... I started this project at least over a year ago. and that's the kind I downloaded... do you know if what I'm talking about can be done?
 

kingmakerspider

That little devil...
Veteran
Joined
May 3, 2012
Messages
309
Reaction score
30
First Language
English
Primarily Uses
Okay. I figured out a non-script related way to do what I was attempting to do... for the most part. So i no longer need assistance with this issue. Thanks.
 

FenixFyreX

Fire Deity
Veteran
Joined
Mar 1, 2012
Messages
434
Reaction score
310
First Language
English
Primarily Uses
Please refrain from double posting within 72 hours. Please use the edit button instead. Thanks.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,090
Members
137,586
Latest member
Usagiis
Top