Nainstalovat Steam
přihlásit se
|
jazyk
简体中文 (Zjednodušená čínština)
繁體中文 (Tradiční čínština)
日本語 (Japonština)
한국어 (Korejština)
ไทย (Thajština)
български (Bulharština)
Dansk (Dánština)
Deutsch (Němčina)
English (Angličtina)
Español-España (Evropská španělština)
Español-Latinoamérica (Latin. španělština)
Ελληνικά (Řečtina)
Français (Francouzština)
Italiano (Italština)
Bahasa Indonesia (Indonéština)
Magyar (Maďarština)
Nederlands (Nizozemština)
Norsk (Norština)
Polski (Polština)
Português (Evropská portugalština)
Português-Brasil (Brazilská portugalština)
Română (Rumunština)
Русский (Ruština)
Suomi (Finština)
Svenska (Švédština)
Türkçe (Turečtina)
Tiếng Việt (Vietnamština)
Українська (Ukrajinština)
Nahlásit problém s překladem
If you have a sprite "player_up" then setting sprite_index = player_up will work.
That's true, but what if I have many sprites with "_up" and "_down" variants and am trying to change them dynamically? In the RPG I'm making, I'm trying to make it so that the NPCs can turn towards me when I'm talking to them, however, I want to use just one NPC object who has a variable determining its type, that way when it's talked to from the right, for example, the code to turn them would be something like 'sprite_index = type + "_" + direction', except to my knowledge there's nothing in GameMaker allowing for this kind of code to happen (except for execute_string which, as I've already mentioned, has been removed)
Another possible option (untested) is to make an ennumerator on start up that contains your facings, then you han have type.direction (as opposed to _) - might not work.
In this case instead of string(global.Level) you'd be using "direction".
asset_get_index() did the job perfectly, thank you very much for your help!
I know it's an old post but I really want to thank you, I was really stuck on that one! I love internet. And thanks ❄Goodyob❄ for asking the question in the first place.
ik this is now a really old post but funny enough this was the only correct method that fixed my problem so thank yall!!