More flexible Get Location Info

I don't recall seeing this one (or suggesting it) - hope I'm not doubling up

Description of the Feature:
  • Get Location Info will allow you to select Player or EV### from dropdown list, in addition to the existing Direct Designation and Designate with Variables options. This is similar to Control Variables > Game Data > Character where you can select the player, 'this event' or a specific event.

Code for Implementation:
Code:
// Get Location Info
Game_Interpreter.prototype.command285 = function() {
    var x, y, value;
    switch (this._params[2]) {
    case 0: // Direct designation
        x = this._params[3];
        y = this._params[4];
        break;
    case 1: // Designation with variables
        x = $gameVariables.value(this._params[3]);
        y = $gameVariables.value(this._params[4]);
        break;
    case 2: // Designate with character
        var character = this.character(param1);
        if (!character) {
            $gameVariables.setValue(this._params[0], 0); // default value if character not found
            return true;
        }
        x = character.x;
        y = character.y;
        break;
    }
    switch (this._params[1]) {
    case 0:     // Terrain Tag
        value = $gameMap.terrainTag(x, y);
        break;
    case 1:     // Event ID
        value = $gameMap.eventIdXy(x, y);
        break;
    case 2:     // Tile ID (Layer 1)
    case 3:     // Tile ID (Layer 2)
    case 4:     // Tile ID (Layer 3)
    case 5:     // Tile ID (Layer 4)
        value = $gameMap.tileId(x, y, this._params[1] - 2);
        break;
    default:    // Region ID
        value = $gameMap.regionId(x, y);
        break;
    }
    $gameVariables.setValue(this._params[0], value);
    return true;
};
Mockups:


Why is this feature good?
This feature is great because of the following:
  • No need to use additional Control Variables commands to get the location of player or event
  • Easier to use
I see I already have made this suggestion:
https://forums.rpgmakerweb.com/index.php?threads/character-selection-in-get-location-info.75068/

Didn't provide a mockup or code for it previously though, so hopefully this'll still be useful.
Really hope this gets added, because without this feature I'm already having big problems implementing basic field skills and puzzles.
It's a great idea, and also the first successful snippet of code I've ever written did exactly this. It's not like it's hard to link to variables with the player's x and y location or anything, it's just really tedious after a while, especially when you have different events that need to know that information on a semi-consistent basis and also clutters said events a lot more than they have to be.
Implemented in code in my spare time, I will try to get this approved to be added but no promises!

Thanks for the suggestion,
- Liquidize
Awesome! Thank you 🙂
Implemented in code in my spare time, I will try to get this approved to be added but no promises!

Thanks for the suggestion,
- Liquidize
Thank you too! It would be amazing!

Original thread: https://forums.rpgmakerweb.com/threads/more-flexible-get-location-info.81324/