DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

moving objects
Page 1 of 1
DieHard Wolfers Forum Index -> Feature Fanatics View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
allthisandwolf3d
Bring 'em On
Bring 'em On


Joined: 14 Mar 2007
Last Visit: 01 Mar 2016

Topics: 13
Posts: 77
Location: USA
usa.gif

PostPosted: Sat Mar 31, 2007 7:45 pm
   Subject: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

ok i seriously do not know if any of you have heard this before but..
what if you make an object a pushwall?
if this is a new idea, then that means if i do that in my wolf3d nobody can find the secret level Smile
anyways the animation of the object would be like it sliding. like for example, i push a vase, and the vase slides back. or kaybe a bookshelf slides sideways.
i have another idea. what if you make it so a pushwall can only be pushed in 1 way? like a pushwall that can only be pushed from north to south. or west to east. this i think will make secrets harder to find.

_________________
Don'cha wish your username was hot like mine?
insurrectionman
DieHard Mutant
DieHard Mutant


Joined: 07 May 2005
Last Visit: 07 Oct 2018

Topics: 87
Posts: 759
Location: Wisconsin
usa.gif

PostPosted: Sun Apr 01, 2007 6:26 am
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

That seems very interesting, I would also imagine like a super-kick and kick objects towards enemies. If you look at the pushwall code, make a new function with that, and somehow add an object to that. I could look at something like that and see how far I get. Very interesting idea, though.

_________________
I'm back! I missed this community!
Youtube Channel: TreeSapThief

New Site: http://www.treesapthief.com
Twitter: @treesapthief
WLHack
DieHard Wolfer
DieHard Wolfer


Joined: 10 Jul 2005
Last Visit: 18 Jan 2018

Topics: 66
Posts: 1241
Location: Loppi - Finland
finland.gif

PostPosted: Sun Apr 01, 2007 9:23 am
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Ehe, I made small test with this...
Result:

Barrel before pressing space:

And after that:


Though there is still few bugs:
*Barrel moves only to one direction,
*To the barrels original spot, invisible blocking tile is spawned,
*Barrel ain't visible in all directions,
*Barrel won't stop when it hits walls or other static object.

_________________
False Spear download
False Spear SDL download
Wolfenstein-blog
allthisandwolf3d
Bring 'em On
Bring 'em On


Joined: 14 Mar 2007
Last Visit: 01 Mar 2016

Topics: 13
Posts: 77
Location: USA
usa.gif

PostPosted: Sun Apr 01, 2007 8:32 pm
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

insurrectionman wrote:
That seems very interesting, I would also imagine like a super-kick and kick objects towards enemies. If you look at the pushwall code, make a new function with that, and somehow add an object to that. I could look at something like that and see how far I get. Very interesting idea, though.

you mean kick an object to enemy?

and wlhack, nice!!!

_________________
Don'cha wish your username was hot like mine?
WLHack
DieHard Wolfer
DieHard Wolfer


Joined: 10 Jul 2005
Last Visit: 18 Jan 2018

Topics: 66
Posts: 1241
Location: Loppi - Finland
finland.gif

PostPosted: Sun Apr 08, 2007 11:35 am
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Corrected bugs:

*Barrel can now be moved in all directions
*Barrel is now visible in every direction...
*Barrel stops to a walls... Other objects causes still proplems.

_________________
False Spear download
False Spear SDL download
Wolfenstein-blog
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 12 Aug 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Sun Apr 08, 2007 11:50 am
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

It's easy to block and unblock a tile.

Block:
::: CODE :::
(unsigned)actorat[tilex][tiley] = 1;


Unblock:
::: CODE :::
actorat[tilex][tiley] = NULL;


Just check when barrel exits a tile and unblock current tile and block the new tile when you move to it.
This was for the "invisible blocking tile" thing you had problems with...

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
WLHack
DieHard Wolfer
DieHard Wolfer


