Half-Life и Adrenaline Gamer форум

Всё об игре в Халф-Лайф и АГ
Текущее время: 05 июн 2024, 02:17

Часовой пояс: UTC + 5 часов [ Летнее время ]




Начать новую тему Ответить на тему  [ Сообщений: 21 ]  На страницу Пред.  1, 2, 3  След.
Автор Сообщение
 Заголовок сообщения: Re: replace print messag to Hud ?
СообщениеДобавлено: 07 янв 2016, 17:59 
Не в сети
Аватара пользователя
Зарегистрирован:
22 окт 2014, 19:26
Последнее посещение:
30 май 2024, 23:25
Сообщения: 1027
Lev

This needs further explanation xD

** Writing in the Arabic language from right to left

i use some way like Encoding UTF-8 notepad++ or http://www.arabic-keyboard.org/photoshop-arabic/
this ways give upturned Messages
ex:
this Msg is a phrase understandable :
Код:
TEST_MSG = السلام عليكم ورحمة لله وبركاته // Msg 1
but in game :
should write in this way within the game in order to show the concept of :

Код:
TEST_MSG = ﻪﺗﺎﻛﺮﺑ ﻭ ﷲ ﺔﻤﺣﺭ ﻭ ﻢﻜﻴﻠﻋ ﻡﻼﺴﻟﺍ  // Msg 2


the result in the game we will get the first Msg

Изображение

so, in show_hudmessage

if i did the same thing like Msg 2
The message is ignored and nothing appears on the screen

if i did the same thing like Msg 1

The message becomes incomprehensible a separate letters
like this :
Изображение

--------------------------------------------------------------------------------------------
i tryed replace chat messag to Hud for test
 

I've found works and give understandable message
ex :
the Msg understandable

السلام عليكم ورحمة الله

when used Encoding UTF-8 for this Msg

Код:
say  ﻪﻠﻟﺍ ﺔﻤﺣﺭﻭ ﻢﻜﻴﻠﻋ ﻡﻼﺴﻟﺍ

The result:

Изображение

----------------------------------------------------------------------------------------------------------------

I thought that when replace print message to hud all Messages becomes inverted to show understandable messages


I hope you understand what I mean?

_________________
https://vk.com/kgbaghl


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: replace print messag to Hud ?
СообщениеДобавлено: 07 янв 2016, 20:50 
Не в сети
Аватара пользователя
Зарегистрирован:
01 июн 2010, 23:25
Последнее посещение:
05 июл 2018, 16:02
Сообщения: 1035
Seems, you have to use special RTL symbol. But I never used it and I don't know how this will work with HL.
Any utf text after RTL symbol will be right-to-left reversed.

https://en.wikipedia.org/wiki/Right-to-left_mark
http://www.fileformat.info/info/unicode ... /index.htm

_________________
Изображение


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: replace print messag to Hud ?
СообщениеДобавлено: 07 янв 2016, 21:10 
Не в сети
Зарегистрирован:
17 май 2015, 23:48
Последнее посещение:
25 июл 2019, 07:26
Сообщения: 59


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: replace print messag to Hud ?
СообщениеДобавлено: 07 янв 2016, 22:46 
Не в сети
Аватара пользователя
Зарегистрирован:
22 окт 2014, 19:26
Последнее посещение:
30 май 2024, 23:25
Сообщения: 1027
unnamed

Valve don't support arabic till now in hlds.
HLDS already has unicode support. but No real support for arabic still i can't write well in-game.
i think, should ask Valve to implement proper input on arabic languages in goldsource client.

eseqiiel

This is not what I want, this just an example I gave him the idea only

_________________
https://vk.com/kgbaghl


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: replace print messag to Hud ?
СообщениеДобавлено: 08 янв 2016, 00:39 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
05 июн 2024, 00:23
Сообщения: 6871
abdobiskra
From your samples I didn't got all the needed pieces, but only some.
In the first example with TEST_MSG from your words it looks like the game inverted the order of letters. Also, if I am not wrong this is not HUD message, but some chat-alike.
As about chat and print_center texts - these are output whole by the engine. Engine could reverse order if it supports this (should be tested actually).
HUD messages instead are drawn char by char by client.dll with passing char to engine, so the engine has no ability (no way actually) to reverse the order in that case.
Red mess - I actually dunno why these appear. Possibly some leading byte interfere with utf8 decoding.
About direct chat to HUD message passing - it is good that your language did appear correctly, that's mean that you can do what you planned. But there is leading byte in that string that contain message destination number - you should cut it off. I.e., actual message is starting from second byte.
Код:
public msg_SayText(id)
{
   new message[512];
   get_msg_arg_string(2, message, charsmax(message));
   
   set_hudmessage( 255, 255, 0, 0.0, 0.88, 0, 0.1, 10.0, 0.04 )
   show_hudmessage(0, "%s", message[1])   // Start from the second byte

   return PLUGIN_HANDLED         
}
As the further advises I suggest to use lesser chars amount (like 2 will be enough). Also add digits before and after like "1مةf2" (I wasn't able to add '2' without 'f' because of some RTL specific, dunno actually how it works) - this could help to check whether it reverse or no. Or could mess it a lot if there is RLM symbol unnamed told above.
Also you could debug these texts and print them as bytes, learn UTF-8 bytes of the symbols you use, so you can check what is going actually.
All of that leads to conclusion that you possibly will have to reverse the order yourself or add RLM symbol depending on output method.


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: replace print messag to Hud ?
СообщениеДобавлено: 08 янв 2016, 16:01 
Не в сети
Аватара пользователя
Зарегистрирован:
22 окт 2014, 19:26
Последнее посещение:
30 май 2024, 23:25
Сообщения: 1027
Lev

I want to know its possible to replace print_chat like print in client.dll to Hud_Msg or no ?

_________________
https://vk.com/kgbaghl


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: replace print messag to Hud ?
СообщениеДобавлено: 08 янв 2016, 16:05 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
05 июн 2024, 00:23
Сообщения: 6871
Yes, you can capture TextMsg sent from client.dll.


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: replace print messag to Hud ?
СообщениеДобавлено: 08 янв 2016, 16:53 
Не в сети
Аватара пользователя
Зарегистрирован:
22 окт 2014, 19:26
Последнее посещение:
30 май 2024, 23:25
Сообщения: 1027
and another print also ? in plugins ?

_________________
https://vk.com/kgbaghl


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: replace print messag to Hud ?
СообщениеДобавлено: 08 янв 2016, 17:16 
Не в сети
Site Admin
Зарегистрирован:
01 июн 2010, 01:27
Последнее посещение:
05 июн 2024, 00:23
Сообщения: 6871
These should be replaced manually.


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: replace print messag to Hud ?
СообщениеДобавлено: 12 янв 2016, 20:10 
Не в сети
Аватара пользователя
Зарегистрирован:
22 окт 2014, 19:26
Последнее посещение:
30 май 2024, 23:25
Сообщения: 1027
i try to fix head messag

Код:
show_hudmessage(id, "%L" id, "TEST")

Вложение:
Capture.JPG
Capture.JPG [ 9.45 КБ | Просмотров: 2938 ]


She works but I have a problem is when the message is a long line down under How can be written in the same line?

_________________
https://vk.com/kgbaghl


Вернуться к началу
 Профиль 
  
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему  [ Сообщений: 21 ]  На страницу Пред.  1, 2, 3  След.

Часовой пояс: UTC + 5 часов [ Летнее время ]


Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 8


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Перейти:  
Создано на основе phpBB® Forum Software © phpBB Group
Русская поддержка phpBB