Bug report: super vs alias

● ARCHIVED · READ-ONLY
Started by Tsukihime 3 posts View original ↗
  1. There is a script called the scene interpreter that allows you to execute common events in the current scene.

    http://www.himeworks.com/2013/03/scene-interpreter/

    For example, you use an item in the item menu, and any common events will be run in the item menu.

    I was using one of the luna engine samples to make a screenshot but realized common events do not run in the item menu.

    Then I found out it was this:

    Line 4090 in Menu Luna of Etrian project

    alias menu_luna_update update def update menu_luna_update @menu_status.update endNow, this doesn't actually call the superclass' update method for some reason.I'm not exactly sure why, but when I did this

    alias menu_luna_update update def update super @menu_status.update endIt worked. j9g5TpT.jpg

    It might have broke other things in the process (I don't know, it might be aliasing something), so further investigation is required

    To test the script,

    1. Create a common event. Add this comment in the first line

    <run scene: current>Then show a text message2. Set the potion to call this common event

    3. Use the potion on an actor in the item menu

    The problem can be resolved in several ways

    - replace the alias with a super

    - place the scene interpreter above the menu system (to force alias ordering)

    To me, the more correct way is to provide a super call.
  2. I had a talk with Neonblack and he provided an explanation. Yami was attempting to alias a method that does not exist and then call it. In Ruby this doesn't throw an error but it also won't call the parent class, the super. It was made for compatibility but in this case it actually didn't work. He said something along the lines of, since Luna is such a big script, doing ask overwrites would be of benefit and put it above all other custom scripts.
  3. I would suggest to make Luna service pack / basic module / core script or whatever just to provide the super keyword.

    Yes, it should be put above all custom scripts