LordOfPotatos

Villager
Member
Joined
Oct 9, 2015
Messages
12
Reaction score
3
First Language
english
Primarily Uses
Is it possible to give the player an equip that comes with an attachment? if it's possible can you randomize it?

I imagine you can use the functions the plugin uses to make new equips when the player uses an attachment from the menu but this seems to be beyond my ability.
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
551
Reaction score
530
First Language
german
Primarily Uses
RMMZ
This is a script that I used. It's not 100% perfect and may need some tuning, but it can be a good starting point for you. This script will take the weapon called "Blaster" and attach the augment "Glyph of the Voltage" on it if the Party has both items.

Code:
let weapon = $gameParty.allItems().find(item => item.name == "Blaster");
let augment = $gameParty.allItems().find(item => item.name == "Glyph of the Voltage");

if (weapon && item)
    ItemManager.applyAugmentEffects(weapon, augment, 0, 1);
The 0 represents the slotId and 1 represents "gain", but I forgot what exactly "gain" means.
 

LordOfPotatos

Villager
Member
Joined
Oct 9, 2015
Messages
12
Reaction score
3
First Language
english
Primarily Uses
oh so you just add the equip and the item and then use the item on the new equip.
that seems so obvious now XD
thank you!
 

LordOfPotatos

Villager
Member
Joined
Oct 9, 2015
Messages
12
Reaction score
3
First Language
english
Primarily Uses
got the randomized version working :D

Code:
$gameParty.gainItem($dataWeapons[$gameVariables.value(1)], 1, false);
$gameParty.gainItem($dataItems[$gameVariables.value(2)], 1);

weapon = $gameParty.allItems().find(item => item.name == $dataWeapons[$gameVariables.value(1)].name);
augment = $gameParty.allItems().find(item => item.name == $dataItems[$gameVariables.value(2)].name);

ItemManager.applyAugmentEffects(weapon, augment, 0, 1);
 

Latest Threads

Latest Posts

Latest Profile Posts

Gotta love when RM just decides it's done with existence and closes when you're in an event.
Good grief am I ever so dusty on music creation. Never move, gentleman and ladies!
After waiting for several months to observe the results of vaccines, I finally decided to go for Comirnaty, because now my job needs me to either be vaccinated or take a regular testing every 2 weeks(240 HKD per test), and it seems to me that Comirnaty is safe enough in my case :)
So, to create multiple faces one needs to first export, then import, over and over... who came up with this weird mechanism...
Away from home now since it reduce COVID spread

Forum statistics

Threads
112,316
Messages
1,067,313
Members
145,946
Latest member
StarAngel969
Top