JavaScript questions that don't deserve their own thread

Nerine

Veteran
Veteran
Joined
Oct 3, 2020
Messages
101
Reaction score
58
First Language
Polish
Primarily Uses
RMMZ
You shouldn't have to do script calls during the game, you should be able to make the Home X and Home Y plugin parameters account for this if you take into account $gameParty.battleMembers().length in the calculations.

This isn't a JavaScript question, as it can be done via event commands (Control Variable -> Game Data -> Map ID, do one before and after the transfer, then do a conditional check to see if they're the same).

But what are the circumstances? You create the Transfer Player events, so how would you not know if it's going to the same map or not?
I have a plugin that executes some stuff on transfer, but I don't want it to happen when the transfer occurs across the same map.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,307
Reaction score
703
First Language
English
Primarily Uses
RMMV
I have a plugin that executes some stuff on transfer, but I don't want it to happen when the transfer occurs across the same map.
You should post a separate thread in plugin support asking the question with a link to the plugin. The JavaScript to check this is simple, but incorporating it into an existing plugin is more complex because you'll have to either edit the plugin or make a plugin for the plugin.

Or, you can do what I showed you to store the map ID into a variable before the transfer event and put the stuff you execute via plugin into a conditional with that.

Or you can make a plugin to modify the transfer code to set a variable or switch any time the transfer is within the same map.

Really, there are many ways to implement it, but all of them are sufficiently complex for their own thread.
 

auradev

Veteran
Veteran
Joined
Feb 11, 2021
Messages
35
Reaction score
14
First Language
German
Primarily Uses
RMMZ
Has there been someone who has tried to / managed to intergate plugin development with a unit testing framework?

I got something simple running with the Jasmine standalone but was wondering if there exists some open source project that maybe even got it running on some continous integration runner with npm+jasmine.
 

Lranger

Villager
Member
Joined
Jun 2, 2021
Messages
15
Reaction score
0
First Language
English
Primarily Uses
RMMZ
May I ask some basics about how could I make states and variables interact? I'm really new to RPG maker and I'm not sure how to do it.
So, I want to make a state called "Distance", and a variable called "Actor1_Distance". The variable "Actor1_Distance" is an integer between 0-100.

So how I want it to be:
Actors with the state "Distance" will have increased defense parameters depending on "Actor1_Distance". "0 distance" grants 0% defense param increase, "50 distance" grants 50% defense param increase, and "100 distance" grants 100% defense param increase.
So how should I do that?
 

mellanny

I have no idea what I'm doing
Veteran
Joined
May 4, 2020
Messages
101
Reaction score
33
First Language
Portuguese
Primarily Uses
RMMV
How could I get, via script, a class name from it's database ID? I'm making an event that checks for all party members classes', from last to first, and if any of them doesn't have it's class ID equal as stored in variable 2, he changes to class "variable 2 value". I'd like it to show a text for each changed member to show his class before and the class he was changed into.

edit: I solved by following a tip from this message/text tutorial and using Yanfly's Message Core plugin's \nc code.

Code:
var members = $gameParty.members();
for (var i = members.length - 1; i >= 0; i--) {
 var ID = members[i]._actorId;
 var actor = $gameActors.actor(ID);
   if (actor.currentClass().id != $gameVariables.value(2)) {
     $gameMessage.add(actor.name() + " changed from " + actor.currentClass().name + " to \\nc[" + $gameVariables.value(2) + "].");

     AudioManager.playSe({name: 'Absorb1', pan: 0, pitch: 110, volume: 90});
     actor.changeClass($gameVariables.value(2), false);
     break;
 }
}
 
Last edited:

ApproximatelyCats

Teeth Eating Anomaly
Veteran
Joined
Mar 14, 2012
Messages
55
Reaction score
45
First Language
English
Primarily Uses
RMXP
Wasn't sure if this needed its own post or not, but...
Wondering if anyone knows how to get rid of the 'button' effect any and all choice windows, menus, or name inputs have.
Its like a shadowed box under the text/option. I've edited my windowskin but it didn't change. For example the name input, each letter has a box around it.
I think it has something to do with the dimmer bitmap, but I am unsure how to disable it.
 

