Open 2 Doors by Blowing Up Obj?


(Acizco) #1

So, I am a noob mapper who tries to create his first map. I want to make 2 doors that are locked, but when obj is destroyed, they both open.

I have made the objective, and the trigger field for it and it works all good. The doors, however, I am unsure on how to make. I can make them open fine with func_door, but how do I make them open from the obj trigger?

I tried to look around in forums/google, and I found some people with similar issues, but after all I really didn’t understand how they got it working. So if anyone could help a noob in trouble, that would be awesome :slight_smile:

Edit: Oh and incase someone misunderstood, by opening I mean they automatically open (slide up in my case), pretty much like doors on Adlernest once door controls are destroyed.


(twt_thunder) #2

I am a noob to mapping to, but I guess you will have to do this in the scripting. My best shot to help you must be to have a look at the script in original ET map Battery… That would be my guess


(Destroy666) #3

Don’t use func_door, use script_mover with path_corners
Here a simple explantation: http://forums.warchestgames.com/showthread.php/13921-Scripted-doors-prefab-(doors-opening-with-a-button)?p=149043&viewfull=1#post149043


(Loffy) #4

Hi!

Yep, just like Destroy666 says, make the door a script mover. And use scripting to move it up and down.


(Acizco) #5

Okay, I tried, and as im complete noob to scripting, ofc it didn’t work. Here’s my script:

http://pastebin.com/sC4P3BEF

Edit: Got it working, now here is the working script:

game_manager
{
	spawn
	{
		// Game rules 
		wm_axis_respawntime 5 
		wm_allied_respawntime 5 
		wm_number_of_objectives 1 
		wm_set_round_timelimit 30
	}
}
//////////////////////////////////////////////////
//						//
//		GENERATOR & DOORS		//
//						//
//////////////////////////////////////////////////

generator
{
	spawn
	{
		wait 200
		constructible_class 3
	}
	
	death
	{
		wm_announce "Generator destroyed! The doors are opening!"
		trigger hall_door1 move_up
		trigger hall_door2 move_up
	}
}

hall_door1
{
	trigger move_up
	{	
		wait 2000
		gotomarker doorpath_up1 50 wait
	}
}
hall_door2
{	
	trigger move_up
	{
		wait 2000
		gotomarker doorpath_up2 50 wait
	}
}

Was missing “constructible_class 3”, thats propably why nothing happened… :stuck_out_tongue:


(Mateos) #6

Thank you for sharing the code!

Perhaps you may precise with comments ( // Sentence ) so people see what are the requirements for entities/properties, but with the post up yours it’s easily understandable o/

Bookmarked, I will probably use it in the future :slight_smile:


(Acizco) #7

[QUOTE=Mateos;406014]Thank you for sharing the code!

Perhaps you may precise with comments ( // Sentence ) so people see what are the requirements for entities/properties, but with the post up yours it’s easily understandable o/

Bookmarked, I will probably use it in the future :)[/QUOTE]

Glad that I could help you :slight_smile: did as you requested, so here we go…

I have my blowing up objective func_explosive with scriptname ‘generator’ & targetname ‘generator’, and TOI with target ‘generator’. I have 2 doors with script_movers and path_corners for them. Doors have scriptnames ‘hall_door1’ and ‘hall_door2’. Path_corners have scritnames ‘movepath_up1’ & ‘movepath_up2’, respectively to the doors. Doors & their representing path_corners are linked to each other (ctrl + k).

Also, I appearently was so tired last night that I didn’t even paste the correct code to the post above, but I fixed it now. The ‘wait 2000’ command I had after ‘wm_announce’ was incorrectly placed, it must be placed individually for both doors.

With the following format, you can add more doors to the script aswell.

game_manager
{
	spawn
	{
		// Game rules 
		wm_axis_respawntime 5 
		wm_allied_respawntime 5 
		wm_number_of_objectives 1 
		wm_set_round_timelimit 30
	}
}
//////////////////////////////////////////////////
//						//
//		GENERATOR & DOORS		//
//						//
//////////////////////////////////////////////////

generator	//scriptname of the blowing up objective
{
	spawn
	{
		wait 200
		constructible_class 3
	}
	
	death
	{
		wm_announce "Generator destroyed! The doors are opening!"
		trigger hall_door1 move_up
		trigger hall_door2 move_up
	}
}

hall_door1	//door with script_mover, scriptname "hall_door1"
{
	trigger move_up
	{	
		wait 2000
		gotomarker doorpath_up1 50 wait		//defining the move of script_mover with help of path_corner, with scriptname "doorpath_up1"
	}
}
hall_door2	//door with script_mover, scriptname "hall_door2"
{	
	trigger move_up
	{
		wait 2000
		gotomarker doorpath_up2 50 wait		//defining the move of script_mover with help of path_corner, with scriptname "doorpath_up2"
	}
}

(Acizco) #8

Actually never mind. That code is wrong.

Appearently I understood the usage of path_corner wrong, and now I have no idea on how to use it at all… Can anyone help? Haven’t found a tutorial about it :L

So basically, the door starts to move, but it doesn’t go anywhere near the path_corner.


(Mateos) #9

Nice, thanks again :slight_smile: