Show item icon instead number?

Decinbr

Veteran
Veteran
Joined
Mar 20, 2015
Messages
267
Reaction score
41
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
149
Reaction score
159
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
267
Reaction score
41
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,763
Reaction score
8,971
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
267
Reaction score
41
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,763
Reaction score
8,971
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
267
Reaction score
41
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,763
Reaction score
8,971
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,763
Reaction score
8,971
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
267
Reaction score
41
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
255
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
255
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
267
Reaction score
41
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
255
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,763
Reaction score
8,971
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
267
Reaction score
41
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,647
Reaction score
15,735
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 Profile Posts

Switch actor positions during battle
Download
01010.PNG
SF_People3_1 added!
index.php

Micro rant. The worst part of working from home when you live with your family is seeing how inconsiderate they are. "Hey, you're sitting in front of your computer, that means you're not doing anything! I want to put the TV at 200 decibels!"

If I was working in the office would you still talking me like that?
It's definitely discouraging when streamers give a try-to-say-it-nicely (i.e. bad) review of your game demo. It's like jumping into a cold pool. Bad initally, but it gets better with time. And you are now more alert and see better.
Some screenshots of the pub and lodging with the beginnings of clutter taking shape
TTp8uCw.png

jtC202e.png

bSXgyVl.png

eRx9PUF.png

Forum statistics

Threads
118,513
Messages
1,116,534
Members
155,515
Latest member
Darnizzle
Top