Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Skullhacker

My new megawad project + How do I make destroyable map things?

Recommended Posts

I love how in games like Duke Nukem and Blood, you can break windows and wooden things that are build into the maps. How do I do that in GZDoom Builder? I know how to use Slade pretty well, but I just can't find a good system. Can someone help me with this? This is for an megawad project I'm working on.

Here's a picture of my current project:1393317486_DOOM2_HellonEarth1_9_20204_36_39PM.png.05cf7701002ae12a88b981b209b029a2.png

Share this post


Link to post

For breakable glass, there's a built-in line special in ZDoom and derivative ports (the GlassBreak function). That's the simplest way to implement it into your map, but if you want more control over the effect, you'll need to write your own ACS script.

 

As for breakable props, they're easy to do with DECORATE or ZScript. Here's an example (in DECORATE) with the essential parts highlighted and descriptions of what purpose each of them serve:

 

actor FloorLamp_Active 23000
{
	height 56
	radius 8
	health 20 << To determine how much damage the prop can withstand before going to its Death state.
	mass 0x7FFFFFFF
	+SOLID << To make sure that the prop can be hit.
	+SHOOTABLE << Same purpose as the +SOLID flag. Both flags must be included!
	+NOBLOOD << To make the prop not spawn blood upon being destroyed. Because that would just look silly.
	States
	{
	Spawn:
		LMP1 A 5 BRIGHT
		Loop
	Death: << This is the state that the actor goes to when its health drops to 0.
		LMP3 A 1 A_PlaySound("lamp/break")
		LMP3 A -1
		Stop
	}
}

 

Share this post


Link to post

I'm also working on breakable props.

 

You need an actor which is spawned when something is destroyed. For example: this is from Doom Enhanced:

actor WOODGIB
{
    +DOOMBOUNCE
    PROJECTILE
    -NOGRAVITY
    -NOBLOCKMAP
    -SOLID
    +RANDOMIZE
    Radius 2
    Damage 0
    bouncefactor 0.2
    Speed 5
    States
    {
   Spawn:
        WOOD A 0 
        WOOD A 0 ThrustThingZ (0, 48, 0, 1) //Thows gibs up on Z axis.
        goto See
    See:
        WOOD ABCD 5 //Plays animation
        loop
    Death:
        TNT1 A 0 //Gib is cleared out
        Stop
    }
}

actor WOODGIB2 : WOODGIB //Very good idea is to inherit another version of the "gib" with different scale to easily vary the gib
{
     scale 1.5 //So WOODGIB2 is exactly same as WOODGIB but scaled up to 1.5.
}

To use this you need sprites:

WOODA0

WOODB0

WOODC0

WOODD0

 

How to use example:

actor SpikeTree replaces Stalagtite
{
  health 15
  radius 16
  height 40
  deathheight 40
  mass 1000
  +SHOOTABLE
  +SOLID
  +NOBLOOD
  +DONTGIB
  +RANDOMIZE
  +NOICEDEATH
  +SOLID
  states
  {
  Spawn:
    SMIT A -1
    stop
  Pain:
    SMIT A 5 A_PlaySound("gibbage/xwood")
    goto Spawn
  Death:
    SMIT B 0 A_PlaySound("gibbage/xwood")
    SMIT B 1 A_CustomMissile ("WoodGib", 32, 2, random(0,360), 2, 6)
    SMIT B 0 A_CustomMissile ("WoodGib2", 40, 2, random(0,360), 2, 10)
    SMIT B 0 A_CustomMissile ("WoodGib", 12, 2, random(0,360), 2, 20)
    SMIT B 0 A_CustomMissile ("WoodGib", 32, 2, random(0,360), 2, 15)
    SMIT B 1 A_CustomMissile ("WoodGib2", 20, 2, random(0,360), 2, 8)
    SMIT B -1
    stop
  }
}

Now you have to have SMITA0 sprite, intact version of the spike tree (from doom2.wad)

SMITB0 sprite from Doom Enhanced, broken version of the spike tree.

 

To hear sounds you have to have them in your PK3's sounds folder and defined in SNDINFO. I would suggest looking in Doom Enhanced for example. It has breakable lamps also.

 

This also has some breakable stuff:

HeXen / Heretic - Ultimate decoration pack
https://forum.zdoom.org/viewtopic.php?f=37&t=66784

 

Ask if something isn't clear! Are you familiar with DECORATE or zscript? ZDoom wiki is very useful:

https://zdoom.org/wiki/Main_Page

https://zdoom.org/wiki/DECORATE

https://zdoom.org/wiki/ZScript

 

I might put my "findings" together at some point but it will take time.

Edited by Jaska

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×