Jump to content


Photo

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


  • Please log in to reply
1576 replies to this topic

#1561 TheoAllen

TheoAllen

    Eremidian Royal Guardian

  • Global Moderators
  • 1,461 posts
  • LocationIndonesia
  • RM Skill - Coder

Posted 01 November 2014 - 12:11 AM

Is anyone know how to alias / overwrite Table functions like

self[x,y] and self[x,y,z] ?


Founder of :
IkmCNj7.png

Visit also :

Theolized SBS | Development Journal | DeviantArt | SoundCloud | Free Midis |


rmid10.png
Vty978c.png

 
I support of these people / projects :

Spoiler
Be careful with the scripters
http://fc05.devianta...len-d7fchsv.jpg

#1562 Glasses

Glasses

    The Coder

  • + Premium Members
  • 494 posts
  • LocationThe Internet
  • RM Skill - Coder

Posted 01 November 2014 - 02:07 AM

You mean something like that?

class Table < Object  
  
  alias :mrts_set :[]
  
  def [](*args)
    p "test"
    mrts_set(*args)
  end
end

2vd44mv.png

 

 

Spoiler

#1563 TheoAllen

TheoAllen

    Eremidian Royal Guardian

  • Global Moderators
  • 1,461 posts
  • LocationIndonesia
  • RM Skill - Coder

Posted 01 November 2014 - 02:54 AM

Lol, I never thought of using *args.

Thanks.


Founder of :
IkmCNj7.png

Visit also :

Theolized SBS | Development Journal | DeviantArt | SoundCloud | Free Midis |


rmid10.png
Vty978c.png

 
I support of these people / projects :

Spoiler
Be careful with the scripters
http://fc05.devianta...len-d7fchsv.jpg

#1564 joeyjoejoe

joeyjoejoe

    Advanced Member

  • Ace Member
  • 112 posts
  • LocationCanadian living in Korea
  • RM Skill - Jack of All Trades

Posted 01 November 2014 - 11:43 PM

Hi all, I need to call a certain script function from an event... there's kind of a bug with NeonBlack's bridges where for some reason certain tiles become impassable when they shouldn't be (i.e. after passing under certain bridges) The bug could potentially make you stuck...

 

I use this script call to reset the map and center the screen to the character, but it looks kind of weird for a split second.

$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, 
$game_player.y)

Also, any nearby enemies that moved go back to their original position, so it's even more bizarre.

 

I want to find a way to just have it reload the tileset data and the map data very smoothly without events having moved around.

 

EDIT: Nevermind, got it. I have to do a script call from NeonBlack's script called $game_map.init_fold to fix it.


Edited by joeyjoejoe, 02 November 2014 - 12:48 AM.

odysseyofthepactverysmall_zps2aaa86eb.pn

Demo 0.2 release on the way! (target: late November)


#1565 Spitfire71

Spitfire71

    Member

  • Ace Member
  • 12 posts

Posted 05 November 2014 - 06:49 PM

Hey all,

 

Is there a script that can execute a particular skill in battle?  Still getting my feet wet in RGSS3 here... tried looking around in the scripts for myself but I haven't found exactly what, if anything, could make this happen.



#1566 blacks888

blacks888

    Member

  • Ace Member
  • 11 posts
  • LocationPhilippines
  • RM Skill - Jack of All Trades

Posted 07 November 2014 - 03:31 AM

Hello, I would like to ask if there is a script call for enemy patterns so that I can add up a skill for an enemy in the later part of the game. 

I tried to do: $data_enemies[51].actions[4,0] but it does not do anything.. any help? I think it has to do with rating but I do not know the script call for it.



#1567 DarthVollis

DarthVollis

    Moogle Master

  • + Premium Members
  • 395 posts
  • LocationSivart's Casino
  • RM Skill - Jack of All Trades

Posted 08 November 2014 - 06:39 PM

Is there a script or a way to determine the screen resolution that your game is using? I tried changing mine to 640 x 180 and it messed everything up, but my default (whatever it is) is making one of may new menus messed up. Any ideas? 


MoogleFantasy_zpse4aab1d3.gif


#1568 Glasses

Glasses

    The Coder

  • + Premium Members
  • 494 posts
  • LocationThe Internet
  • RM Skill - Coder

Posted 08 November 2014 - 06:57 PM

Graphics.width   # Width of the screen
Graphics.height  # Height of the screen

2vd44mv.png

 

 

Spoiler

#1569 shaynec1981

shaynec1981

    Advanced Member

  • Ace Member
  • 217 posts
  • LocationIndiana
  • RM Skill - Jack of All Trades

Posted 10 November 2014 - 07:47 PM

I have a pop up window that is inherits Window_Base. How do I simply leave this window shown and wait for some kind of user input (pressing esc or return keys or whatever) then have the window dispose of itself? Everything I've tried simply displays and disposes the window so fast you don't even know it was there or it displays the window but user input has no effect on calling the dispose method.



#1570 DrDhoom

DrDhoom

    It was is... And will always be... DOOM who pulls the strings.

  • Ace Member
  • 49 posts
  • LocationIndonesia
  • RM Skill - Coder