Joined: 10 Jul 2005
Last Visit: 18 Jan 2018

Topics: 66
Posts: 1241
Location: Loppi - Finland
finland.gif

PostPosted: Sun Apr 08, 2007 12:10 pm
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yes... I already know that but I thank you anyway...
Heh. Sorry if that sounded bit rude (learned that from WL_Act1.C).

_________________
False Spear download
False Spear SDL download
Wolfenstein-blog
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 12 Aug 2018

Topics: 22
Posts: 1283
Location: Rauma - Finland
finland.gif

PostPosted: Sun Apr 08, 2007 12:19 pm
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

None taken. That is where I got it too.

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2255
Location: Ontario
canada.gif

PostPosted: Sun Apr 08, 2007 12:55 pm
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

WL_Hack:

I've got an idea for you and I think most of the code could be done in the CMD_Use function in wl_agent.c.

And instead of having it slide until it reaches a wall... have it move 1 tile at a time - each time the player pushes it. That's more realistic.

When I was able to work at my last job, we constantly received these 45 gallon drums of either resin or isocyanate... and the weight on these things is around 500lbs+ (varied slightly as to the level of fill - usually within 496 to 503lbs. + the weight of the drum itself (drums varied by design and material) but were usually in the 10 to 20lbs range). I can tell you that a 180lbs man (me) could push and slide them at most an arms length at a time. (as a millwright I wasn't a superhero, but I wasn't weak either). Even when empty, the drums (aka barrels) wouldn't slide say more than 3 feet because of the design of them and the physics involved (friction).

So to be honest, the best thing that you could code to be realistic would be move 1 space at a time as pushed each time by the player - providing there is nothing else in the way - blocking the movement. Pushwalls in the game are something completely different in the sense that they are man-made to slide and created to hide something. I think of them more as like trap doors and hinged panels that you would see in the old horror type movies.

Just my thoughts...

Greg
BrotherTank
WLHack
DieHard Wolfer
DieHard Wolfer


Joined: 10 Jul 2005
Last Visit: 18 Jan 2018

Topics: 66
Posts: 1241
Location: Loppi - Finland
finland.gif

PostPosted: Sun Apr 08, 2007 1:17 pm
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Heh... Strange that you mentioned it Greg...
Simce all of my code is infact in CMD_USE and it only moves 1 tile at time.
And player can keep pushing it until it hits wall or etc.

_________________
False Spear download
False Spear SDL download
Wolfenstein-blog
WLHack
DieHard Wolfer
DieHard Wolfer


Joined: 10 Jul 2005
Last Visit: 18 Jan 2018

Topics: 66
Posts: 1241
Location: Loppi - Finland
finland.gif

PostPosted: Mon Apr 09, 2007 1:58 am
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hmm... Update (thanks to Codetech for helping out with few things)...
Currently all bugs seem to be fixed (I need still to test it around).
Though I didn't add support for cardinal directions... But I think it will be easy to
add after you see the code...

I am hoping that (if nothing happens) I could post it here at evening.

_________________
False Spear download
False Spear SDL download
Wolfenstein-blog
WLHack
DieHard Wolfer
DieHard Wolfer


Joined: 10 Jul 2005
Last Visit: 18 Jan 2018

Topics: 66
Posts: 1241
Location: Loppi - Finland
finland.gif

PostPosted: Mon Apr 09, 2007 3:15 am
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Okay... Here is the working code (based on Dugtrios tutorial)...
Its a bit memory wasting and I bet there is many ways to optimize it
but here it is anyway...

Okay... Now lets start (I used SPR_STAT_1 aka. Green barrel as an
example).

Open WL_Agent.C and go to the Cmd_Use - function...
There under "boolean elevatorok" add this line:

::: CODE :::

statobj_t       *statptr;


Now scroll down a bit more until you see these lines:

::: CODE :::

