string_copy can't be called from a variable?, alternative?

I

itameio

Guest
I think this deserves it's own post so here goes :

TL;DR:I want to use string_copy in adjust_arabic_text but i can't use it in the draw event because it makes the game slower and can't call it from a variable because string_copy wouldn't work.

I have downloaded this extension which makes game maker supports Arabic language, and it only has 1 function which is adjust_arabic_text("Arabic text here") which basically makes Arabic display correctly. so since i'm creating a visual novel, I need to have some text effects such as the dialogue being drawn letter by letter, for which I use String_copy function in the draw event.

So the problem with using these two functions together is that one of them needs to be in the other, if i put adjust_arabic_text() in the string_copy() function, the text is drawn from last letter to first (because in order for Arabic to be displayed correctly on game maker, it needs to be reversed, and thus this happens), an effect which I don't desire to use.
but that is fixed by putting the string_copy() function in the adjust_arabic_text() function, which displays the text correctly and draws it letter by letter from first to last.

after that another problem surfaced, since I use that code in the draw event, the adjust_arabic_text() was being executed every step of the game, which greatly slowed the game down on android, so I decided to have the text adjusted at the beginning of the game by assigning it to variables and using them in the draw_event later (the extension creator suggested this later too) but that didn't work the problem was that the "Count" element of the string_copy() function was not being increased as i intended it to (i use a variable in a step event to increase it and it worked when the code was in the draw event) so the text was not appearing at all since the count starts at 0.

so i had to remove the string_copy from the variable code, left only adjust_arabic_text() with the string to adjust, and put string_copy(myvariable . . in the draw event, which replicated the first problem of the text being drawn from last to first.

so my idea of fixing it was to include the string_copy() again in the variable by using functions such as string_replace and string_insert and that did not work too . . .

and now i'm stuck, i need a way about this, i want to use string_copy in adjust_arabic_text but i can't use it in the draw event because it makes the game slower and can't call it from a variable because string_copy wouldn't work.
 
Last edited by a moderator:
you probably need to code your own copy:replace scripts.

Does the function string_char_at() work correctly with arabic? If so, maybe you can make your version of copy and replace by making character counting loops.

Also can you add two arabic strings together?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
I would have to say that you really should be working with the extension creator to resolve this. We can't help much without seeing the contents of the script you are using, and you can't post that since it was a marketplace asset (unless the person that created it can come into this topic and assure us that it's okay to do so, but even then I'm not sure I'd permit it unless I was 100% certain that the person posting is indeed the asset creator).
 
I

itameio

Guest
I would have to say that you really should be working with the extension creator to resolve this. We can't help much without seeing the contents of the script you are using, and you can't post that since it was a marketplace asset (unless the person that created it can come into this topic and assure us that it's okay to do so, but even then I'm not sure I'd permit it unless I was 100% certain that the person posting is indeed the asset creator).
The isn't really anything hidden, the extension is basically a number of scripts and a font, nothing more, they can be viewed if you download the extension and drag it to your project, but the problem here is not with the extension but with the string_copy() function.

ps : I'm gonna try and get the creator here anyway.
 
I

itameio

Guest
I would have to say that you really should be working with the extension creator to resolve this. We can't help much without seeing the contents of the script you are using, and you can't post that since it was a marketplace asset (unless the person that created it can come into this topic and assure us that it's okay to do so, but even then I'm not sure I'd permit it unless I was 100% certain that the person posting is indeed the asset creator).
oh and by the way, can I ask why doesn't game maker's built in drawing engine support UTF-8 yet?? Shouldn't that be already Implemented? all other engines do.
 
I

itameio

Guest
you probably need to code your own copy:replace scripts.

Does the function string_char_at() work correctly with arabic? If so, maybe you can make your version of copy and replace by making character counting loops.

Also can you add two arabic strings together?
I believe It does work with arabic, I already tried string_insert and string_replace and they worked.
but I don't know how to use it though.
and yes, I can add arabic strings together.
 

jazzzar

Member
I believe It does work with arabic, I already tried string_insert and string_replace and they worked.
but I don't know how to use it though.
and yes, I can add arabic strings together.
hey, i saw your status for being stuck at this, care to pm me so maybe i can help you?
 
Top