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       

[n00b Tutorial] Making certain items drop on certain levels.
Page 1 of 1
DieHard Wolfers Forum Index -> Code Crackers 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
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 07 Jun 2016

Topics: 101
Posts: 1614
Location: A hole in the wall
australia.gif

PostPosted: Sun Dec 26, 2004 10:57 pm
   Subject: [n00b Tutorial] Making certain items drop on certain levels.
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

This tutorial makes an enemy drop a certain item depending on which level he is on. In this case we will make a guard drop a first aid kit on level 2, and on all other levels drop a used ammo clip.

This tutorial originates from Beyond Wolfenstein II SE source and has been fully tested.

Open WL_STATE.C and do a search for 'guardobj'. You should get:

::: CODE :::

case guardobj:
      GivePoints (100);
      NewState (ob,&s_grddie1);
      PlaceItemType (bo_clip2,tilex,tiley);
      break;


Adding a few lines like so will make the guard drop the health kit on level 2, and on other levels drop ammo:

::: CODE :::

case guardobj:
      GivePoints (100);
      NewState (ob,&s_grddie1);
   if  (mapon==1)
      {
         PlaceItemType (bo_firstaid,tilex,tiley);
         }
         else
         {

         PlaceItemType (bo_clip2,tilex,tiley);
   }
      break;


Fairly simple, the if (mapon==1) means 'if on level 2'. You are able to do it to different levels, and have more than one level involved:

::: CODE :::

case mutantobj:
      GivePoints (100);
      NewState (ob,&s_grddie1);
   if  (mapon==1)
      {
         PlaceItemType (bo_firstaid,tilex,tiley);
         }
         else if   (mapon==4)
         {
         PlaceItemType (bo_cross,tilex,tiley);
      }
         else
         {

         PlaceItemType (bo_clip2,tilex,tiley);
   }
      break;


This code makes all mutants on level 5 drop a gold cross when they die, and a first aid kit if on level 2, while the rest just drop the ammo clip.

_________________
Zombieskittles

Welcome to 2016, where DHW still thinks it is okay to ban the world's most popular email service provider, and I can't have an avatar over 10kb
jamez
I am Death Incarnate
I am Death Incarnate


Joined: 16 Mar 2003
Last Visit: 19 Oct 2017

Topics: 13
Posts: 186
Location: Yorkshire, UK
uk.gif

PostPosted: Mon Dec 27, 2004 9:59 am
   Subject: Re: [n00b Tutorial] Making certain items drop on certain lev
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Using this, if you write:

case guardobj:
GivePoints (100);
if (gamestate.weapon == wp_chaingun)
{
NewState (ob,&s_grddie1);
}
else
{
NewState (ob,&s_grd2die1);
}
PlaceItemType (bo_clip2,tilex,tiley);
break;

you can then write a new state in wl_act2.c and this will do the different dying frames (i think someone asked about this the other day)

_________________
~ James
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Crackers 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 Sticky: [Info] Help for newbie coders! C++ Tutorial
Author: Dugtrio17
20 9012 Sun Jan 10, 2010 12:26 pm
Fragstein3D View latest post
No new posts [Info] Black & White Effect - Tutorial
Author: Guest
10 297 Thu Mar 17, 2005 6:24 pm
Dugtrio17 View latest post
No new posts [Info] Making Guards Always Face You - Rotating guards
Author: CoolMario
3 88 Wed Jul 30, 2003 9:31 am
Codetech84 View latest post
No new posts [Info] Silent Gun? - Adding a Silencer
Author: Guest
4 194 Fri Apr 18, 2003 8:34 am
BrotherTank View latest post
No new posts [Info] Adding Locked Doors
Author: Guest
3 244 Thu Apr 17, 2003 6:30 am
Ripper 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