Attachments

  • Screenshot 2021-06-20 025328.png
    Screenshot 2021-06-20 025328.png
    76.1 KB · Views: 4

Makorie

Villager
Member
Joined
Dec 9, 2020
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMMZ
[Moving question to its own seperate thread, sorry.]
 
Last edited:

MarxMayhem

Veteran
Veteran
Joined
Apr 17, 2020
Messages
37
Reaction score
15
First Language
Filipino
Primarily Uses
RMMV
I'm assuming that I'm using this thread right.
[MV] Using YEP, how do you make a skill that increases its damage based on the MP used for it? My skills have variable costs and will have effects that alter MP consumption, so this is something that is nice to have.
 

mellanny

I have no idea what I'm doing
Veteran
Joined
May 4, 2020
Messages
101
Reaction score
33
First Language
Portuguese
Primarily Uses
RMMV
I'm assuming that I'm using this thread right.
[MV] Using YEP, how do you make a skill that increases its damage based on the MP used for it? My skills have variable costs and will have effects that alter MP consumption, so this is something that is nice to have.

I'm guessing it would be something like this, but somehow storing the mp cost into a variable (that I don't know how to do, but I'm sure there's a Tip or Trick somewhere that does something similar).

edit: oh sorry, I thought you meant a state that did that, not a skill. Have you checked skill damage formulas to see if any covers MP cost?
 
Last edited:

MarxMayhem

Veteran
Veteran
Joined
Apr 17, 2020
Messages
37
Reaction score
15
First Language
Filipino
Primarily Uses
RMMV
edit: oh sorry, I thought you meant a state that did that, not a skill. Have you checked skill damage formulas to see if any covers MP cost?
Just did. It's doing as I intended. I was hoping for something that involves coding because I'd like to have custom formulas that would take effect if the user has certain buffs/debuffs.

I can make this work, but if people have alternatives for me, I'm still all ears.
 

MikeMakes

Veteran
Veteran
Joined
Sep 30, 2015
Messages
200
Reaction score
48
First Language
English
Primarily Uses
How would I transform below into a script call in event?

Code:
this.createEventIndicators();

Spriteset_Map.prototype.createEventIndicators = function() {

    this._indicatorsField = new Sprite();

    this._baseSprite.addChild(this._indicatorsField);

    this._eventIndicators = [];

    for (var i = 0; i < this._characterSprites.length; i++) {

         this._eventIndicators[i] = new EventIndicators(this._characterSprites[i]);

         this._indicatorsField.addChild(this._eventIndicators[i]);

    };

};
 

alltheyuriz

They System is overrated
Veteran
Joined
Sep 18, 2020
Messages
423
Reaction score
237
First Language
English
Primarily Uses
RMMZ
What does Can't load source map mean

1625785984197.png
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,307
Reaction score
703
First Language
English
Primarily Uses
RMMV
It means exactly what it says, that it's unable to load a map file the game is telling it to load...but that's not a JavaScript question for this thread.
 

Warilized

Random Encounter
Veteran
Joined
Mar 19, 2018
Messages
76
Reaction score
15
First Language
Indonesia
Primarily Uses
RMMV
Hi, I wanna ask, does Makerdev not update their download link for older plugins?
Older plugin download URL is https://mvplugins.com//uploads/1060/Prefab/18-01-13-06-20-23-47377.zip where newer download URL is something like https://www.makerdevs.com/download/idQQvdZk8WM7TQWgQ.

Is there anyway to get around this? Or should I contact the plugin creator?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,307
Reaction score
703
First Language
English
Primarily Uses
RMMV
That is not a JavaScript question for this thread...also, no one here runs Makerdev, as far as I know, so they wouldn't have the answer to your question. Have you tried e-mailing support on that Web site?
 

Warilized

