Opposite of \lastGet (Plugin Edit)

Status
Not open for further replies.

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
659
Reaction score
1,121
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
147
Reaction score
163
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
659
Reaction score
1,121
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
7,447
Reaction score
5,079
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 Profile Posts

Resident Evil: Infinite Darkness :LZSgrin:
I am excite.
Actor2_4 added!

I Didnt Like or Disagree with @Andar Due to Him Saying this when We talk about VX (Not Ace): VX is the worst version of the RPG-Makers as it had only one tileset and is missing many features to improve the game development. It is a very bad choice to base a new project on.
It seems to me that I'm too lazy to make new MZ plugins with my full time job, so I'm porting my easy, simple and small MV plugins instead.
I hope I can port 1-2 such plugins per day, but this will be hard for me :)
just mechin' around this morning - MZ edit, feel free to use, must own MZ

Forum statistics

Threads
103,321
Messages
998,760
Members
134,830
Latest member
Monotaru
Top