JavaScript questions that don't deserve their own thread

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
127
Reaction score
69
First Language
French
Primarily Uses
RMMV
Try using

JavaScript:
$dataQuests[questID];
This might just return the entire quest, rather than the name.
I don't know how it's structured. If you can use that code above in the console and post a screenshot, then I can give u more details.
It was $dataQuests[questId].name. Thank you very much!

In case anybody's having this issue in the future, here's what I'm putting in the Lunatic Mode code that's executed when a quest is added:
JavaScript:
var cmd = new Game_Interpreter();
var line = 'New quest: ' + $dataQuests[questId].name;
cmd.pluginCommand('GabText', [line]);
cmd.pluginCommand('ShowGab');
This will display the Gab window "New quest: " followed by the name of the quest (with its text codes) exactly like you entered it in the plugin settings of the Quest Journal plugin.
 

MikeMakes

Veteran
Veteran
Joined
Sep 30, 2015
Messages
186
Reaction score
46
First Language
English
Primarily Uses
Hi,

How do I clear/erase a drawn rectangle?:

Window_Label.prototype.drawDarkRect = function(dx, dy, dw, dh) {
var color = this.textColor(1);
this.changePaintOpacity(false);
this.contents.fillRect(dx + 1, dy + 1, dw - 2, dh - 2, color);
this.changePaintOpacity(true);
};



this.createContents();
this.drawDarkRect(0, 0, 600, this.lineHeight());
 

Lanzy

Veteran
Veteran
Joined
Feb 29, 2020
Messages
128
Reaction score
54
First Language
English
Primarily Uses
RMMV
Hi,

How do I clear/erase a drawn rectangle?:

Window_Label.prototype.drawDarkRect = function(dx, dy, dw, dh) {
var color = this.textColor(1);
this.changePaintOpacity(false);
this.contents.fillRect(dx + 1, dy + 1, dw - 2, dh - 2, color);
this.changePaintOpacity(true);
};



this.createContents();
this.drawDarkRect(0, 0, 600, this.lineHeight());
myWindow.contents.clearRect(x, y, width, height)
 

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
127
Reaction score
69
First Language
French
Primarily Uses
RMMV
Is there a way to check if a skill's targeting type is 1 enemy and not anything else?

I want to make a "chance to taunt" state that can redirect skills to the battler that gave it using user.currentAction().setTarget(origin.index()) but remove the ability to redirect skills that hit random targets or all of them because that wouldn't make sense.

EDIT: solved.
JavaScript:
<Custom Action Start Effect>
action = user.currentAction();
//if the scope isn't "1 enemy", action._targetIndex = -1
//otherwise, it's the index of the target, 0 or higher
if(action._targetIndex >= 0) {
  if(Math.random() <= 0.5) { //roll for redirection
    action.setTarget(origin.index()); //we change the target to origin
  }
}
</Custom Action Start Effect>
 
Last edited:

Lanzy

Veteran
Veteran
Joined
Feb 29, 2020
Messages
128
Reaction score
54
First Language
English
Primarily Uses
RMMV
Is there a way to check if a skill's targeting type is 1 enemy and not anything else?

I want to make a "chance to taunt" state that can redirect skills to the battler that gave it using user.currentAction().setTarget(origin.index()) but remove the ability to redirect skills that hit random targets or all of them because that wouldn't make sense.
I don't know what plugins you are using, but generally you can check the scope of a skill like this:

JavaScript:
$dataSkills[x].scope // scope = 1 is for targeting 1 enemy
 

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
127
Reaction score
69
First Language
French
Primarily Uses
RMMV
I don't know what plugins you are using, but generally you can check the scope of a skill like this:

JavaScript:
$dataSkills[x].scope // scope = 1 is for targeting 1 enemy
It was all using the Buffs and States Core. I found my own solution in the meantime, so I edited it into my message. It took a lot of console.log() commands, but despite how hard the console makes everything slow down, I found a way.

Thank you for your time, though.
 

raffle

Veteran
Veteran
Joined
Oct 25, 2020
Messages
30
Reaction score
4
First Language
English
Primarily Uses
RMMV
With YEP_BattleEngineCore how do I center the battle text?


I hate how it looks on the left but I looked everywhere and I couldn't find an option to switch its position or maybe I'm just a dummy!
 

CHKNRAVE

Surprisingly not sponsored by Yanfly.
Veteran
Joined
May 11, 2020
Messages
127
Reaction score
69
First Language
French
Primarily Uses
RMMV
With YEP_BattleEngineCore how do I center the battle text?

I hate how it looks on the left but I looked everywhere and I couldn't find an option to switch its position or maybe I'm just a dummy!
Write <CENTER> (case-sensitive, so make sure it's in all caps) anywhere in the message.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Star citizen just announced they will develop a roadmap for their planned roadmap...
And i thought i needed order on my project... :kaoswt2:
Big City Greens had it right:
"Always back up your brain game, that's what I like to say!"
I think I've created a monster.
...and I love it. <3
Today represents my one year anniversary of throwing out the tile map. :LZSexcite: One year ago my game looked like...


And now for those that don't know, it looks like..


What a year, what a year indeed. RIP Tile Map, nobody misses you. :LZSwink:
There is now a demo released for [Beyond the Mirror]! Check the team recruitment thread to learn more!

Forum statistics

Threads
105,701
Messages
1,015,733
Members
137,384
Latest member
nobodyreally
Top