RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
How to change the text of a command?

0 Members and 1 Guest are viewing this topic.

*
Rep: +0/-0Level 48
C++ programmer, RMRK neophyte
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.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, I'm not entirely sure why you would want to change the text of a command, but you can do it by:

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

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

Code: [Select]
draw_item(index)

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
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

*
Rep: +0/-0Level 48
C++ programmer, RMRK neophyte
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.

*
Rep:
Level 82
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?)

***
Rep:
Level 70
RMRK Junior
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:

Code: [Select]
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!