[RGSS3] Script modification - Gambit Icon List

ZirconStorms

Veteran
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
111
First Language
English
Primarily Uses
RMVXA
Script can be found here: https://www.rpgmakercentral.com/topic/15788-gambit-icon-list/

The script uses database item descriptions in order to get the "unlocked" descriptions for specific achievements.
However, there is only one universal "locked" achievement description, that's specified in the script:

VocabLockIconHelpWindowLine1 = "You have not unlocked this item!"
VocabLockIconHelpWindowLine2 = ""

I was wondering if there's a way to get individual descriptions for locked achievements? Maybe something done inside of the item note window could work, but I'm open to descriptions being written inside of the script, too.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
the problem with that idea is that you can either use a single vocab for everything, or you'll need to load the vocab from the item itself. The second option is possible, but it needs notetags and a redirection of the script to load from those notetags.
so yes, it can be done but it is a bigger change to the original script.
 

ZirconStorms

Veteran
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
111
First Language
English
Primarily Uses
RMVXA
the problem with that idea is that you can either use a single vocab for everything, or you'll need to load the vocab from the item itself. The second option is possible, but it needs notetags and a redirection of the script to load from those notetags.
so yes, it can be done but it is a bigger change to the original script.
Thought as much. Notetags would be a lot more painful to set up regardless.

I suppose I could use individual vocab lines and add a ton of if statements, but I have no clue what the "if ___ " would be.
Something like item.icon_index == [numberhere] maybe?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
Yes - and that is exactly why it wouldn't work with ifs in the code.
It could be done with ifs, but then the resulting script would be custom-fit to your game only.
And custom scripts usually require something in return, while general scripts that are usable by anyone (like the notetag based Variant) might get someone interested for free.
 

ZirconStorms

Veteran
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
111
First Language
English
Primarily Uses
RMVXA
Yes - and that is exactly why it wouldn't work with ifs in the code.
It could be done with ifs, but then the resulting script would be custom-fit to your game only.
And custom scripts usually require something in return, while general scripts that are usable by anyone (like the notetag based Variant) might get someone interested for free.
I'd be fine with writing the edits myself. Some help on figuring out what I need to check with "if" statements is all I'd ask.
So far I've tried "if $data_items[number]" "if $data_items == [number]" and "if $game_party.icon_list[number]" but none of these have worked.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,594
Reaction score
6,525
First Language
Indonesian
Primarily Uses
RMVXA
To be frank, the script structure is kinda ... funny. Editing that will require some 'twist', since I won't be doing it like that if I were to create a same system.

I'd prefer approach of notetag for each item, but I see you're not fond of it.
The draw help is being draw in update_help
Code:
  def update_help
    if item
      desc = $data_items[item].description
      if Gambit::IconList::EnableNumber
        if desc.match(/\n/)
          desc += sprintf(" %s %d/%d", Gambit::IconList::VocabIcon,
          index + 1, item_max)
        else
          desc += "\n" + sprintf("%s %d/%d", Gambit::IconList::VocabIcon,
          index + 1, item_max)
        end
      end
      @help_window.set_text(desc)
    else
      @help_window.set_text(Gambit::IconList::VocabLockIconHelpWindowLine1 +
        "\n" + (Gambit::IconList::VocabLockIconHelpWindowLine2 == "" ? "" :
        Gambit::IconList::VocabLockIconHelpWindowLine2 + " ") + 
        (Gambit::IconList::EnableNumber ? sprintf("%s %d/%d",
        Gambit::IconList::VocabIcon, index + 1, item_max) : ""))
    end
  end
If you want to customize stuff, you want to add an "elsif" there like
Screenshot_453.png

Disclaimer: I didn't test it myself so it may or may not work.
 

ZirconStorms

Veteran
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
111
First Language
English
Primarily Uses
RMVXA
To be frank, the script structure is kinda ... funny. Editing that will require some 'twist', since I won't be doing it like that if I were to create a same system.

I'd prefer approach of notetag for each item, but I see you're not fond of it.
The draw help is being draw in update_help
Code:
  def update_help
    if item
      desc = $data_items[item].description
      if Gambit::IconList::EnableNumber
        if desc.match(/\n/)
          desc += sprintf(" %s %d/%d", Gambit::IconList::VocabIcon,
          index + 1, item_max)
        else
          desc += "\n" + sprintf("%s %d/%d", Gambit::IconList::VocabIcon,
          index + 1, item_max)
        end
      end
      @help_window.set_text(desc)
    else
      @help_window.set_text(Gambit::IconList::VocabLockIconHelpWindowLine1 +
        "\n" + (Gambit::IconList::VocabLockIconHelpWindowLine2 == "" ? "" :
        Gambit::IconList::VocabLockIconHelpWindowLine2 + " ") +
        (Gambit::IconList::EnableNumber ? sprintf("%s %d/%d",
        Gambit::IconList::VocabIcon, index + 1, item_max) : ""))
    end
  end
If you want to customize stuff, you want to add an "elsif" there like
View attachment 96943

Disclaimer: I didn't test it myself so it may or may not work.
That screenshot with the elsif line was exactly what I was looking for, haha. You're a life saver, thank you. : )
 

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

Latest Threads

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,230
Members
137,607
Latest member
Maddo
Top