doornum = tilemap[checkx][checky];
if (*(mapsegs[1]+farmapylookup[checky]+checkx) == PUSHABLETILE)
{
   //
   // pushable wall
   //

   PushWall (checkx,checky,dir);
   return;
}


Now directly under them add these lines:
::: CODE :::


for(statptr = &statobjlist[0]; statptr != laststatobj; statptr++)
{

   //Check the sprite:
   if(statptr->tilex == checkx && statptr->tiley == checky &&
      statptr->shapenum == SPR_STAT_1 && !buttonheld[bt_use])
   {
      buttonheld[bt_use] = true;
       
      //Check direction of movement (corrected directions)
      switch(dir)
      {
           case di_north:
           if((unsigned)actorat[checkx][checky-1] == 1) // Check if new tile is free
                return;
                     
           check = actorat[checkx][checky-1];           // Check for walls
           if (check && check<objlist)
                             return;

           statptr->tiley = checky-1;                //Move object north
           statptr->visspot = &spotvis[checkx][checky-1];

           (unsigned)actorat[checkx][checky] = 0;    //Make old tile unblocking...
           (unsigned)actorat[checkx][checky-1] = 1;  //...And new one blocking
           break;

           case di_east:
           if((unsigned)actorat[checkx+1][checky] == 1)
               return;

           check = actorat[checkx+1][checky];       
           if (check && check<objlist)
                            return;

            statptr->tilex = checkx+1;                //Move object east
            statptr->visspot = &spotvis[checkx+1][checky];

            (unsigned)actorat[checkx][checky] = 0;   
            (unsigned)actorat[checkx+1][checky] = 1; 
            break;

           case di_south:
           if((unsigned)actorat[checkx][checky+1] == 1)
                return;

           check = actorat[checkx][checky+1];         
           if (check && check<objlist)
                            return;

           statptr->tiley = checky+1;                //Move object south
           statptr->visspot = &spotvis[checkx][checky+1];

            (unsigned)actorat[checkx][checky] = 0;   
            (unsigned)actorat[checkx][checky+1] = 1;
            break;

           case di_west:
           if((unsigned)actorat[checkx-1][checky] == 1)
                             return;

            check = actorat[checkx-1][checky];         
            if (check && check<objlist)
                             return;

            statptr->tilex = checkx-1;                //Move object west
            statptr->visspot = &spotvis[checkx-1][checky];

            (unsigned)actorat[checkx][checky] = 0;   
            (unsigned)actorat[checkx-1][checky] = 1; 
            break;

            case nodir:
                    return;
      }

// This is optional:
 
//    gamestate.secretcount++;
//    SD_PlaySound (PUSHWALLSND);

   }

}