Posted 10 November 2014 - 08:53 PM

put the input in it's update method, maybe something like this

def update
  if Input.trigger?(:C)
    dispose
  end
end

Sorry and correct me if there's any grammatical error in my post

Check out my DA

My Scripts


#1571 shaynec1981

shaynec1981

    Advanced Member

  • Ace Member
  • 217 posts
  • LocationIndiana
  • RM Skill - Jack of All Trades

Posted 10 November 2014 - 09:30 PM

Thank you sir!



#1572 William C

William C

    Sanubian Menace

  • Ace Member
  • 784 posts
  • RM Skill - Jack of All Trades

Posted 11 November 2014 - 04:37 PM

I'm trying to display more states in battle. This is what I have in the draw_basic_area method of Window_BattleStatus, to call the actor's state icons.

draw_actor_icons(actor, rect.x + 432, rect.y, [168, 24].max)

168 refers to the product of 24 * 7 (I want to display up to 7 states). Despite this, I can only see FOUR states in battle. I can see SOME of the fifth state's icon image, suggesting that it's being drawn, but the rect of the area isn't wide enough to display seven states in Window_BattleStatus. Is there anyone who knows how I can expand the visible area in Window_BattleStatus to cover the width of the screen?

 

Changing the window_width to return Graphics.width hasn't helped.

  #--------------------------------------------------------------------------
  # * Overwrite method: window_width
  #--------------------------------------------------------------------------
  def window_width
     Graphics.width
  end

Attached Files


Edited by William C, 11 November 2014 - 07:17 PM.

My Completed Scripts: http://pastebin.com/u/WCouillard


#1573 William C

William C

    Sanubian Menace

  • Ace Member
  • 784 posts
  • RM Skill - Jack of All Trades

Posted 14 November 2014 - 03:53 PM

After a few days of fiddling around with various methods, I'm still no closer to solving this one and it is so frustrating. Can anyone help?


My Completed Scripts: http://pastebin.com/u/WCouillard


#1574 Galv

Galv

    Forum Defender

  • Staff Manager/Global Mod
  • 5,269 posts
  • LocationAustralia
  • RM Skill - Jack of All Trades

Awards Bar:

Users Awards

Posted 14 November 2014 - 05:21 PM

If I remember correctly the default rpgmaker setup used viewports that were smaller than the screen when drawing the battle hud. Check that it isn't a viewport size restricting the icons you can see

galv-plea.png sig-kickstarter_zpsda2cb57e.png


gs-banner_zpsfc59b073.png bb-logo_zps34dc32d8.pngconstellation1_zps9e598b08.png


#1575 William C

William C

    Sanubian Menace

  • Ace Member
  • 784 posts
  • RM Skill - Jack of All Trades

Posted 14 November 2014 - 11:08 PM

That's the thing. ANYWHERE I could find any viewport for things referencing Window_BattleStatus or the methods contained within, I changed the width on them to be 640 just to make absolutely sure I was giving every part of the HUD enough space... and still, it cuts off on that right side! It's driving me nuts!

 

In a vanilla project, I got it perfect. Must be something in VE Active Time Battle script that's causing it (it alters the battle HUD somewhat by default). Clearly from the image I made my own alterations, too, but literally the only thing I changed in the draw_actor_icons method was the rect.x position and the rect.width. ARGH.


My Completed Scripts: http://pastebin.com/u/WCouillard


#1576 William C

William C

    Sanubian Menace

  • Ace Member
  • 784 posts
  • RM Skill - Jack of All Trades

Posted 16 November 2014 - 09:30 AM

Apologies for the double post, but I've given up on my prior idea. I've got the icons showing from the left side of the screen now, which works with showing all seven that I want. I'd like to align them from right to left now, though, instead of left to right. Can anyone help me with that?

  #--------------------------------------------------------------------------
  # * Draw State and Buff/Debuff Icons
  #--------------------------------------------------------------------------
  def draw_actor_icons(actor, x, y, width = 168)
    icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
    icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, y) }
  end

Here is the method which handles displaying the status icons. I'd like to create a second method to call in battle, and the default one (above) for menus (which is already in place, no help needed there).

 

EDIT: D'oh! Nevermind, I got it. :D


Edited by William C, 16 November 2014 - 10:16 AM.

My Completed Scripts: http://pastebin.com/u/WCouillard


#1577 William C

William C

    Sanubian Menace

  • Ace Member
  • 784 posts
  • RM Skill - Jack of All Trades

Posted Yesterday, 11:52 AM

Is there a simple way of displaying a skill's icon/name through a draw_text or draw_text_ex method? Aiming to display a skill name with its icon in Window_Status if that's possible (it'd be a different skill ID for each actor).

 

Actually, let me explain this better.

 

I'm looking to reference all of the skills an actor has of a certain type (let's say "Magic" skill type) and then display those in Window_Status, for each actor.

 

EDIT: Got it, nevermind. Ugh, sorry for hijacking this topic lately.


Edited by William C, Yesterday, 04:13 PM.

My Completed Scripts: http://pastebin.com/u/WCouillard





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users