Welcome to the Builder Academy

Question About Tbamud localization

More
16 Aug 2024 01:59 - 16 Aug 2024 02:00 #10417 by cry1004
First of all, the command in the original English code is as follows:
Command <argument> or Command <argument> <argument>
However, in Korean, the command comes after:
<argument> Command or <argument> <argument> Command
This problem was solved by creating a reverse_order function in the command_interpreter function.
Code:
void reverse_order(char *argument) {     char hanparse[MAX_INPUT_LENGTH];     char hancommand[MAX_INPUT_LENGTH];     sprintf(hanparse, "%s", argument);     if (strrchr(hanparse, ' ')) {         char *last_space = strrchr(hanparse, ' ');         strcpy(hancommand, last_space + 1);         strcat(hancommand, " ");         *last_space = '\0';         strcat(hancommand, hanparse);         strcpy(argument, hancommand);     } else {         strcpy(argument, hanparse);     } }
I'm trying to modify the trg file to make the teleport trigger work.
Code:
#65401 Obj Command 65401 - East Gate Midgen~ 1 c 7 en~ if %cmd.mudcommand% == enter && gate /= %arg% %send% %actor% You enter the gate. %echoaround% %actor% %actor.name% enters the gate. %teleport% %actor% 65442 %force% %actor% look %echoaround% %actor% %actor.name% just stepped through the gate. else %send% %actor% %cmd% what?! end ~

en~ appears to be the enter command.
The enter command has been localized into Korean as "입장".
The localization command for look is "봐".
The localization of the teleport command is "텔레포트".

The full code for the localized #65401 trigger is as follows:
Code:
#65401 Obj Command 65401 - 미드젠 동문~ 1 c 7 입장~ if %cmd.mudcommand% == 입장 && 문 /= %arg% %send% %actor% 당신은 문으로 들어간다. %echoaround% %actor% %actor.name% 문으로 들어간다. %teleport% %actor% 65442 %force% %actor% 봐 %echoaround% %actor% %actor.name% 방금 문으로 걸어 들어갔다. else %send% %actor% %cmd% 뭐라구요?! end ~

I entered a trigger command in a room with an object that has this trigger applied, but it is not working.
English is entered as follows:
enter gate
Korean is entered as follows:
문 입장

Do I need to modify a specific function to input the commands in a different order?

I think if the command and arguments were passed,
Code:
%send% %actor% 당신은 문으로 들어간다.

The sentence should be printed to the screen, but it is not.
I think the arg and command are not being passed.
Last edit: 16 Aug 2024 02:00 by cry1004.

Please Log in or Create an account to join the conversation.

More
16 Aug 2024 21:10 #10418 by thomas
Replied by thomas on topic About Tbamud localization
For debugging, I suggest simply making a trigger with the body 

%echo% cmd=%cmd% actor=%actor.name% arg=%arg%

This shows you what the script receives.

Please Log in or Create an account to join the conversation.

More
17 Aug 2024 11:22 #10419 by cry1004
Replied by cry1004 on topic About Tbamud localization
First, I modified the trg file as you taught me, like this:

#65401
Obj Command 65401 - East Gate Midgen~
1 c 7
입~
%echo% cmd=%cmd% actor=%actor.name% arg=%arg%
if %cmd.mudcommand% == 입장 && 문 /= %arg%
- The rest is omitted -

I entered a command, but no message was echoed.

I modified the command_otrigger file as follows:
int command_otrigger(char_data *actor, char *cmd, char *argument) {
obj_data *obj = NULL;
int i = 0;

send_to_char(actor, "cmd : %s\r\n", cmd);
trim_spaces(argument);
send_to_char(actor, "argument : %s\r\n", argument);

cmd and arguments are printed to the screen.
cmd : 입장
argument : 문

I changed trig arg to another word according to the trigger manual, but it doesn't print on the screen.
@n#<virtual number>
<trig name>~
<attach type> <trig type> <numeric arg>
<trig arg>~
<command list>
~

And, in interpreter.c, do_enter is localized into Korean as follows:
{"입장", "입장", POS_STANDING, do_enter, 0, 0, FALSE, ACTION_NONE, {0, 0}, NULL},

Please Log in or Create an account to join the conversation.

More
18 Aug 2024 07:28 #10420 by cry1004
Replied by cry1004 on topic About Tbamud localization
The object trigger issue was resolved by removing the trigger from the object and setting the object option to portal.
The following user(s) said Thank You: thomas

Please Log in or Create an account to join the conversation.

More
23 Aug 2024 18:27 #10421 by cry1004
Replied by cry1004 on topic About Tbamud localization
I finally found the cause.
I was testing the mud as a super administrator account all the time.
I commented out
else if (!IS_SET(bitvector, DG_ALLOW_STAFFS) && GET_LEVEL(ch) >= LVL_GRSTAFF) in the valid_dg_target function in the dg_misc.c file and the problem was solved.
The following user(s) said Thank You: thomas

Please Log in or Create an account to join the conversation.

Time to create page: 0.175 seconds