So, I am trying to make a game where the player character is basically just a cursor, but I want to be able to click on the screen and have it instantly transport to that location. I was going to use conditional branch, when mouse button click or whatever, to just set player location, however I can't seem to find that option. Thanks for the help.
mouse click- auto move player
● ARCHIVED · READ-ONLY
-
-
I'll do that :)
-
YOU would be rad! I am in no rush, so take your time.
-
It's Done :)
-
Okay, I might be doing something wrong, but I made a *.js file of the code, I put it into the plugins and turned it to on, but when I mouse click in game, the player just walks over...
-
It should have worked.Okay, I might be doing something wrong, but I made a *.js file of the code, I put it into the plugins and turned it to on, but when I mouse click in game, the player just walks over...
Even if you just add this inside a JS file, it should work:
Code:Game_Temp.prototype.setDestination = function(x, y) { $gamePlayer.setPosition(x, y);}; -
Well, I think I might just be mighty slow. I removed the comment (/) and it seemed to work just fine. Would I be an rear end in a top hat if I requested functionality that would allow interaction with Events? I was going to do a conditional branch, 'player x/player y, (WHen player x,y is =to stored variable x,y then do this..." but I cant seem to find a method for it..
Thanks for the script -
Made a separate plugin just for you, you can remove that other one:
Code:/*============================================================================= * PhilteredKhaos Cursor * By Hudell - www.hudell.com * PhilteredKhaosCursor.js * Version: 1.0 * Free for commercial and non commercial use. *=============================================================================*/ /*: * @plugindesc This plugin will instantly teleport the player to the clicked position * @author Hudell */ var Imported = Imported || {}; var PhilteredKhaosCursor = PhilteredKhaosCursor || {}; (function($) { "use strict"; Scene_Map.prototype.tryTriggeringEvent = function() { if ($gameMap.isAnyEventStarting() || $gameMap.isEventRunning() || !$gamePlayer.canStartLocalEvents()) { return false; } if (TouchInput.isTriggered() || this._touchCount > 0) { if (TouchInput.isPressed()) { if (this._touchCount === 0 || this._touchCount >= 15) { var x = $gameMap.canvasToMapX(TouchInput.x); var y = $gameMap.canvasToMapY(TouchInput.y); var events = $gameMap.eventsXy(x, y); if (events.length === 0) { return false; } for (var i = 0; i < events.length; i++) { if (events[i].isTriggerIn([0, 1, 2])) { events[i].start(); return true; } } } } } return false; }; Game_Temp.prototype.setDestination = function(x, y) { $gamePlayer.setPosition(x, y); }; var oldSceneMap_processMapTouch = Scene_Map.prototype.processMapTouch; Scene_Map.prototype.processMapTouch = function() { this.tryTriggeringEvent(); oldSceneMap_processMapTouch.call(this); }; })(PhilteredKhaosCursor); Imported["PhilteredKhaosCursor"] = true; -
Man i feel dense, and I really appreciate not only your patience, but your incredible script wizardry. But I must humbly again request assistance :headshake:
Do I need to use any script calls? or should I just be able to click the event and have it run? I am not getting it to run on "Event TOuch" or "player touch", and I am not sure entirely what I am doing wrong.... -
Ah, I had only checked for action button events. I already updated the code in the previous post to look for touch events too :)Man i feel dense, and I really appreciate not only your patience, but your incredible script wizardry. But I must humbly again request assistance :headshake:
Do I need to use any script calls? or should I just be able to click the event and have it run? I am not getting it to run on "Event TOuch" or "player touch", and I am not sure entirely what I am doing wrong.... -
Huzzzah! You are a genius! I can't tell you how much I not only appreciate this script, but how much use it will see from just me alone! :) ) THANK YOU SO MUCH!
-
I also need this plugin, since I have the same problem:), but the link is not active.Ah, I had only checked for action button events. I already updated the code in the previous post to look for touch events too :)
-
It got a bit messed up on an old forum transition, but I fixed it now.
-
Thanks, but how to manage, for example, I want your plugin to be activated when activating the script \ plugin command.It got a bit messed up on an old forum transition, but I fixed it now.
-
I also saw a plugin for you, and didn’t know how to launch it either, so I want to know how? Through the command plugin \ script.It got a bit messed up on an old forum transition, but I fixed it now.
-
Help when you can, please.It got a bit messed up on an old forum transition, but I fixed it now.
-
Help, please!!!!It got a bit messed up on an old forum transition, but I fixed it now.
-
Jonini, please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.
Since the topic's original request was solved, I'm closing this. Please start a new thread with your questions/problems with Hudell's plugin in Plugin Support.