Opposite of \lastGet (Plugin Edit)

Status
Not open for further replies.

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
527
Reaction score
865
First Language
English
Primarily Uses
N/A
I try editing "Last Get" Text plugin for an opposite counterpart, "Loss Get"

About "Last Get" Text plugin-
When using \lastGet in Text, it'll display icon and item name in message.

Features
- Shows icon and item name in text
- Also include text for gold increase

Example-


For "Loss Get"
On event page, I subtracted a potion by 1
Then Show Text: You lose \lossGet !
Also subtracted gold by this amount -1234
Follow by Show Text: You lost \lossGet !

However \lossGet appears like this in Text Window.
"You lose !"
"You lost !"
On \lossGet, the name and the icon suppose to show.

Note: Quantity of potion is more than 1 from the start. "Last Get" isn't affected.
"Last Get" and "Loss Get" appears to work together, there are no error popups.

\lastGet (original) download:
https://www.dropbox.com/s/oywgu4213fvaucf/Torigoya_TextLastGet.js?dl=1

\lossGet (edited) download:
https://www.dropbox.com/s/8otag963x9pd9bh/Torigoya_TextLossGet.js?dl=1

Edits I done are cheap with changing variable phrases.
Maybe the issue has something to do with this line?
Code:
if (amount < 0) {
 

Magnus0808

Software Developer
Veteran
Joined
Feb 2, 2019
Messages
118
Reaction score
116
First Language
Danish
Primarily Uses
RMMV
Hi, you have a couple of mistakes. The largest one is you accidently called 'Window_Base.prototype.processEscapeCharacter' for Window_Base.prototype.processEscapeCode. Which means that it wouldn't even process '\lossGet'.

The other mistake isn't as obvious. You use 'Game_Party.prototype.loseItem' instead of 'Game_Party.prototype.gainItem'. This may seem weird, but the 'Change Items' event command calls 'Game_Interpreter.prototype.command126' which calls 'Game_Party.prototype.gainItem' here you should actually use 'if (amount < 0) {' as when you lose an item the amount is negative in 'gainItem'. :)
 

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
527
Reaction score
865
First Language
English
Primarily Uses
N/A
Shoot, I forgot to update dropbox link with the project js file with "Window_Base.prototype.processEscapeCharacter" change. Thanks for pointing that out.

Ah, it's fine to use 'if (amount < 0) {' when 'Game_Party.prototype.gainItem' is called. Not much to edit other than setting \lossGet, amount > to < 0.

Thank you for the explanation :) Able to get \lossGet showing.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
5,874
Reaction score
4,212
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

-_- Now we have punishments for skipping meals, specially breakfast. At least let me sleep on Fridays -_-
colorize an old sketch
Welp... with numerous plugins and a bit of Javascript help, I've simulated an AP system in battle. Proud of myself honestly.
Why most of games like to give a horrible control to an aircraft vehicle? can I get a simplified control that does not require me to roll first just to change my direction?
Homie, this so amazing! Old but Gold :)

Forum statistics

Threads
93,430
Messages
912,285
Members
122,938
Latest member
pafell2
Top