forteller

Veteran
Veteran
Joined
Dec 2, 2013
Messages
105
Reaction score
19
First Language
English
Primarily Uses
Code:
SkillCheck v1.30
Dark Confidant
*You can now also save the name of the actor the did the skill check for you.
[SIZE=26px]Introduction[/SIZE]
A Simple Plugin to Check a certain stat among actors and set the largest of them to a variable.
it can be used for so many cool things like to see if a player can sneak pass a guard or to see 
if i player can find extra loot in a chest or find a hidden room.

[SIZE=26px]Features[/SIZE]
Find out who has the highest of each stat in your party
Current Supported Stats (ATK, DEF, MDF, AGI, LUK. MAT)
Save the largest Value as a variable of your choosing
Add a Variance like -/+ 30% to add some random chance 
save the actor that did the skill check name as a variable.

[SIZE=26px]How to Use[/SIZE]
To use this Script you use a single Plugin Command Which is Chk_Stat, where stat can be atk, def, mat, mdf, agi, or luk.
This will set the variable you have selected (Default 45) to the Highest value among your party to that Stat.
Also if you wanna add some variance just add a number to the end of the command. ie Chk_atk 45 will give you the highest atk
stat in your party +/- 45% and save it to the selected variable.

[SIZE=28px]Demo[/SIZE]
Dont think this needs one but i will put if it becomes needed

Script

Code:
var params = PluginManager.parameters("SkillCheck");

/*:
*@param Varsav
*@desc The Variable to Save the Stat Check to 
*@default 45
*
*
*@param NameSav
*@desc The Vaiable to save the name of the actor who attempted the skill check.
*@default 46
*/
var aliasPluginCommand = Game_Interpreter.prototype.pluginCommand;
var Varsav = Number(params["Varsav"]|| 45);
var NameSav = Number(params["NameSav"]|| 46);




Game_Interpreter.prototype.pluginCommand = function(command, args){
	aliasPluginCommand.call(this,command, args);
   var Size = $gameParty.members().length;
	var m =0;
    var x = 0;
    var name = null;
	if(command == "Chk_atk"){
        
        while(x<Size){
            if($gameParty.members()[x].atk>m){
                m=$gameParty.members()[x].atk;
                  name = $gameParty.members()[x].actorId(); 
                
            }
       x++ 
    
        }
     

    }
	
	
	if(command == "Chk_def"){
        while(x<Size){
            if($gameParty.members()[x].def>m){
                m=$gameParty.members()[x].def;
                  name = $gameParty.members()[x].actorId(); 
            }
       x++ }
}
	
	if(command == "Chk_mat"){
       while(x<Size){
            if($gameParty.members()[x].mat>m){
                m=$gameParty.members()[x].mat;
                  name = $gameParty.members()[x].actorId(); 
            }
       x++ }
}
		
	if(command == "Chk_mdf"){
        while(x<Size){
            if($gameParty.members()[x].mdf>m){
                m=$gameParty.members()[x].mdf;
                  name = $gameParty.members()[x].actorId(); 
            }
       x++ }
}
		

		if(command == "Chk_agi"){
 while(x<Size){
            if($gameParty.members()[x].agi>m){
                m=$gameParty.members()[x].agi;
                  name = $gameParty.members()[x].actorId(); }
       x++ }}
	if(command == "Chk_luk"){
 while(x<Size){
            if($gameParty.members()[x].luk>m){
                m=$gameParty.members()[x].luk;
                  name = $gameParty.members()[x].actorId(); }
       x++ }}
    if(args[0]>0){
       var High = Math.floor((args[0]/100)*m);
       var Low = Math.floor((args[0]/100)*-m);
    m += Math.floor(Math.random()*((High)-(Low)+1)+(Low));}
  
    console.log(name)
    $gameVariables.setValue(Varsav, m);
    $gameVariables.setValue(NameSav, $gameActors.actor(name).name());
    
}
Code:
[SIZE=28px]FAQ
[/SIZE][SIZE=12px]Q: A am getting a cannot read the property of null error
A: The plugin command is case sensitive please insure that the command read "Chk_stat" where stat is the 3 letter abbreviation for the stat in all lower case letters. [/SIZE]

 
 
Last edited by a moderator:

forteller

Veteran
Veteran
Joined
Dec 2, 2013
Messages
105
Reaction score
19
First Language
English
Primarily Uses
Plugin now saves the actor who passed the skill checks name. looking for more ideas to expand this plugin as its only my second one and id like some practice
 

Latest Threads

Latest Profile Posts

Voting for the second round of the Map Madness Tournament is now live! Vote for your favorite in each matchup! https://forums.rpgmakerweb.com/index.php?forums/map-madness-2021-polls.187/
Just bought the Visustella All Waves bundle... Time to go IN!!
Oh, I was just confirmed I'll be doing small online classes during june - july, on one side I'm nervous and looking forward it, on the other one: I've became the very thing I swore to destroy. :kaodes:
Work starts today at 2pm. I hate jeans, but the dress code says I have to wear them... That's how I discovered I was a plus size. Shopping for my first pair of jeans.
Anyhow, I'll post a new video on TheDazzlingsAreBack as soon as I'm able to.
dEj6ha4.png

WIP :)
Added some cliffs / walls / roofs to the tilesheet and am currently working on roof objects to make them prettier and more variable. And of course, windows and doors that fit to the game's style.
I also adjusted the grass color but i have some issues with my display, so if it looks weird, please let me know :)

Forum statistics

Threads
110,573
Messages
1,054,308
Members
143,685
Latest member
Yatsuzuka_Kou
Top