Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
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!!