Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.
Original Source
- Original title: Need help with Yanfly's Enemy Thieves Tips and Tricks code.
- Original author: Little Adventurer
- Original date: April 4, 2016
- Source thread: https://forums.rpgmakerweb.com/threads/need-help-with-yanflys-enemy-thieves-tips-and-tricks-code.59971/
- Source forum path: Game Development Engines > RPG Maker Javascript Plugins > Javascript/Plugin Support
Summary
After Eval> if (user.isEnemy(1)) { var successRate = 0.5; if (Math.random(1) < successRate) {
Archived First Post
After Eval>
if (user.isEnemy(1)) {
var successRate = 0.5;
if (Math.random(1) < successRate) {
var items = [1];
var total = $gameParty.items(1).length;
for (var i = 0; i < total; ++i) {
var item = $gameParty.items(1);
if (item.itypeId !== 2) items.push(item);
}
var random = Math.floor(Math.random() * items.length);
var item = items[random];
$gameParty.loseItem(item, 1);
var text = user.name(1) + ' stole ' + item.name + ' from the party!';
SoundManager.playEquip(1);
} else {
var text = user.name(1) + ' failed to steal an item!';
SoundManager.playBuzzer(1);
}
var window = SceneManager._scene._logWindow;
window._lines.push(text + '<CENTER>');
window.refresh(1);
}
</After Eval>
Okay, I must be doing something wrong here. I just tried to do the Enemy Thieves thing with my Steal Item (partially to see if it was successfully working and partially because I'm trying to still do the "Enemies Steal Weapons thing") skill. At first I copy pasted the code exactly as you put it in the video. That got me this. I tried again, adding in numbers to any paratheses I found. Same result when the Slime went up to perform the Pilfer action.
For what it's worth, here's the code for the regular action:
<Steal Item>
<setup action>
display action
immortal: targets, true
</setup action>
<target action>
move user: targets, front, 20
motion standby: user
wait for movement
face user: target
action animation: target
move user: targets, base, 10
motion thrust: user, no weapon
wait: 15
action effect
jump user: 50, 10
move user: targets, front, 10
face user: forward
wait: 60
</target action>
Does anybody know what I'm doing wrong?
Protected download
Downloads / Referenced Files
Log in to download
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadReferenced Images / Attachments
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
0
replies
1
view
Topic Summary
Loading summary...
