Skip to content
User Avatar
#3926
Auto-translated
Azgalor
Hello, is it possible to write a script that can pass the name of an object to the text? Specifically, I want to create a quest to find a random artifact, i.e., an artifact ID will be selected using a random function, but I don't know if it's possible to pass the name of the selected artifact ID as an argument to the text (not in the quest texts, but in a Msg box), or will I have to create a table for all artifact IDs?
You can create an array where the position is the artifact ID, and it stores the name. For example:

artefactArray = {}

artefactArray[4] = "Unicorn Horn Bow" -- where 4 is the artifact ID

rndArt = random(your number)

MessageBox({"Link_to_text"; artefact = artefactArray[rndArt]}) -- where artefact is in your text file

Added after 12 hours 23 minutes
I couldn't find any function that would return the text name of an object. If a large list of possible artifacts is needed, then you will have to write a table
Мои карты: Белый Храм, Поменяться местами, Судьба королевства, Стихийные острова.