EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   I want quest in english but other languages also (https://www.eqemulator.org/forums/showthread.php?t=19465)

Belfedia 09-29-2005 09:22 AM

I want quest in english but other languages also
 
Just a simple question about quests.
All quest are in the Quests directory, but i search how i can localise the quest. After you can choose your language and the quest answer with this language.
Anyone have a perl idea for make that plz ?

sdabbs65 09-29-2005 10:57 AM

?
 
Quote:

Originally Posted by Belfedia
Just a simple question about quests.
All quest are in the Quests directory, but i search how i can localise the quest. After you can choose your language and the quest answer with this language.
Anyone have a perl idea for make that plz ?

dunno maybe babblefish.com can help you.

Belfedia 09-29-2005 11:03 AM

My english is very poor (sorry snif)
I don't search translate web site but one idea for my player
A perl code for choose if the player have quest in english or other language :)
I search how localised the quest :)

deazone 09-29-2005 07:21 PM

That is a cool idea. Perhaps a new function to check a language field in your database and return the result to perl. And a command in commands.cpp/.h to set that field in the database.

Good luck

Cisyouc 09-30-2005 07:30 AM

Well, you could just add a player command ( a # comamand, like #locale [fr/en/es/etc]) that allows you to change your locale by manually adding a quest global, and then in your quests just have like..

if ($locale eq 'fr')
{
french..
}
elsif ($locale eq 'en')
{
english..
}

Cisyouc 10-09-2005 08:26 AM

Hey Belfedia, if you tell me what version of EQEmu you're using I'd be happy to write it up really quick. Send me an email: admin@awhiteflame.net.

Belfedia-1 10-09-2005 06:18 PM

Quote:

Originally Posted by Cisyouc
Hey Belfedia, if you tell me what version of EQEmu you're using I'd be happy to write it up really quick. Send me an email: admin@awhiteflame.net.

I use Eqemu 0.6.2 DR1 last version from CVS on a linux box now
Any help is welcome for write this locale stuff :)

Belfedia 10-10-2005 02:46 AM

I understand how that work :)
I need to find a C++ coder for the command #locale now :)
thks all for help.

fathernitwit 10-10-2005 02:28 PM

you should be able to do this entirely in perl...
the best way I can say to do it is this..
make a directory on your server named 'locales' somewhere, let the path be /home/eqemu/locales. Make it writeable by the user running eqemu.

use a perl command like (check this syntax, im winging it):
Code:

sub commands_init() {
  command_add("locale", "Set your locale", 0);
}

sub locale {
  my $loc = shift;
  if($loc eq "") {
    $client->Message(13, "You must specify a locale: en or fr");
    return;
  }
  my $name = $client->GetName();
  open(F, ">/home/eqemu/locales/$name");
  print F "$loc";
  close(F);
}

then make a plugin:
Code:


sub get_locale {
  my $name = shift;
  open(F, "</home/eqemu/locales/$name");
  my $loc = <F>;
  close(F);
  return($loc);
}


then you can write a quest like:
Code:

sub EVENT_SAY {
  my $locale = plugin::get_locale($name);
  if($locale eq 'en') {
    #....
  } else {#.....
  }
}

}
[/code]

Belfedia 10-10-2005 09:00 PM

Thanks i try it :)

Quote:

command_add("locale", "Set your locale");
need more : command_add (name , desc, access)
what is acces ?

fathernitwit 10-11-2005 01:40 AM

status required to use it, pass 0

Belfedia 10-11-2005 06:25 AM

Nice, but say i'm use a unitialized value in concatenation (.) or string in commands.pl

Code:

open(F, ">/home/eqemu/locales/$name");
Program don't know $name i think ?
i try to add a print "$name";
and i have same error on it.

fathernitwit 10-11-2005 11:33 AM

oops..

add
Code:

my $name = $client->GetName();

Belfedia 10-12-2005 03:19 AM

Thats work very fine !!!

MANY thanks (one more !!!)
Now i try to find a (book/tradeskills) solution :)


All times are GMT -4. The time now is 09:53 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.