I'm trying to reference an actor's magic attack parameter without using a variable as an intermediary.
The end goal is for a weapon's attack bonus to be equal to the character's mat. Since the weapon can only be equipped by one specific character I'm directly referencing his stats, but I'm open to anything that works. Everything is working except the call for this value.
I'm currently using this:
<Custom Parameters>
atk = $gameActors.actor(2).mat
</Custom Parameters>
I've tried a lot of different things, but this is the attempt that seems less wrong... it returns a range error that prevents the game from running. Most of my attempts result in this error. Though sometimes my attempts result in the game using the value "NaN".
If I put an integer to the right of the equal sign it works. If I put a parameter (mhp, mmp, atk, def, mat, mdf, agi, luk) right of the equal sign, it works but it uses the weapon's parameter rather than the actor's.
I've spent two nights google and forum searching for anything that might provide insight, but either there's nothing to be found or I'm not using the right keywords. Anyone able/willing to help?
Anyway. I figure I'm just a noob and this doesn't deserve a topic.
Nevermind! Solved it!
<Custom Parameters>
atk = user.paramBase(4)
</Custom Parameters>
So proud of myself!
So turns out my issue wan't the aliasing
What i had:
(function() {
var oldcanequip = Game_BattlerBase.prototype.canEquipWeapon;
Game_BattlerBase.prototype.canEquipWeapon = function(item) {
return false;
};
});
Turns out I was missing the () at the end:
(function() {
var oldcanequip = Game_BattlerBase.prototype.canEquipWeapon;
Game_BattlerBase.prototype.canEquipWeapon = function(item) {
return false;
};
})();
now works correctly
*Facedesking
Thank you Shaz, I think i'll post this question in the Yanfly Script help. I appreciate your direction and response!
I want to make an accessory with Yanfly's Equip Core and it's custom parameters, that changes Element Rate based off of the characters level, and was wondering if that's even possible? (Or should I post it as a suggestion in Yanfly's thread?)
If it is, what I wanted to do is:
Element Rate % = 100 - Character's Level.
In the help files of these two default plugins, ItemBook.js and EnemyBook.js, I've made an event where the player can talk to a person to get the books. They are read from the menu item screen (connected a common event to open). Then consecutive conversations adds individual entries and completes the entries. I want the player to unlock the entries by talking to people, so placing the plugin command directly into the event should unlock it but it doesn't work.
Where would I place the following commands: "ItemBook add 3" and "EnemyBook add 3" or "ItemBook Complete"?
EDIT: I've figured out what went wrong. I was typing the commands incorrectly. I wrote "Itembook add 1" when it should have been "ItemBook add item 1" and same goes for the Enemy Book.
I'm going to try the revised events in an older project to see if it was just a simple misspelling.
EDIT 2: Yep it was. It works now! 😀 Capitalization matters.
I'm trying to make a skill that deals more damage if the actor is equipped with a Claw (type id 10).
if (a.equips[0].wtype == 10){x = a.atk * 2.5} else {x = a.atk}; x * (1 - (b.def / (b.def + 100)));but it returns me 0. is it wrong? I tried to follow the example in the script calls doc...
I need to use the space key so I commented out this line in rpg_core.js:
Input.keyMapper = {
...
//32: 'ok', // space
...
}
This is the only mention I can find for the word "space". It doesn't work, space still triggers 'ok'.
Is it called somewhere else?
EDIT: It worked, it turned out to just be a caching issue.
.
Not sure where to ask this, so I'll ask it here...
I've modified the pause menu's "Gold Window" to display the current playtime. It technically works, but it doesn't update while the menu is open. (So if it shows 5 minutes of playtime when the menu is opened, it won't change from that until the menu is closed and re-opened).
I've tried a few things to try to make the window update, but I'm not sure how to get it to work. Is there a way in the scene/window functions to call the refresh function every so many frames?
Hey guys! I have a few questions when it comes to making a custom status menu.
My first step with every project is to try to swap around the status menu in order to compact everything in a reasonable way, and show more information. With this in mind, I have a few questions. How can I add flat text to the screen? For example, I would like to add the text "Class: " next to the class of the character, as well as add names of particular stats to the editor that usually aren't shown.
If possible, I would like to change the font size specifically while in the menu.
And how would I add extra parameters to the ones displayed in the menus already. For example, adding the critical hit rate, or the evasion rate so it sits under he luck stat for viewing. I may not fully understand Javascript yet, but I like to do something simple like this so I know I'm a bit more familiar with it. Can anyone please help with some general tips?
I've gotten as far as to reaching the Window_Status area in the editor, and have been able to edit certain assets, but I can't figure out much more than that.
I believe the refresh methods are only called on demand, and the update methods are called every frame.
Copy the refresh method into the update method and see if it updates. Or better yet, create an update method that simply calls this.refresh()
And be prepared for a possible slight performance hit as it is clearing and redrawing the contents on every frame.
@Jackkel Dragon
Maybe try to add some kind of timer to your update method to refresh it on every 60 frames ( == 1 second) ?
Scene_Menu.prototype.initialize = function(){ // Here goes the original code, and at the end add : this._updateTimer = 0;}Scene_Menu.prototype.update = function(){ // Original code ... this._updateTimer += 1; if(this._updateTimer >= 60) { this._updateTimer = 0; // And refresh the window here. }}Sorry, I'm still new to this, but I know how we did such things in VXAce.
On the other note, a question that I know it has been asked many times, what is the alias alternative in JS?
I know people asked that, I just can't find where...