Main Menu
  • Welcome to The RPG Maker Resource Kit.

How to change the text of a command?

Started by karminator98, December 29, 2012, 11:18:38 PM

0 Members and 1 Guest are viewing this topic.

karminator98

In a window, after having created a command using add_command("text", :thing)

how can I change the text of that command (i.e. write "items" instead of "item") AFTEr it was created?

I think I found how to get the command using @list[index] but I cannot manage to find how to change that text.

Thanks
Innovate.

modern algebra

Well, I'm not entirely sure why you would want to change the text of a command, but you can do it by:

@list[index][:name] = ""

By itself, that won't be enough until you redraw the item's name in the window with:

draw_item(index)

D&P3

You mind taking a screenshot or explaining what you want a little better, I'm afraid I'm not following.
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

karminator98

What I'm trying to do is implement a new "equip-to-party" system, having party-featured items using "<party>" in the item's notes.

I so want to add a new item in the game's menu, Party items, in wich you will be able to fill 3 "party equipment" slots (that's where the commands come in play, and it's working well now, thank's to modern algebra).

Was there a better way to do this ?

The only missing thing now is my items not showing in the list but I'll figure it out by myself.

Thanks alot.
Innovate.

LoganF

After the fact, you'd have to reassign it with a new value. The other way would be to write the code so that you can create the list of commands with the values you want them to have, rather than change them after a list has been made. Without seeing any code, however, I can only guess at what you're doing.

As for the items not showing, I can think of a few reasons, but again, with no code it's a guess at best. The first guess would be to check that the list containing the items actually has items in it, then to make sure that you are refreshing your contents bitmap properly. I've known a few times where I've had list not update properly and it's always been a simple and silly thing I've forgotten to do.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

Heretic86

The "Words" themselves come from your System Database.  You can change the name of each of those "Words" without a script there, but it sounds like in your case, I think you want the word displayed to be conditionally displayed, either for a single party member, or the entire group.  You could do something like this in your script I suppose:

equip_word = (group_condition) ? "Equip to Group" : $data_system.words.equip
self.contents.draw_text(x, y, width, height, equip_word[, align])
Heretic's Vehicles XP (Boat and Magic Carpet)

Heretic's Collection XP Ver 2.3 - Updated to include Dynamic Lighting, Moving Platforms, Vehicles, and much much more!