Random Encounter
Veteran
Joined
Mar 19, 2018
Messages
76
Reaction score
15
First Language
Indonesia
Primarily Uses
RMMV
That is not a JavaScript question for this thread...also, no one here runs Makerdev, as far as I know, so they wouldn't have the answer to your question. Have you tried e-mailing support on that Web site?
Well, it's a plugin related question that doesn't deserve it's own thread. So I assume it belong here. The site lacks a report problem or email support for that matter, I look around the site and didn't found any. Can't even log in too (or reset password).

So I'm asking this in here as a last resort.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
1,307
Reaction score
703
First Language
English
Primarily Uses
RMMV
Well, it's a plugin related question that doesn't deserve it's own thread. So I assume it belong here.
You're asking a question about technical services on another Web site entirely, not about a plugin or anything related to writing JavaScript. So insofar as it's possible for anyone here to be able to answer your question, it definitely deserves its own thread :stickytongue:
 

Warilized

Random Encounter
Veteran
Joined
Mar 19, 2018
Messages
76
Reaction score
15
First Language
Indonesia
Primarily Uses
RMMV
@ATT_Turan ah sorry then, I thought it was the right place lol, I'm a little bit desperate but if I'll just search the net for the plugin I want. Thanks for responding man.
 

Narch

Veteran
Veteran
Joined
Jan 13, 2017
Messages
68
Reaction score
10
First Language
French
Primarily Uses
Hey guys, I'm trying to change an event image using variables in a script, but I can't make it work.
This is what I tried so far :
$gameMap.event($gameVariables.value(488)).setImage($gameVariables.value(917)), 0);
$gameMap.event($gameVariables.value(488)).setImage('$gameVariables.value(917)'), 0);

The first variable has the event ID, and the second variable has the image name as a string, for exemple : !$game_random_200

I can make it work but with only one variable like this : $gameMap.event($gameVariables.value(488)).setImage('!$game_random_200', 0);

Any help on this?
 

Warilized

Random Encounter
Veteran
Joined
Mar 19, 2018
Messages
76
Reaction score
15
First Language
Indonesia
Primarily Uses
RMMV
Hey guys, I'm trying to change an event image using variables in a script, but I can't make it work.
This is what I tried so far :
$gameMap.event($gameVariables.value(488)).setImage($gameVariables.value(917)), 0);
$gameMap.event($gameVariables.value(488)).setImage('$gameVariables.value(917)'), 0);

The first variable has the event ID, and the second variable has the image name as a string, for exemple : !$game_random_200

I can make it work but with only one variable like this : $gameMap.event($gameVariables.value(488)).setImage('!$game_random_200', 0);

Any help on this?

First of all you can simplify it like this. It could also be that the second variable isn't defined as a string, try converting it to one.

Also, when you set the second variable value you could use Control Variable → Script: "!$game_random_200"or use $gameVariables.setValue(917, "!$game_random_200"), don't forget to use quotation mark (").

Code:
var src = $gameVariables.value(488),
imageId = $gameVariables.value(917).toString(); //if you set the variable using the way i mentioned above, it isn't really necessary to use .toString().
$gameMap.event(src).setImage(imageId, 0);

There's a few error in your code like there's too many ")".
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

Let's continue making our game in MZ! Touchfuzzy is... still eventing... though this time we may be working on eventing some tutorial stuff for our players!

I work late on the game so I sleep in then I wake up late so I have to work hard to make up for sleeping in meaning I work late again and sleep in again... what a nasty cycle.
I just had my first real fire. Dad made burgers for lunch and the grill caught fire. He tried to get water but I told him you should never put water on a grease fire. So I got him the fire extinguisher under the sink and we managed to put it out. I can still smell a little of the smoke coming from the patio, but at least it's clearing. It sure was scary though.
was rendering a video and window decided to bsod on me :D fun
Could not for the life of me figure out how to implement the dual/triple techs in Touch the Stars in a player-friendly way. Was describing all the problems to my wife and just rubber-ducked a solution that should work brilliantly.

Forum statistics

Threads
113,842
Messages
1,077,894
Members
147,912
Latest member
RasenNinja
Top