- Joined
- Jul 4, 2017
- Messages
- 11
- Reaction score
- 2
- First Language
- English
- Primarily Uses
- RMMV
That's exactly what I need, @ATT_Turan! Thanks!
What are you talking about? You just wrote this in a thread for basic JavaScript questions. Any questions about moderator actions have nothing to do with that. And if you had a question about a plugin, that also wouldn't have anything to do with this thread.hmm i wonder...
sorry but i dont know how to reach the mod and i thought posting here probably had a chance of them reading thisWhat are you talking about? You just wrote this in a thread for basic JavaScript questions. Any questions about moderator actions have nothing to do with that. And if you had a question about a plugin, that also wouldn't have anything to do with this thread.
I don't see any thread of yours that was moved anyplace, unless it was completely deleted which they don't normally do.
If you click the word "Help" in the first row of words you see on the page, it will take you to the forum rules, which include what to do when you disagree with moderator action. Of all the things you might do, randomly posting your question in an existing thread makes the least sensesorry but i dont know how to reach the mod and i thought posting here probably had a chance of them reading this
Well...a couple of things, not all that small.i bet it is something small but what am i doing wrong?
There are two things wrong here. First, you're referencing user and $gameActors.actor(1), which means you may well be checking someone else's weapon. You should use user again.if (user.isStateAffected(22) && $gameActors.actor(1).isEquipped($dataWeapons[2]))
if (condition) stuff
if state and weapon
- because the if state and switch
is in an entire separate set of parentheses, it doesn't mean anything.if ((thing && thing) || (thing && thing))
they all need to be inside one set of parentheses, like that. However, the entire construct is unnecessary, as boolean AND has a higher precedence than OR in the order of operations, so you don't need those extra parentheses at all.if (thing && (thing || thing))
It's not anything wrong, but a couple of tips to make your code a bit cleaner here.visible = true;
} else {
visible = false;
if (condition)
thing
else
thing
<Custom Show Eval>
visible = user.isStateAffected(22) && (user.isEquipped($dataWeapons[2]) || $gameSwitches.value(1));
</Custom Show Eval>
I'll be interested to see if anyone else says differently, but from what I can see, no. It looks like the entirety of map data is loaded from disk when they're accessed, then purged when left. Even self-switches, which can be set externally, aren't actually kept inside the map events, but in an external list.Is it possible to get the events/number of events on a map that the player is not currently on?
You're approaching this slightly backwards - you would attach a common event to your fishing pole in the Effects list, so that gets called every time you use the pole.Hey everyone, in rpg maker mv, is there a script call for when an item is used?
if : script : $gamePlayer.regionId()==30 && (the item "fishing pole" was used) = run common event
$gamePlayer.regionId()==30
You are quite correct as there is no variables to access this values. They are indeed generated dynamically on map load. But this is also the answer: It has to be possible, because the game itself does this on every map load.I'll be interested to see if anyone else says differently, but from what I can see, no. It looks like the entirety of map data is loaded from disk when they're accessed, then purged when left. Even self-switches, which can be set externally, aren't actually kept inside the map events, but in an external list.
var _myRequestedMapData = {};
function loadMyMapData (mapId) {
if (mapId > 0) {
const filename = "Map%1.json".format(mapId.padZero(3));
console.log(filename);
loadDataFile("$dataMap", filename);
} else {
//this.makeEmptyMap();
}
}
function loadDataFile (name, src) {
const xhr = new XMLHttpRequest();
const url = "data/" + src;
xhr.open("GET", url);
xhr.overrideMimeType("application/json");
xhr.onload = () => onXhrLoad(xhr, name, src, url);
xhr.onerror = () => onXhrError(name, src, url);
xhr.send();
}
function onXhrError (name, src, url) {
const error = { name: name, src: src, url: url };
console.log(error);
}
function onXhrLoad (xhr, name, src, url) {
if (xhr.status < 400) {
_myRequestedMapData = JSON.parse(xhr.responseText);
}
}
let mapId = 3;
loadMyMapData(mapId);
No, I really meant to move it out and not to call it separately like in this picture featuring an MZ plugin.@Chaos17
you may mean
JavaScript:Game_Message.prototype.setFaceImage = function(faceName, faceIndex)
Ah okay.No, I really meant to move it out and not to call it separately like in this picture featuring an MZ plugin.
Window_Message.prototype.drawMessageFace = function() {
const faceName = $gameMessage.faceName();
const faceIndex = $gameMessage.faceIndex();
const rtl = $gameMessage.isRTL();
const width = ImageManager.faceWidth;
const height = this.innerHeight;
const x = rtl ? this.innerWidth - width - 4 : 4;
this.drawFace(faceName, faceIndex, x, 0, width, height);
};
Obviously it's possible, or the games couldn't be playedYou are quite correct as there is no variables to access this values....But this is also the answer: It has to be possible
So you can do that with a few lines of code, but before going through that - you do know there are existing plugins to give you an on-map battle system? If you look for ABS you'll find plenty of stuff already written, which may save you considerable time.How can I get events/enemies that are at x/y tile relative to the main actor? (Example; I press 'a' to slash my sword left. I want to damage enemies on the tile directly left of me)