SphereCommunity
Sphere msgs.scp - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Sphere msgs.scp (/Thread-Sphere-msgs-scp)

Pages: 1 2


Sphere msgs.scp - Russian - 07-16-2012 02:35 AM

Hello.
Sphere msgs.scp have a DEFMESSAGEs for one language.
How i can set two DEFMESSAGE for various languages?


RE: Sphere msgs.scp - Shidhun - 07-16-2012 02:55 AM

I think that is not possible just with changing this defmessages within the script.

You could change every Defmessage into a Cliloc. But you would have to distribute two different Clilocs to your players .

Of course you need to create this cliloc-files first


RE: Sphere msgs.scp - Skul - 07-16-2012 05:42 AM

@Russian, //comment the defmessage and recode it through it's proper aspect and use account.lang to retrieve the player's language.


RE: Sphere msgs.scp - Russian - 07-18-2012 03:45 AM

account.lang where is it?


RE: Sphere msgs.scp - Wap - 07-18-2012 07:10 AM

Russian, what version of client do you use?

Account.lang is in the account block:
[x]
...
LANG=RUS
But... I don't know a way to make sysmessages on two languages, using this(excluding overriding internal action-scripts, but it is funny).


RE: Sphere msgs.scp - Shaklaban - 07-18-2012 01:37 PM

Im using defnames and functions for multi language support, but i never replace hardcoded ones since everyone knows them which plays sphere. Little examples from my shard:

PHP Code:
[defname language_support]
dil_arkadas_listeniz_dolu_0 Arkadaş listeniz dolu.
dil_arkadas_listeniz_dolu_1 Your friend list is full.

[function 
lng]
return <
account.dtag0.lang// im just giving them tag.lang with gump, they selecting their languages

[function example]
sysmessage <def.dil_arkadas_listeniz_dolu_<lng>>

[function 
smsg_arkadas_teklifi_engellemis_0]
sysmessage <argsarkadaşlık tekliflerini engellemiş.

[function 
smsg_arkadas_teklifi_engellemis_1]
sysmessage <argshas blocked friend requests.

[function 
example_2]
ref1=<argn1//uid of an object
sysmessage <smsg_arkadas_teklifi_engellemis_<lng> <ref1.name>> 

I never think about clilocs since connection which used by sphere in nothing, and its not useful to edit cliloc files with every script change.


RE: Sphere msgs.scp - Abuelox - 11-15-2012 06:12 AM

How could operate in dialogs and names of objects? I cannot find the way or better said, I have no much idea ... , could help me? Thank you very much!

ERROR in console:
Code:
23:16:ERROR:(funciones_scripts.scp,5)Can't resolve <account.dtag0.lang>

and this is the function:
Code:
[function lng]
return <account.dtag0.lang>



RE: Sphere msgs.scp - Shaklaban - 11-16-2012 01:20 PM

in dialogs you need to use <src.lng> because default uid can be an item or npc in dialog. also in message function you need to use <src.lng>.


RE: Sphere msgs.scp - Skul - 11-16-2012 01:24 PM

(11-15-2012 06:12 AM)Abuelox Wrote:  How could operate in dialogs and names of objects? I cannot find the way or better said, I have no much idea ... , could help me? Thank you very much!

ERROR in console:
Code:
23:16:ERROR:(funciones_scripts.scp,5)Can't resolve <account.dtag0.lang>

and this is the function:
Code:
[function lng]
return <account.dtag0.lang>

account.lang is stored as a string, so using dtag0 won't resolve if it is set. try this function rather than the function you posted:
Code:
[function lng]
if (<isplayer>)
  if !(<isempty <account.tag.lang>>)
    return <account.tag0.lang>
  elseif !(<isempty <account.lang>>)
    return <account.lang>
  endif
endif
return 0
Sometimes account.lang and account.tag.lang are not set, this happens if someone logs in but never types any text in-game, happens so it's good to 'check' if someone has the value set on their account or not. Looks like you use account.tag.lang so I left that in there.


RE: Sphere msgs.scp - xwerswoodx - 06-22-2013 10:43 PM

Code:
[Function language]
IF (<isplayer>)
  IF (<isempty <account.lang>>)
  ACCOUNT.LANG=ENG
  SERV.ACCOUNT UPDATE
  ENDIF
  RETURN <ACCOUNT.LANG>
ENDIF
RETURN 0

[Defname d_language_tools]
language_too_away_ENG=You are too away
language_too_away_TRK=Çok uzaksınız
language_too_away_RUS=...

In the dialog or sysmessage;
SYSMESSAGE <language_too_away_<src.language>>
DTEXT - - 0 <language_too_away_<src.language>>