Characters who's basic attack scales of Magic instead of Strength?

AMGLime

Veteran
Veteran
Joined
Dec 2, 2015
Messages
87
Reaction score
45
First Language
English
Title basically says it all, I've been trying to make two of my characaters Normal Attack scale off Magic instead of Attack. Does anyone know a way to do this, or will I have to find a plug in to allow this? My reasoning is, I find it weird that someone who uses a Book can walk up and smack them with it and deal as much damage as a Sword, or someone who uses a rod does much the same. I'd rather they sit back and shoot a spell from it instead.
 

Kenen

Veteran
Veteran
Joined
Apr 3, 2012
Messages
256
Reaction score
153
First Language
English
Primarily Uses
RMMV
You need a plugin to modify the attack skill ID, but it's super easy to do:

Code:
Game_BattlerBase.prototype.attackSkillId = function() {    if (this._actorId === 1) {        return 30; // actor 1's Attack command will use skill #30    }    else {        return 1; // everyone else    }};
 

AMGLime

Veteran
Veteran
Joined
Dec 2, 2015
Messages
87
Reaction score
45
First Language
English
Do you know what Plug In I could use to do this?
 

Zetu

Level 99 Stabomancer
Veteran
Joined
Apr 28, 2012
Messages
247
Reaction score
99
First Language
English
Primarily Uses
N/A
//=============================================================================


// WeaponSkillByType.js


//=============================================================================


/*:


* @param Weapon Skill Attack


* @desc The Skill ID for weapon attack, Comma Delimited (WeaponID:SkillID)


* @default 6:2,12:2


*


* @param Default Attack Skill ID


* @desc The Skill ID for weapon attack


* @default 1


*/


(function() {


var weaponSkillTypeIDs = String(parameters['Weapon Skill Attack'] || '');


var defaultAttackSkillID = parseInt(String(parameters['Default Attack Skill ID'] || '0'));


Game_Actor.prototype.attackSkillId = function () {


  var skillID = defaultAttackSkillID;


  if (this.hasNoWeapons()) return defaultAttackSkillID;


  var weaponTypeID = this.weapons()[0].wtypeId;


  var matches = weaponSkillTypeIDs.match(/\d+:\d+/g);


  if (matches != null) {


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


    var m = matches.match(/(\d+) :( \d+)/);


    if (parseInt(m[1]) == weaponTypeID) return parseInt(m[2]);



   }



  }



  return defaultAttackSkillID;



}



})();
 

AMGLime

Veteran
Veteran
Joined
Dec 2, 2015
Messages
87
Reaction score
45
First Language
English
Thanks Zetu, but how do I work it once it's installed Code is just jumped letters to me?
 

Prizm Daystar

Social Butt
Veteran
Joined
Nov 22, 2015
Messages
80
Reaction score
19
First Language
English
For Zetu's plugin --

Step 1 of the code is asking if the Attack being used has a weapon tied to it.

If it doesn't -- it returns the Skill ID for regular Attack, which does physical damage.

If it does -- it checks the weapon and stores the value of the Skill ID in your database that uses magical attack value in place of physical damage.

Step 2 of the code looks a little weird, but it's checking for if the Weapon ID and the Skill ID match, and then correcting it if it doesn't?  Maybe I'm wrong.  I mean, I'm not that great at actually reading code.

This script is useful for if your casters use different types of weapons, some physical and some not.  It doesn't need any alteration, but it's a mess to read if you're not experienced at code, however.  That if to for check gave me a small headache in concentration...

==

For Kenen's plugin --

It checks to see which character is attacking (assuming they wield a weapon type unique to them), and then uses an alternative attack command (from your Skills Database) that is tied to magic attack instead of physical attack. 

A much simpler script to read and even write.  It could even be altered to work with Class IDs instead of Actor IDs, if you ever put class changing into your game. 

Come to think of it...I ought to copy and mod Kenen's to class ID for use in my projects. 

==

What I had been doing before bimping into this was adding physical and magical attack power to caster weapons, but keeping most of the physical values lower to emphasize that they're a caster, not a fighter.
 
Last edited by a moderator:

AMGLime

Veteran
Veteran
Joined
Dec 2, 2015
Messages
87
Reaction score
45
First Language
English
I'm so lost with these plug ins it makes me cry. This is like reading backwards with no eyes.
 

Prizm Daystar

Social Butt
Veteran
Joined
Nov 22, 2015
Messages
80
Reaction score
19
First Language
English
I'm so lost with these plug ins it makes me cry. This is like reading backwards with no eyes.
I'm not trying to be mean, but I'm also not going to beat around the bush:

You don't sound like you have any experience in programming at all.  I have very little, and that only from a childhood fascination that got ran into the ground by a buffoon of a high-school math teacher; let's just say that even if math and code have similarities, a math teacher a programming teacher does not make.   Trust in the work of those who have a significant amount of experience with it.  You're just intimidated by the skeleton of game design, which is code to begin with.

As for the plugins?  Just highlight the code written, copy and paste it into something like Notepad++, and then save it as a NameCredit_MagicAttackScript.js file.  Put them into the js\plugins folder of your project.  See which one works best for you.
 
Last edited by a moderator:

AMGLime

Veteran
Veteran
Joined
Dec 2, 2015
Messages
87
Reaction score
45
First Language
English
I'm not trying to be mean, but I'm also not going to beat around the bush:

You don't sound like you have any experience in programming at all.  I have very little, and that only from a childhood fascination that got ran into the ground by a buffoon of a high-school math teacher; let's just say that even if math and code have similarities, a math teacher a programming teacher does not make.   Trust in the work of those who have a significant amount of experience with it.  You're just intimidated by the skeleton of game design, which is code to begin with.

As for the plugins?  Just highlight the code written, copy and paste it into something like Notepad++, and then save it as a NameCredit_MagicAttackScript.js file.  Put them into the js\plugins folder of your project.  See which one works best for you.
I've done that. They're not like Yanfly and telling me how to make them work, I have lots of Plugins, but they tell me how to use them. These ones don't tell me anything, which is why I asked how to use them. I need to know if I put something like <skillID=3> or something on my equipment that has the different animations. Thats why I'm confused, all I have is the code, and I can't read code. So I have -NO- idea what I'm supposed to do with them once they're plugged in.
 

lohenien

Veteran
Veteran
Joined
Mar 15, 2012
Messages
153
Reaction score
7
First Language
english
You need to take a beginners programming course, it's imperative to have a basic understanding of what you are looking at if you want to make use of any game making program.
 

AMGLime

Veteran
Veteran
Joined
Dec 2, 2015
Messages
87
Reaction score
45
First Language
English
You need to take a beginners programming course, it's imperative to have a basic understanding of what you are looking at if you want to make use of any game making program.
Why do I need to know programming, it's never interested me, I'm more into the mapping, and story development side of things. If I'm looking for something, someone else has made it or is making it so I can wait. Every plug in I've used so far has came with a little guide telling me what I need to know and what the commands for it are. I'm just asking what the commands to change my Attack for the characters weapon is, for either of the plug ins.

EDIT: Reading my past two comments, they can come across as malicious when that isn't my intent, Holidays with a huge family is making me irritable so I apologize if I come across wrong. I love you all, I just want to know how to make one of these work. 
 
Last edited by a moderator:

lohenien

Veteran
Veteran
Joined
Mar 15, 2012
Messages
153
Reaction score
7
First Language
english
By the looks of it, the code Zetu posted sets the default attack to a skill type based on what kind of weapon you are using. The code Kenen posted sets the default attack based on individual actors. Knowing even a little bit about programming lets you glance over something and get a gist of how it is working. I don't know javascript well but my c++ knowledge helps me figure out what I'm looking at.
 

AMGLime

Veteran
Veteran
Joined
Dec 2, 2015
Messages
87
Reaction score
45
First Language
English
By the looks of it, the code Zetu posted sets the default attack to a skill type based on what kind of weapon you are using. The code Kenen posted sets the default attack based on individual actors. Knowing even a little bit about programming lets you glance over something and get a gist of how it is working. I don't know javascript well but my c++ knowledge helps me figure out what I'm looking at.
Yeah, I've been having my brother look through it since he's a programmer, and that's what he's been saying. I'll probably bring my laptop over to his place so he can look at it because neither of us can tell how to set it to be a specific weapon, or how to set it to the specific actor. Both options work, it's just getting it working.
 

Prizm Daystar

Social Butt
Veteran
Joined
Nov 22, 2015
Messages
80
Reaction score
19
First Language
English
I've done that. They're not like Yanfly and telling me how to make them work, I have lots of Plugins, but they tell me how to use them. These ones don't tell me anything, which is why I asked how to use them. I need to know if I put something like <skillID=3> or something on my equipment that has the different animations. Thats why I'm confused, all I have is the code, and I can't read code. So I have -NO- idea what I'm supposed to do with them once they're plugged in.
Ah, no.  I know.  That's why I was trying to translate that gobbledegook. 

DOUBLE EDIT:  As for your Skill and Weapon IDs?  Those are in the project's database.  They're the attacks, spells, and weapons that it refers to.  So WeaponID=1 would be Sword, or whatever you have up there in slot one of the Weapons Database.  There's a number next to every skill, item, equipment, enemy, troop, tileset, actor, class, animation, and others I might not have remembered.  Those numbers are the IDs.

==

EDIT: 

From lohenien:  "By the looks of it, the code Zetu posted sets the default attack to a skill type based on what kind of weapon you are using. The code Kenen posted sets the default attack based on individual actors. Knowing even a little bit about programming lets you glance over something and get a gist of how it is working. I don't know javascript well but my c++ knowledge helps me figure out what I'm looking at."

That's what I said, too.
 
Last edited by a moderator:

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

Latest Threads

Latest Profile Posts

If I recorded while I created (what I think is) a small plugin, would you be interested enough in the process to watch it?
I keep trying to explain to clients that the huddle masses behind the old K-Mart are a Fallout Reenactment group. Somehow I don't think they believe me. :LZSskeptic:
Hey people! What do you think about a core plugin? This will save some lines of code that I repeatedly use in all my plugins...
Wondering if I should make my enemies scale in my non-linear rpg. I'm leaning towards yes, but I don't want to use Yanfly's plugin...
French folk trying to pronounce English words. I loved how the man pronounced squirrel as 'square friend'.

Forum statistics

Threads
94,594
Messages
922,164
Members
124,464
Latest member
foghiszdenisz
Top