Welcome to the Builder Academy

Question relative north movement

More
21 Oct 2012 05:23 #926 by Liko
Replied by Liko on topic Re: relative north movement

wifidi wrote: I got it. Mode 1 hardwired looks like:
structs.h 997:

Code:
int facing;
act.h 146:
Code:
#define FACING ((ch)->facing)
act.movement.c 375:
Code:
ACMD(do_move) { switch (subcmd) { case (EAST): { FACING++; if (FACING == 4) FACING = 0; break; } case (SOUTH): { FACING += 2; if (FACING == 4) FACING = 0; if (FACING == 5) FACING = 1; break; } case (WEST): { FACING--; if (FACING == -1) FACING = 3; } } if (subcmd == NORTH) perform_move(ch, FACING, 0); if ((subcmd == UP) || (subcmd == DOWN)) /* These subcmd defines are mapped precisely to the direction defines. */ perform_move(ch, subcmd, 0); }
The toggles I'm trying to use to toggle between default and this walking mode -- PRF_FLAGS -- generate SYSERRS. This is a tight ship being run here so there'll have to be an acceptable design.


Which SYSERRS are showing? Copy and paste from the compiler.

Randian(0.0.0)
Owner/Developer

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

More
21 Oct 2012 19:13 #927 by thomas
Replied by thomas on topic Re: relative north movement
Another thing - I suggest you allow users to map this to WSAD :)

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

More
21 Oct 2012 23:01 - 21 Oct 2012 23:15 #929 by wifidi
Replied by wifidi on topic Re: relative north movement
Here's a working version of two intuitive relative north walking modes. It spews SYSERR: Mob using '((ch)->player_specials->saved.pref)' at act.movement.c:164. in the control console while running. I've decided to post it because its a good demonstration. AUTOSPLIT toggles mode1. AUTODOOR toggles mode2. AUTOEXIT toggles whether you see messages pertaining to either.
I would like to properly implement these into the existing system instead of jury rigging with character variables and pointers. I get the feeling making alternative modes might be similar to trying to talk better about color. The next step is "strafe" and "zero g" mode. Imagine facing down and moving north by typing up.
Attachments:
Last edit: 21 Oct 2012 23:15 by wifidi. Reason: clarification

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

More
22 Oct 2012 01:43 #930 by Liko
Replied by Liko on topic Re: relative north movement

wifidi wrote: Here's a working version of two intuitive relative north walking modes. It spews SYSERR: Mob using '((ch)->player_specials->saved.pref)' at act.movement.c:164. in the control console while running. I've decided to post it because its a good demonstration. AUTOSPLIT toggles mode1. AUTODOOR toggles mode2. AUTOEXIT toggles whether you see messages pertaining to either.
I would like to properly implement these into the existing system instead of jury rigging with character variables and pointers. I get the feeling making alternative modes might be similar to trying to talk better about color. The next step is "strafe" and "zero g" mode. Imagine facing down and moving north by typing up.


Okay,
First thing I notice do you know that AUTOSPLIT is used in combat to split gold between players in a group.

The SYSERR is telling you that you have an NPC using a player PREF flag only. I would suggest using a flag that can be used on both a player and NPC.

Randian(0.0.0)
Owner/Developer

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

More
22 Oct 2012 02:26 #931 by wifidi
Replied by wifidi on topic Re: relative north movement
Thanks. I wasn't able to make PRF_FLAGS called RELTURN, RELWALK and RELSEE so decided to double purpose some familiar toggles to be able to have toggles. I take it from what you're saying maybe all PRF_'s will cause errors when used for this purpose. That's too bad because as a player, the toggles that immediately come to mind are AUTOEXIT, AUTOLOOT, etc., which are PRF_'s. I can't readily think of other toggles and couldn't identify any by scanning interpreter.c, so I'll have to check into it more. There's an article on tbaMUD or google'able on how to make a separate set of toggles. I hope it's as easy as what you are recommending because then I simply have to identify some that work and add mine.

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

More
22 Oct 2012 02:35 #932 by Liko
Replied by Liko on topic Re: relative north movement

wifidi wrote: Thanks. I wasn't able to make PRF_FLAGS called RELTURN, RELWALK and RELSEE so decided to double purpose some familiar toggles to be able to have toggles. I take it from what you're saying maybe all PRF_'s will cause errors when used for this purpose. That's too bad because as a player, the toggles that immediately come to mind are AUTOEXIT, AUTOLOOT, etc., which are PRF_'s. I can't readily think of other toggles and couldn't identify any by scanning interpreter.c, so I'll have to check into it more. There's an article on tbaMUD or google'able on how to make a separate set of toggles. I hope it's as easy as what you are recommending because then I simply have to identify some that work and add mine.


For toggles:

1. open structs.h

2. search #define PRF_AUTODOOR and under add:
Code:
#define PRF_RELTURN 34

3 Then find this line: #define NUM_PRF_FLAGS 34 and change it to:
Code:
#define NUM_PRF_FLAGS 35

4. close structs.h and open constants.c

5. search AUTODOOR and under it add:
Code:
"RELTURN\r\n",

6. close constants.c

7. compile

Okay that is how to add a new PRF flag. This is a simple process since I don't know exactly you want to use PRF_RELTURN for.
I hope this helps.

Randian(0.0.0)
Owner/Developer

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

Time to create page: 0.270 seconds