- Posts: 452
- Thank you received: 79
wifidi wrote: I got it. Mode 1 hardwired looks like:
structs.h 997:act.h 146:Code:int facing;act.movement.c 375:Code:#define FACING ((ch)->facing)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.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); }
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
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.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
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.
Please Log in or Create an account to join the conversation.
tbaMUD © 2024