More weapon requirements for skills

Beriquer

Warper
Member
Joined
Dec 27, 2016
Messages
4
Reaction score
1
First Language
German
Primarily Uses
I wanted to create a warrior class with a lot of different physical skills, depending on the weapon he uses. But I felt that choosing two different weapons as a requirement for the skill wasn't enough. With Yanflys Weapon Mastery Passive (Tips and Tricks) as inspiration and Skill Core plugin I came up with a solution.

So for anyone who was looking for something like this or maybe for those who didn't know they could need it.

<Custom Requirement>
// Get all currently equipped weapons for the user.
var weapons = user.weapons();
// Set the weapon types to use the skill with. In this case weapon types 1 to 6.
var fav = [1,2,3,4,5,6];
// Set the initial condition to be false.
value = false;
// Loop through each of the weapons.
for (var i = 0; i < weapons.length; ++i) {
// Get the currently looped weapon.
var weapon = weapons;
// Check if the weapon exists and if the weapon type ID is in the array of required weapons.
if (fav.indexOf(weapon && weapon.wtypeId) !== -1) {
// Set the condition to be true.
value = true;
// Break the loop.
break;
}
}
</Custom Requirement>

This could be useful if the warrior has some melee aswell as ranged skills (with bows for example). He could now use his melee skills only with all the melee weapons and the ranged skills only with all the ranged weapons ingame.
 

imdb55

Villager
Member
Joined
Mar 27, 2017
Messages
8
Reaction score
0
First Language
Thai
Primarily Uses
RMMV
I typed your code in skill notebox, edited only red one for my one-handed, two-handed weapon types. (1,2,3,4 for one-handed weapon skill and 5,6,7 for two-handed weapon skill). but sadly it turns out skill can't be used even my characters has correct weapon equipped.

My weapon type list:
1,2,3,4 = Dagger, Sword, Axe, Mace.
5,6,7 = Greatsword, Greataxe, Warhammer.
8,9 (No prob with that) = Staff, Bow.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
@imdb55
Notetags have exactly zero function unless they're read by a plugin - and that notetag above is no exception.
So if it didn't work, either the plugin didn't work or something in the skill is not correct.

If the solution isn't as simple as you forgetting to install the plugin, please give screenshots of both the skill and your plugin manager so that we can check for your mistake.
 

imdb55

Villager
Member
Joined
Mar 27, 2017
Messages
8
Reaction score
0
First Language
Thai
Primarily Uses
RMMV
@Andar

Here's the Notetags for my Whrilwind(One-hand Skill) and Cleave(Two-hand Skill)
Sorry for copy/pasting

<Custom Requirement>

var weapons = user.weapons();

var fav = [1,2,3,4];

value = false;

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

var weapon = weapons;

if (fav.indexOf(weapon && weapon.wtypeId) !== -1) {

value = true;

break;

}

}

</Custom Requirement>

<Custom Requirement>

var weapons = user.weapons();

var fav = [5,6,7];

value = false;

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

var weapon = weapons;

if (fav.indexOf(weapon && weapon.wtypeId) !== -1) {

value = true;

break;

}

}

</Custom Requirement>

Or the SkillCore Plugin is outdated so I may download the newer one?20170326235610_1.jpg
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
and as a lot of people do, you mixed up the order of your yanfly plugins - please reorder them according to yanfly's website and start a new game after reordering.
At minimum your skill core is at the wrong position (it needs to follow the item core), so there is no surprise that you have problems with your skills. Other plugins might be in thew wrong order as well, I didn't check everything and the screenshot doesn't show all your plugins either)
 

imdb55

Villager
Member
Joined
Mar 27, 2017
Messages
8
Reaction score
0
First Language
Thai
Primarily Uses
RMMV
I reordered ItemCore and SkillCore sections and try to run BattleTest. But still unusable though. Or something wrong with my script?

And here's the rest of my plugins list you ask for (I using HIMEwork's too).20170327031007_1.jpg 20170327031041_1.jpg 20170327030835_1.jpg
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
I suggest you make your own topic for finding that bug, instead of using this one - it is more complex.
In that new topic, please link here, give the screenshots of the plugin manager again and also give the screenshots of the skills (the full data, I wasn't interested in the notebox only when I asked above)
 

Ozirisz

Villager
Member
Joined
Dec 5, 2016
Messages
10
Reaction score
8
First Language
Hungarian
Primarily Uses
RMMV
I found the bug in this code.

Just replace this:
// Get the currently looped weapon.
var weapon = weapons;

With this:
// Get the currently looped weapon.
var weapon = weapons[i ];

(the [i ] is without space, the bbcode editor parses it text formatting)

And it works perfectly for me.
I hope it helps for anybody who read this topic and trying to solve this problem. ^^
 

ArtemNevsky

Villager
Member
Joined
Nov 21, 2015
Messages
23
Reaction score
0
BUG!!!!
I found a mistake related to the enemies. If you give skill to the enemy.upload_2017-9-29_15-6-7.png
 

Kyldros

Villager
Member
Joined
Aug 8, 2016
Messages
10
Reaction score
1
First Language
Italian
Primarily Uses
RMMV
Using YEP Skill Core i have found a more simple formula for the Weapon Type equipped that it worked for me:

<Custom Requirement>
if (user.isWtypeEquipped(1)
|| user.isWtypeEquipped(2)
|| user.isWtypeEquipped(3)
|| user.isWtypeEquipped(12)
|| user.isWtypeEquipped(17)
|| user.isWtypeEquipped(38)) {
value = true;
} else {
value = false;
}
</Custom Requirement>

For add more weapon type simply add one more || user.isWtypeEquipped(#)
Or remove it for less requrement.

I hope is useful to somebody!

EDIT: The first formula that i have posted i have figure that not work very well when i tink first.

BUG!!!!
I found a mistake related to the enemies. If you give skill to the enemy.View attachment 72870
I think is because the enemies doesn't wield a weapon ; )

And sorry if i had some error language but i'm not english ^^
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top