Build and blow up a door


(jkfloris) #1

I want to make a door that can be blow up and build again.
I try to make the door and turn it into a func_constructible
but that doesn’t work. When I chance the door with a model
everythink works perfect.
What is wrong?
the func_constr. or the script

The door is called “zijdeur”


zijdeur
{
	spawn
	{
		wait 400
		trigger zijdeur setup

		constructible_class 3
	}

	trigger setup
	{
		setstate zijdeur_materials default
		setstate zijdeur_materials_clip default
		setstate zijdeur_flag default


		setstate zijdeur_deur invisible
	}

	buildstart final
	{
		setstate zijdeur_materials default
		setstate zijdeur_materials_clip default
		setstate zijdeur_flag default


		setstate zijdeur_deur underconstruction
	}

	built final
	{
		setstate zijdeur_materials invisible
		setstate zijdeur_materials_clip invisible
		setstate zijdeur_flag invisible

		setstate zijdeur_deur default


		wm_announce "Side Door has been constructed."

	}

	decayed final
	{
		setstate zijdeur_materials default
		setstate zijdeur_materials_clip default
		setstate zijdeur_flag default


		setstate zijdeur_deur invisible
	}

	death
	{
		setstate zijdeur_materials default
		setstate zijdeur_materials_clip default
		setstate zijdeur_flag default

		setstate zijdeur_deur invisible


		wm_announce "Side Door has been destroyed."


	}

	trigger remove
	{
		setstate zijdeur_toi invisible
		setstate zijdeur_materials invisible
		setstate zijdeur_materials_clip invisible
		setstate zijdeur_flag invisible
		setstate zijdeur_deur invisible

	}
}


(Storm) #2

i think your problem my be that you want a func_door to get blown up and contructed, so maybe you need to make a contructable door


(Drakir) #3

I belive that u cannot make a door with the func_costructible.

What u need to do is make something invisible built and then change the state of the door so that it turns up when the invis stuff is built. That way u can fool the player thinking he built the door.


(heeen) #4

it’s basically very simple.
build a standard func_constructible that represents the frame of the door, that will be blown up with the door.
give it the start_built flag.
give it the targetname sidedoor_frame
build a standard func_door_rotating, give it the targetname sidedoor


sidedoorscript
{
   spawn
   {
		wait 200
		constructible_class 3
		setstate sidedoor_materials invisible

  }

	buildstart final
	{
	setstate sidedoor underconstruction
	}

   built final
   {
		setstate sidedoor_materials invisible
		setstate sidedoor default
	wm_announce   "Axis team has rebuilt the Side Door!"
   }

   decayed final
   {
	setstate sidedoor invisible
   }

   death
   {
	setstate sidedoor_materials default
    wm_announce   "Allied team has breached the side Door!"
	setstate sidedoor invisible
   }

}

NOTE: you don’t need to setstate underconstruction and default for the actual constructible (sidedoor_frame), that’s handled by the game automagically


(jkfloris) #5

sorry heeen

when I try that I get a
“func_constructible has a missing parent
trigger_objective_info sidedoor_frame”
:???: :???: :???:


(heeen) #6
  1. follow the construction guides to build a simple blow-up wall, make it look like the frame of the door.
    (including building materials materials clip, trigger_objective_info and script, give it the flag Start_built)
    name it side_door_frame (note that the trigger has to point to the frame)
    the script will look likr this:

doorframescript
{

spawn
{
wait 200
constructible_class 3
setstate doorframe_materials invisible
}

built final
{
setstate doorframe_materials invisible
wm_announce   "Door rebuilt!"
}

decayed final
{

}

death
{
trigger self startup
wm_announce   "Door destroyed!"
setstate doorframe_materials default
}

}

  1. build a standard func_rotating door, give it the targetname “sidedoor”
    modify the code, so it looks like:

doorframescript
{

spawn
{
wait 200
constructible_class 3
setstate doorframe_materials invisible
}

built final
{
setstate doorframe_materials invisible
wm_announce   "Door rebuilt!"
}

buildstart final
{
setstate sidedoor underconstruction
}

decayed final
{
setstate sidedoor invisible
}

death
{
trigger self startup
wm_announce   "Door destroyed!"
setstate doorframe_materials default
setstate sidedoor invisible

}

}