Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Script combining help.

Seda

Member

first off, I am not sure if this is the right spot to post this one or not, but here goes!

Okay, So I am trying to combine 2 scripts to make them work together.
I am currently using Tenkentai's SBS and Moghunter's shop menu (both for RMXP)

So far, everything is working alright. EXCEPT for 1 little issue! There seems to be an issue with displaying
the armors stats. It always displays the defense increase as if the a character was not wearing any armor at all.
Here is an example:

This is what the character currently has equipped.

CurrentEquips.png

Now here is what the shop is offering to me:

ShopOffer.png

I am trying to get it so that the shop reads the difference normally. Similar to what it does with weapons.

Like this:

shopsweapons.png

So over all, I wondering if anyone knows how to fix the armor read out in shops, to make it similar to the weapon readout, where it compares what you currently have equipped to what the weapon you are looking at?
 
Script Support is for help for 'doing it yourself'
Script Requests is for asking someone else to do it for you.

The shop should show +0 since he already has Iron Plate equipped, yes?

I don't have Mog's shop script, but if no one else jumps on this I'll take a look. it's most likely in the window class for that specific shop window where it draws the text. See which variables it's using, then trace them back to where they get calculated. Cntl-Shift-F (global search) is your friend! :scruff:
 

Seda

Member

Yeah, I want the shop to show +0 for the armor, since he already has the Iron Plate equipped. Reason I posted here was because It was kind of a mix of both doing it myself, and asking someone to do it for me. Hehe ;^^

If need be, I can post the 2 scripts, with the edits I've done!

Edit: Alright, so I just went ahead and created a "Demo" with the scripts combined and working as close as I can get it.

 
Ok, I added a 'print item1' before line 2331 of Actor Advanced Status, and never saw a print window, so that means that item1 is not getting assigned in that if statement. It must be something in the 'if' statement....

if $data_armors[actor.equip_id[n]].type == @item.type_id and not

$data_armors[actor.equip_id[n]].type is returning RPG::Armor (an object type)
@item.type_id is returning an integer

they will never match

Try comparing what he's doing to the default code in Window_ShopStatus (around line 54-85)

I don't see where .type is defined for an RPG::Armor or a parent class????
but we should be testing 'kind' instead.
 

Seda

Member

I'm going to be honest here. I am still very very new to scripting scene, and I am a little lost as to what you are trying to tell me. :biggrin:

So.. something about them never being able to match because of a line of code, and having to check the original Window_ShopStatus script?
 
Try moving the MOG scripts below the other scripts. below "Overdrive" & above "Main"

Overdrive
MOG - Scene Shop
MOG - Scene Equip
----------------------------
Main

This will give you the MOG style status that lists 3 attributes separately ( PDEF MDEF EVA ) for armor, (ATK PDEF MDEF ) for weapons
 

Seda

Member

Uhm... This is interesting.. It seems to work fine in the "Demo" I put out, but everything breaks down in the original game... It doesn't want to update the hero's equips in the shop window... :crazy:

Edit: Okay, so the issue here is:
I want to keep the Equip Window (MOG-Scene Equip) the same it currently is (unmoved, my with my edits) Through moving the scripts, the equipment window becomes all messed, and you cannot switch equips around at all. But by moving the MOG-Scene Shop, it comes even closer to what I want. It just won't update the shop (example: Purchase a Iron Sword from the shop, equip it, go back to the shop, it still shows that you have the previous Bronze Sword equipped).

Here are some changes I have made...

 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top