Show item icon instead number?

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
264
Reaction score
40
First Language
brazil
Primarily Uses
Hello everyone, I used command: $dataItems[$gameVariables.value(237)].iconIndex in order to show icon image, but showed icon number.
Is there anyway to show icon image?
 

AphoticAmaranth

An Ordinary Human
Veteran
Joined
Mar 29, 2020
Messages
89
Reaction score
81
First Language
English
Primarily Uses
RMMV
Are you trying to show icon #237, or an icon with a variable value?

Code:
\i[237]

will show icon 237

Code:
\i[$gameVariables.value(237)]

should show the icon which matches variable 237, if I'm not mistaken.
 

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
264
Reaction score
40
First Language
brazil
Primarily Uses
$dataItems\i[$gameVariables.value(237)].iconIndex
I used this, but show only number.
Thanks for answear
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,306
Reaction score
8,750
First Language
German
Primarily Uses
RMMV
WHERE do you want to show the icon?
for any text field like show text the text code given two posts above is correct.

your alternative from the post above will never work because it mixes text code and javascript code.

And IconIndex is ALWAYS the number of the icon - that is what index means. It is never the icon itself, which is drawn by functions referencing the index.
 

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
264
Reaction score
40
First Language
brazil
Primarily Uses
WHERE do you want to show the icon?
for any text field like show text the text code given two posts above is correct.

your alternative from the post above will never work because it mixes text code and javascript code.

And IconIndex is ALWAYS the number of the icon - that is what index means. It is never the icon itself, which is drawn by functions referencing the index.
Any text box
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,306
Reaction score
8,750
First Language
German
Primarily Uses
RMMV
then your answer was given already

\i[n]
will show the icon with the number icon index n inside the text message.

\i[v[id]]
will show the icon whose icon index is stored in variable with ID in the text message.

If that is not enough, then you need to explain to us which icon exactly you want to display, and where you stored it's iconindex (or where you want to get the index from)
 

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
264
Reaction score
40
First Language
brazil
Primarily Uses
then your answer was given already

\i[n]
will show the icon with the number icon index n inside the text message.

\i[v[id]]
will show the icon whose icon index is stored in variable with ID in the text message.

If that is not enough, then you need to explain to us which icon exactly you want to display, and where you stored it's iconindex (or where you want to get the index from)
1635096199946.png
Dont worked :(
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,306
Reaction score
8,750
First Language
German
Primarily Uses
RMMV
I forgot the second slash
\I[\V[id]]
will work
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,306
Reaction score
8,750
First Language
German
Primarily Uses
RMMV
it does - and your screenshot proves it.

The first icon in the iconset is always invisible - it needs to be for the battlescreen to handle states correctly.
so I'm guessing you didn't store any number in the variable and the textcode was correctly converted to the invisible icon #0, because otherwise you would read the text of the wrong text code there
 

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
264
Reaction score
40
First Language
brazil
Primarily Uses
it does - and your screenshot proves it.

The first icon in the iconset is always invisible - it needs to be for the battlescreen to handle states correctly.
so I'm guessing you didn't store any number in the variable and the textcode was correctly converted to the invisible icon #0, because otherwise you would read the text of the wrong text code there
1635097663399.png
 

Kristina

Veteran
Veteran
Joined
Jun 22, 2019
Messages
254
Reaction score
242
First Language
Danish
Primarily Uses
RMMV
The icon with the ID number 1 seems to be invisible, which is why you can't see it.
 

Kristina

Veteran
Veteran
Joined
Jun 22, 2019
Messages
254
Reaction score
242
First Language
Danish
Primarily Uses
RMMV
Go to your icon index and find the icon you need. At the bottom of that window there will be a number, which is the ID of the icon. Write that ID to show the icon.
 

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
264
Reaction score
40
First Language
brazil
Primarily Uses
Go to your icon index and find the icon you need. At the bottom of that window there will be a number, which is the ID of the icon. Write that ID to show the icon.
But I want to show the icon according with variable.
The number of icon I know.
 

Kristina

Veteran
Veteran
Joined
Jun 22, 2019
Messages
254
Reaction score
242
First Language
Danish
Primarily Uses
RMMV
I get that but either there's no icon matching with the ID or you have done something wrong with the variable. Try to look at your variable and see if you made a mistake somewhere.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,306
Reaction score
8,750
First Language
German
Primarily Uses
RMMV
But I want to show the icon according with variable.
The number of icon I know.
then you need to store that number into the variable before the show text.
when I tested my code (and yes, for the second version I tested it to make sure), the event was
1) control variable var1=5 to store number five into the variable
2) show text \I[\V[var1]] to show icon number 5 which worked.

EDIT:
I found your error:
$dataItems\i[$gameVariables.value(237)].iconIndex
This line is absolute nonsense that will always result in zero, which is why the invisible icon was displayed.

Once again, please tell us what icon you want to display so that we can tell you how to enter it instead of the nonsense you used in your screenshot.
 

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
264
Reaction score
40
First Language
brazil
Primarily Uses
Worked now!
I removed \i before $gamevariables.
Thank so much man!
$dataItems[$gameVariables.value(237)].iconIndex
\I[\V[1]]
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,144
Reaction score
15,535
First Language
English
Primarily Uses
RMMV
None of the things you did were what people suggested. You always changed them in some way compared to how they were posted. Even your last post isn't right (so if it works, what you posted is not exactly what you did).

\i[\v[237]]

should be all you need.
 

Latest Threads

Latest Posts

Latest Profile Posts

I'm just so close to replacing LUK with a different stat, maybe DEX but we'll see.
Slapped together a title screen and working on some dungeon clutter + portraits for Dubhghaill and Einar. Usual CW for minor body horror wrt Einar
QVLJIgD.png

OaPcYUy.png

r55FiUJ.png

EIgO94y.png
cT1V4nb.png
>studying for months for an exam
>does exam
>waits 3 months for the results to come out
>me trying to login, incorrect password
>I get recovery password
>me trying to login, incorrect password

What the heck. As a son of a Karen, I'm going to file a few complaints.
Apparently Amazon Prime users get free Genshin Impact stuff like primogems and whatnot every month, but I'm not sure I ever want to fall into the abyss of F2P ever again.

Forum statistics

Threads
117,148
Messages
1,104,950
Members
153,221
Latest member
Kostec
Top