- Posts: 47
- Thank you received: 1
Trigger command without argument.
- cry1004
- Topic Author
- Offline
- Senior Member
-
Less
More
5 months 3 weeks ago - 5 months 3 weeks ago #9270
by cry1004
Trigger command without argument. was created by cry1004
I became interested again in making mud.
I'm localizing Tbamud and adding the necessary code.
I'm sorry for asking questions often. :)
I couldn't study the c language separately.
I'm studying C language these days, but I forget what I've studied since I'm over 50.
Still, I enjoy making mud game because of your kind answer. Thank you.
So, I prepared a question again today.
I have to move to a specific room when a specific command is entered.
I looked for a trigger to refer to.
But there were too many triggers to find what I was looking for.
Something similar I found required an argument with a specific command.
I only want to enter commands with no arguments.
I need commands that are only used in certain rooms.
For example, if I enter the blue command in room 7, I moved to room 74.
I created a command because I couldn't find a trigger command that didn't require an argument.
It moves well, but is it correct to make it like this?
For information, 7 commands are required, and each command moves to the corresponding room.
Blue, cyan, yellow, white, purple, green, red
command --- room move
blud --- 74
cyan --- 75
yellow -- 76 etc..
ACMD(do_goto_blue), ACMD(do_goto_cyan), ACMD(do_goto_yellow) etc..
By the way, we made 7 similar commands, and will one trigger solve them?
char_to_room(ch, 73);
And, I have to go to number 74, but I had to enter 73.
I'm localizing Tbamud and adding the necessary code.
I'm sorry for asking questions often. :)
I couldn't study the c language separately.
I'm studying C language these days, but I forget what I've studied since I'm over 50.
Still, I enjoy making mud game because of your kind answer. Thank you.
So, I prepared a question again today.
I have to move to a specific room when a specific command is entered.
I looked for a trigger to refer to.
But there were too many triggers to find what I was looking for.
Something similar I found required an argument with a specific command.
I only want to enter commands with no arguments.
I need commands that are only used in certain rooms.
For example, if I enter the blue command in room 7, I moved to room 74.
I created a command because I couldn't find a trigger command that didn't require an argument.
It moves well, but is it correct to make it like this?
For information, 7 commands are required, and each command moves to the corresponding room.
Blue, cyan, yellow, white, purple, green, red
command --- room move
blud --- 74
cyan --- 75
yellow -- 76 etc..
ACMD(do_goto_blue), ACMD(do_goto_cyan), ACMD(do_goto_yellow) etc..
By the way, we made 7 similar commands, and will one trigger solve them?
ACMD(do_goto_blue)
{
char buf[MAX_STRING_LENGTH];
room_rnum location;
if ((location = find_target_room(ch, GET_NAME(ch))) == NOWHERE)
return;
if (location != 7) {
send_to_char(ch, "%s", CONFIG_HUH);
return;
}
snprintf(buf, sizeof(buf), "$n 파랑으로 갔다.");
act(buf, TRUE, ch, 0, 0, TO_ROOM);
char_from_room(ch);
char_to_room(ch, 73);
snprintf(buf, sizeof(buf), "$n$Hn0 왔다.");
act(buf, TRUE, ch, 0, 0, TO_ROOM);
look_at_room(ch, 0);
enter_wtrigger(&world[IN_ROOM(ch)], ch, -1);
}
char_to_room(ch, 73);
And, I have to go to number 74, but I had to enter 73.
Last edit: 5 months 3 weeks ago by cry1004.
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
Less
More
- Posts: 677
- Thank you received: 129
5 months 3 weeks ago #9307
by thomas
Replied by thomas on topic Trigger command without argument.
Please login to view the answers
The following user(s) said Thank You: cry1004
Please Log in or Create an account to join the conversation.
- cry1004
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 47
- Thank you received: 1
5 months 3 weeks ago #9310
by cry1004
Replied by cry1004 on topic Trigger command without argument.
Please login to view the answers
Please Log in or Create an account to join the conversation.
- Parnassus
- Offline
- Administrator
-
Less
More
- Posts: 362
- Thank you received: 54
5 months 3 weeks ago #9318
by Parnassus
Replied by Parnassus on topic Trigger command without argument.
Please login to view the answers
The following user(s) said Thank You: cry1004
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
Less
More
- Posts: 677
- Thank you received: 129
5 months 3 weeks ago #9364
by thomas
Replied by thomas on topic Trigger command without argument.
Please login to view the answers
The following user(s) said Thank You: cry1004
Please Log in or Create an account to join the conversation.
- thomas
-
- Offline
- Administrator
-
Less
More
- Posts: 677
- Thank you received: 129
5 months 3 weeks ago #9365
by thomas
Replied by thomas on topic Trigger command without argument.
Please login to view the answers
The following user(s) said Thank You: cry1004
Please Log in or Create an account to join the conversation.
- cry1004
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 47
- Thank you received: 1
5 months 1 week ago - 5 months 1 week ago #9743
by cry1004
Replied by cry1004 on topic Trigger command without argument.
Please login to view the answers
Last edit: 5 months 1 week ago by cry1004.
Please Log in or Create an account to join the conversation.
- Parnassus
- Offline
- Administrator
-
Less
More
- Posts: 362
- Thank you received: 54
5 months 1 week ago #9746
by Parnassus
Replied by Parnassus on topic Trigger command without argument.
Please login to view the answers
The following user(s) said Thank You: cry1004
Please Log in or Create an account to join the conversation.
Time to create page: 0.106 seconds