Show item icon instead number?

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
390
Reaction score
91
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
300
Reaction score
409
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
390
Reaction score
91
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
37,918
Reaction score
10,508
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
390
Reaction score
91
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
37,918
Reaction score
10,508
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
390
Reaction score
91
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
37,918
Reaction score
10,508
First Language
German
Primarily Uses
RMMV
I forgot the second slash
\I[\V[id]]
will work
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
37,918
Reaction score
10,508
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
390
Reaction score
91
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
258
Reaction score
251
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
258
Reaction score
251
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
390
Reaction score
91
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
258
Reaction score
251
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
37,918
Reaction score
10,508
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
390
Reaction score
91
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
45,453
Reaction score
16,375
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 am supposed to be preparing to teach my students this afternoon and tomorrow morning about Refugees, Asylees, and Fraud/Misrepresentation and all I can think about is how to improve my Turn Order display. :stickytongue:
Try changing POV battle, near and far away like suikoden...
watercave2.jpg

diablofar.jpg

In the end I choose near over shoulder resembles RE4. Tight close window better. The correlation between battleback, monster style and battler should also be observed and merged.
Upgraded my avatar to be cuter.
When you look for several things for ages and then suddenly find it all at once.

Status.png
Status2.png
equip.png
I'm going to see if I can set up a triple booting setup. Windows for standard use & gaming, debian for linux development and manjaro for linux gaming, wine & proton use.

Forum statistics

Threads
129,704
Messages
1,204,427
Members
170,769
Latest member
ghostyen
Top