RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Resolved]A quick request

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 91
Blah blah blah...
Project of the Month winner for November 2008
This is a simple request. I get an error with an item popup window script. What it does is show the item icon above an event zelda style whenever you get an item, and it works fine. The only problem is, what if that event is a common event?
It has no x and y values, nor event IDs. This causes the script to crash the game whenever the player is given an item through common events. I thought of a simple solution.
Have the item appear above the player, using the player's X and Y coordinates instead.

This is the section of the script I need to edit. I'm sure it's just this part, but if I run into problems I'll post the whole thing.
Code: [Select]
class Game_Interpreter
  #--------------------------------------------------------------------------
  # Get X
  #--------------------------------------------------------------------------
  def get_x
    events = $game_map.events
    x_coord = events[@event_id]
    return x_coord.screen_x
  end
  #--------------------------------------------------------------------------
  # Get Y
  #--------------------------------------------------------------------------
  def get_y
    events = $game_map.events
    y_coord = events[@event_id]
    return y_coord.screen_y
  end

I'm guessing just change event to player or actor, but I'm not too sure. All I need is for someone to make the changes here so I can see if my idea worked. If it doesn't work I'll post a more detailed analysis of the problem, though i doubt it'll be necessary.
« Last Edit: May 22, 2009, 11:33:48 PM by MrMoo »


- -

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Code: [Select]

  #--------------------------------------------------------------------------
  # Get X
  #--------------------------------------------------------------------------
  def get_x
    return $game_player.screen_x
  end
  #--------------------------------------------------------------------------
  # Get Y
  #--------------------------------------------------------------------------
  def get_y
    return $game_player.screen_y
  end

***
Rep:
Level 91
Blah blah blah...
Project of the Month winner for November 2008
Perfect! Thanks once again MA.


- -

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
No problem. I love fulfilling requests when they're that easy :)