Now... Thats is the all code you need (or atleast I don't remember adding any extra code)...
BTW: When you select the object you want to be movable, make sure that it isn't defined
as a "bo_" in WL_Act1.C...

And if you are going to use non-blocking objects, remember to comment out the lines defining
that the new tile is blocking (also the line defining that the old tile is unblocking is useless in
that case an can be commented out)...

_________________
False Spear download
False Spear SDL download
Wolfenstein-blog


Last edited by WLHack on Tue Apr 10, 2007 2:30 am; edited 1 time in total
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 6:27 ago.

Topics: 73
Posts: 3769

blank.gif

PostPosted: Mon Apr 09, 2007 5:12 am
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

This is great! Everything works fine, I haven't encountered any bugs so far. This could be used for some interesting level design.
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 6:27 ago.

Topics: 73
Posts: 3769

blank.gif

PostPosted: Mon Apr 09, 2007 7:15 am
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Can this also be used for guards, so that you can push guards away?
WLHack
DieHard Wolfer
DieHard Wolfer


Joined: 10 Jul 2005
Last Visit: 18 Jan 2018

Topics: 66
Posts: 1241
Location: Loppi - Finland
finland.gif

PostPosted: Mon Apr 09, 2007 8:38 am
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You can try that, but I think it needs some additional coding.
Since guards and other actors has preferences like obclass ...

_________________
False Spear download
False Spear SDL download
Wolfenstein-blog
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2255
Location: Ontario
canada.gif

PostPosted: Mon Apr 09, 2007 8:49 pm
   Subject: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Actually WL_Hack.. Here's what I was using.. Smile

::: CODE :::

char      dx4dir[4]={ 0, 1, 0, -1 };  // dx & dy based on direction
char      dy4dir[4]={-1, 0, 1,  0 };

/* ================= Cmd_Use ================ */
void Cmd_Use (void)
{
  objtype   *check;
  int       checkx,checky,doornum,dir;
#ifndef ELEVFIX
  boolean   elevatorok;
#endif 
#ifdef GAMEMSGSOBJECT 
  statobj_t   *statptr;
#endif
#ifdef TREASURECHEST
byte        chestresult;
#endif
// find which cardinal direction the player is facing
  if (player->angle < ANGLES/8 || player->angle > 7*ANGLES/8)
  {
    dir = di_east;
#ifndef ELEVFIX
    elevatorok = true;
#endif
  }
  else if (player->angle < 3*ANGLES/8)
  {
    dir = di_north;
#ifndef ELEVFIX   
    elevatorok = false;
#endif
  }
  else if (player->angle < 5*ANGLES/8)
  {
    dir = di_west;
#ifndef ELEVFIX
    elevatorok = true;
#endif
  }
  else
  {
    dir = di_south;
#ifndef ELEVFIX
    elevatorok = false;
#endif
  }
  checkx = player->tilex + dx4dir[dir];
  checky = player->tiley + dy4dir[dir];

  doornum = tilemap[checkx][checky];
  if (*(mapsegs[1]+MAPSIZE*checky+checkx) == PUSHABLETILE)   // pushable wall
  {
    PushWall (checkx,checky,dir);
    return;
  }
  for(statptr = &statobjlist[0]; statptr != laststatobj; statptr++)
  {
    if(statptr->tilex == checkx && statptr->tiley == checky && !buttonheld[bt_use])
    {
      buttonheld[bt_use] = true;        // that must react spacebar
      switch (statptr->shapenum)
      {
#ifdef GAMEMSGSOBJECT  // Trying to use this object - give in-game message
        case SPR_STAT_35: SetMessage("You won't fit in there!"); break; // Wooden Barrel
// If you want sprites to have messages for touching them - add the sprite here
// as a case, and then the message you want.  ie:
        case SPR_STAT_18: SetMessage ("You were expecting a Parrot?"); break; // Skeleton cage
        case SPR_STAT_17: SetMessage ("You don't have time to get in the cage!"); break; // empty cage
        case SPR_STAT_13: SetMessage ("Who are you? An interior decorator?"); break; // empty table
        case SPR_STAT_5: SetMessage ("What? Can't I just hang around?"); break; // hanging skeleton
        case SPR_STAT_37: SetMessage ("Is there anyone in there?"); break; // empty well
#endif
#ifdef PUSHOBJECT      // Objects that can be pushed
        case SPR_STAT_1: // Green Barrel
        // Add additional pushable sprite cases here
        {
          check = (unsigned)actorat[statptr->tilex + dx4dir[dir]][statptr->tiley + dy4dir[dir]];
          if(check) return;        // Is Tile Free? Yes?No?
          if (MAPSPOT(statptr->tilex + dx4dir[dir],statptr->tiley + dy4dir[dir],0) >= 1
           && MAPSPOT(statptr->tilex + dx4dir[dir],statptr->tiley + dy4dir[dir],0) <= MAXWALLTILES)
            return; // Hit a wall
           if (check && check<objlist) return;                           // Bad or Removed Item
           (unsigned)actorat[statptr->tilex][statptr->tiley] = 0;        // Free original Tile
          statptr->tilex = statptr->tilex + dx4dir[dir];                // Free to move object
          statptr->tiley = statptr->tiley + dy4dir[dir];                // to it's new location 
          statptr->visspot = &spotvis[statptr->tilex][statptr->tiley];          // Make it visible
          (unsigned)actorat[statptr->tilex][statptr->tiley] = 1;                // Block New Position
          SetMessage ("Item Moved");
        }
#endif
#ifdef TREASURECHEST   // Dugtrio's idea on a Treasure Chest - BT Modified
        case SPR_TRESCHEST:
        {
          statptr->shapenum = SPR_TRESCHESTOPEN;
           switch (US_RndT ()%10)
           {
             case 0: // surprise - ammo
             case 5:
               GiveAmmo (20,wp_pistol);
               SD_PlaySound (GETAMMOSND);
              break;
             case 1: // surprise - health bonus
             case 6:
               HealSelf (50);
               SD_PlaySound (HEALTH2SND);
               break;
            case 2: // Ouch! - It exploded.. and hurt the player
            case 7:
              SD_PlaySound (MISSILEFIRESND);
              TakeDamage (30,NULL);
              break;
            case 3: // Points Bonus
            case 8:
              SD_PlaySound (BONUS4SND);
              GivePoints (5000);
              break;
            case 4: // Chest is empty
            case 9:
              SD_PlaySound (SELECTITEMSND);
              break;
          }
          StartBonusFlash ();
          break;
        } 
#endif         
        default: break;
      }
    }
  }
  if (!buttonheld[bt_use] && doornum & 0x80)
  {
    OperateDoor (doornum & ~0x80);
  }
  else if (!buttonheld[bt_use] && doornum)
  {
    buttonheld[bt_use] = true;
    switch (doornum) 
    {
      case ELEVATORTILE:   // use elevator
#ifndef ELEVFIX       
        if (elevatorok)
#endif       
        {
          tilemap[checkx][checky]++;    // flip switch
          if (*(mapsegs[0]+MAPSIZE*player->tiley+player->tilex) == ALTELEVATORTILE)
            playstate = ex_secretlevel;
          else
            playstate = ex_completed;
          SD_StopSound();     
          SD_PlaySound (LEVELDONESND);
          while (SD_SoundPlaying()) SD_Poll();  // Allow for longer switch sounds
          SD_WaitSoundDone();
          break;
        }
#ifdef PUSHSWITCH
      case SWITCHTILE:
      case SWITCHTILE+1:
        SD_PlaySound (LEVELDONESND);
        if (doornum == SWITCHTILE)
        { 
 #ifdef GAMEMSGS
          SetMessage ("Do you hear something moving?");
 #endif
          tilemap[checkx][checky]++;
        }
        else
        {
 #ifdef GAMEMSGS
          SetMessage ("Did you hear something move this time?");
 #endif
          tilemap[checkx][checky]--;   
        }
        switch (MAPSPOT(checkx,checky,1))
        {
          case 700: // Pushwall North
            PushWall (pwx,pwy,di_north);
            break;
          case 701: // Pushwall South
            PushWall (pwx,pwy,di_south);
            break;
          case 702: // Pushwall East
            PushWall (pwx,pwy,di_east);
            break;
          case 703: // Pushwall West
            PushWall (pwx,pwy,di_west);
            break;
          case 708: // Pushwall2 North
            PushWall (pw2x,pw2y,di_north);
            break;
          case 709: // Pushwall2 South
            PushWall (pw2x,pw2y,di_south);
            break;
          case 710: // Pushwall2 East
            PushWall (pw2x,pw2y,di_east);
            break;
          case 711: // Pushwall2 West
            PushWall (pw2x,pw2y,di_west);
            break;
          case 716: // Pushwall3 North
            PushWall (pw3x,pw3y,di_north);
            break;
          case 717: // Pushwall3 South
            PushWall (pw3x,pw3y,di_south);
            break;
          case 718: // Pushwall3 East
            PushWall (pw3x,pw3y,di_east);
            break;
          case 719: // Pushwall3 West
            PushWall (pw3x,pw3y,di_west);
            break;
          case 724: // Pushwall4 North
            PushWall (pw4x,pw4y,di_north);
            break;
          case 725: // Pushwall4 South
            PushWall (pw4x,pw4y,di_south);
            break;
          case 726: // Pushwall4 East
            PushWall (pw4x,pw4y,di_east);
            break;
          case 727: // Pushwall4 West
            PushWall (pw4x,pw4y,di_west);
            break;
        }
        break;   
#endif   
#ifdef AMMOWALLS    // Ammo Rack
      case AMMOWALLTILE:
        if(gamestate.ammo >= MAXAMMO) return;
        tilemap[checkx][checky]++;
 #ifdef GAMEMSGS
        SetMessage (AMMOWALLMSG);
 #endif
        SD_PlaySound(GETAMMOSND);
        GiveAmmo (AMMOWALLAMMO,wp_pistol);
        StartBonusFlash();
        break;
#endif
#ifdef HEALTHWALLS
      case HEALTHWALLTILE:
        if(gamestate.health >= MAXHEALTH) return;
        tilemap[checkx][checky]++;
 #ifdef GAMEMSGS
        SetMessage (HEALTHWALLMSG);
 #endif
        SD_PlaySound(HEALTH2SND);
        HealSelf (HEALTHWALLHEALTH);
        StartBonusFlash();
        break;
#endif
      default:
        break;
    }
  }
  else SD_PlaySound (DONOTHINGSND);
}


Yep.. there's a lot there, including my Switch Activated Pushwall Code (idea from MSC and Areyep - via EoD). Also included is my elevator fix... What that is is this:

Wall Pic 21 is the elevator switch down... the dark pick for it is the elevator rails... then pic 22 is the switch up and the dark image for it is a black image... What I do for elevatorfix (ELEVFIX) is I export the switch up, the switch down and the elevator rails... and in my favorite graphic editor, I reduce the brightness by an amount to match how the rest of the walls are (light/dark) in the vswap... so now I have switch down light & dark... switch up, light & dark, and elevator rails - also light & dark... Now... I insert the dark switch down over the 21 dark image (original elevator rails)... I insert the dark switch up into the "black" image... and then I insert the elevator rails into a new graphic slot (the first one open after the regular or original walls) and reset the defines in my Mapediting program and fix all the maps so that they conform to my new graphic values/location in the vswap....

What this does is this... Normally, you can only have elevators that work in the North/South directions... Well.. if you've done everything properly.. You now have the ability to put elevators in the East/West directions as well... It's not much of a change, but will really mess up someone as they usually look for elevators in the original North/South position.. Smile

Want to have even more fun with the elevators... use this graphic (making light and dark images) into the next free open graphic and I can now also create proper dead elevators as well... Evil or Very Mad

And the other stuff... well.. that's Dugtrio's code for say a treasure chest... and the possible bonus items that you can get from it... (just add two sprites into the vswap - there is no need to do anything else like the bo_?? stuff... Smile ) And then there is the same idea with the Health and Ammo Walls...

But yeah... lol... My code is much smaller as I set the checkx and checky directions using the trick from Darkone's NewWolf code... You can also use those dx4dir & dy4dir defines for pushwalls (and save some space as well... Smile ).

Anyhow... enjoy... Smile

Greg
BrotherTank

PS: the messages for those items are due to medications and lack of sleep... it's over 36 hours now and counting... lol... man I need some sleep... I look like a Racoon... really.. lol... I've got complete black circles around both eyes... .. anyhow... play with that and see what you think??

BT Tank


Last edited by BrotherTank on Tue Apr 10, 2007 10:46 am; edited 1 time in total
WLHack
DieHard Wolfer
DieHard Wolfer


Joined: 10 Jul 2005
Last Visit: 18 Jan 2018

Topics: 66
Posts: 1241
Location: Loppi - Finland
finland.gif

PostPosted: Mon Apr 09, 2007 11:56 pm
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Wow, You are genius...
Heh... I should have known.

_________________
False Spear download
False Spear SDL download
Wolfenstein-blog
doomjedi
DieHard Wolfer
DieHard Wolfer


Joined: 21 Jul 2006
Last Visit: 1:29 ago.

Topics: 111
Posts: 2882
Location: Israel
israel.gif

PostPosted: Tue Apr 10, 2007 2:46 am
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Wow, now we can make cool wolf3d version of "Sokoban" game Smile
...anyone to make such a project? it could be soooo cool
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2255
Location: Ontario
canada.gif

PostPosted: Tue Apr 10, 2007 10:44 am
   Subject: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Actually, sorry guys... the meds had me in the wrong directory, along with the lack of sleep... and I posted old code when I was trying to show you what I had done... I've updated the code in the original post to make it work properly... or just replace the code for pushing with this:

::: CODE :::

          check = (unsigned)actorat[statptr->tilex + dx4dir[dir]][statptr->tiley + dy4dir[dir]];
          if(check) return;        // Is Tile Free? Yes?No?
          if (MAPSPOT(statptr->tilex + dx4dir[dir],statptr->tiley + dy4dir[dir],0) >= 1
           && MAPSPOT(statptr->tilex + dx4dir[dir],statptr->tiley + dy4dir[dir],0) <= MAXWALLTILES)
            return; // Hit a wall
           if (check && check<objlist) return;                           // Bad or Removed Item
           (unsigned)actorat[statptr->tilex][statptr->tiley] = 0;        // Free original Tile
          statptr->tilex = statptr->tilex + dx4dir[dir];                // Free to move object
          statptr->tiley = statptr->tiley + dy4dir[dir];                // to it's new location 
          statptr->visspot = &spotvis[statptr->tilex][statptr->tiley];          // Make it visible
          (unsigned)actorat[statptr->tilex][statptr->tiley] = 1;                // Block New Position
          SetMessage ("Item Moved");


This is the working code section...

Greg
BrotherTank
TexZK
DieHard SS
DieHard SS


Joined: 07 Feb 2004
Last Visit: 19 Oct 2016

Topics: 19
Posts: 370
Location: Northern Italy
italy.gif

PostPosted: Fri Apr 27, 2007 7:25 am
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You could also hit their neck if the displayed guard picture is the back one (or by computing the viewing angle to check if it's backward). This way you can make add bit more "stealth" features.
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 1:03 ago.

Topics: 38
Posts: 2498
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Sun Dec 09, 2007 4:52 pm
   Subject: Re: moving objects
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

One way of doing this might be to remove the static object and temporarily turn it into a projectile, spawning another static object on the tile where it was pushed once it reaches the centre of that tile and removing the temporary object. This would show a sliding image using the actor list. This could also lead on to things like having the direction of the object being a full 360 degrees based on player->angle rather than four directions.
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Feature Fanatics View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts WOLF4GW
Author: Tricob
110 37924 Thu Oct 08, 2015 9:17 am
Chris View latest post
No new posts [idea] Sniper Mode for Wolf3d
Author: MAREK17
3 112 Wed Aug 29, 2007 6:47 pm
BrotherTank View latest post
No new posts Wolf3D and voxels
Author: Ripper
10 3868 Sat Mar 24, 2007 3:35 pm
Dugtrio17 View latest post
No new posts Ca-razy idea
Author: Thomas
6 1596 Sat Jun 03, 2006 11:26 am
lwmxynedtodth View latest post
No new posts cool Items and Objects in Wolfenstein
Author: andy3012
3 1601 Sun Nov 14, 2004 12:40 pm
Haasboy View latest post
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
   You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group