Multiple Construction Items


(swaggers) #1

I got my construction to work. The crates disappear on the wall being made and come back if the wall is destroyed.

I’m now having problems with multiple contructions.

I don’t quite understand the LDR.

I understand it has something to do with the Track setting on the func_constructible. But I don’t understand the exact linking between the first item I place and subsequent items and what key/values need to be added to both.


(sock) #2

It seems the HTML documentation has got some dubious spelling mistakes which are not in the original word doc. How they got into the document I’m not sure atm but obviously this will cause some problems.

Multiple stages are all about 2 keys on the “func_constructible” called “constages, desstages”. These key lists point to additional brushwork entities “func_brushmodel”. Each “func_brushmodel” has a targetname key which appears on the “func_constructible” key lists. (constages,desstages)

The LDR does have a very good sample script for making multiple stage construction work correctly. The real tricky bit is understanding the key lists for construction and destruction.

Sock
:moo: ing


(swaggers) #3

Thanks for the reply sock but that wasn’t specifically what I was having problems with. I didn’t word the request very well. What I am having problems with is having multiple brushes and/or models all come up at the same time during a single build stage.

Ala MG with sandbags type of thing.

Thanks

EDIT: I can get the crates and the clip around the crates linked to the TOI so they both come and go as needed but I can’t get the build to build both a MG and a wall and some sandbags.

EDIT2: Figured it out. I was treating gamemodels and brushes the same. gamemodels come and go with the scripting, brushed all have to be linked to the func_const.

Anyone know a way to add another brush to the func_const after it’s been made? Or do I have to start all the brushed over??


(sock) #4

Ok here is a description of what to do to create a single stage construction from scratch. This description would be better if it had screenshots and a sample map but maybe someone else will do that …

This description assumes you have setup the editor, unpacked the pak0.pk3 file, know how the editor works, can pat your head and rub your tummy at the same time!

The map editor.

  1. Create a misc_gamemodel entity which will be the construction crates. Give the entity the following keys:

classname, misc_gamemodel
skin, models/mapobjects/cmarker/allied_crates.skin
model, models/mapobjects/cmarker/cmarker_crates.md3
targetname, construction_materials

  1. Create a misc_gamemodel entity which will be the flag. Give the entity the following keys:

classname, misc_gamemodel
skin, models/mapobjects/cmarker/allied_cflag.skin
model, models/mapobjects/cmarker/cmarker_flag.md3
targetname, construction_materials
angle, 180 (Facing direction)
modescale, 0.4
spawnflags, 2 (Animated)
frames, 190 (Total frames)

  1. Create a rough set of clip brushes for the construction crates and turn them into a “script_mover” entity. Remember to include an origin brush as well. All “script_mover” entities require a scriptname key to be defined regardless if used or not.

classname, script_mover
targetname, construction_materials
scriptname, construction_materials
spawnflags, 2 (This makes the script_mover solid)

  1. Create a Trigger_objective_info brush around the crates. This is the zone where the engineer has to wave his pliers about. Remember to include an origin brush as well.

classname, trigger_objective_info
targetname, construction_toi
scriptname, construction_toi
target, construction_target (Points to the func_constructible)
shortname, Construction MG (Command map name)
track, the Construction MG
spawnflags, 1 (This is constructible by Allied)

  1. Create your MG42 entity in the right location.

classname, misc_mg42
targetname, construction_mg42 (Needs to be different because of the repairmg42 command)
track, construction_track (This links all the extra stuff together)
accuracy, 0.5
angle, 90

  1. Create 2 sandbag models around the MG42 nest.

classname, misc_gamemodel
targetname, construction_extra
track, construction_track (This links all the extra stuff together)
model, models/mapobjects/miltary_trim/sandbag1_45s.md3
angle, 215

classname, misc_gamemodel
targetname, construction_extra
track, construction_track (This links all the extra stuff together)
model, models/mapobjects/miltary_trim/sandbag1_45s.md3
angle, 135

  1. Finally create the “func_constructible” brushwork entity. Usually this is the clip brushes around the sandbag models and some clipping around the front of the MG42 so people don’t fall into it. Remember to include an origin brush as well.

classname, func_constructible
targetname, construction_target
track, construction_track (This links all the extra stuff together)
scriptname, construction_script (The main script routine)
spawnflags, 8 (Allied construction)

Quick summary.

The func_constructible, sandbags and mg42 all have the same track key which lets the construction system know it all belongs together and needs to be constructed/destroyed together.

The mg42 entity needs a different targetname key because it is referenced directly in the script for the repairmg42 command. This command is needed so the mg42 is never built damaged.

The construction crates, flag, script_mover clip brushes all have the same targetname “construction_materials” so they can be treated as one entity in a manner of speaking. The script will treat all these components as one.

Finally the Trigger_objective_info entity is linked to the func_constructible.

The script.

construction_script
{
	spawn
	{
		wait 200
		constructible_class 2
		trigger self startup
	}

	buildstart final
	{
	}

	built final
	{
		setstate construction_extra default
		setstate construction_mg42 default
		setstate construction_materials invisible

		// Some kind of UI pop-up to alert players
		wm_announce	"Allied team has built the construction!"
	}

	decayed final
	{
		trigger self startup
	}

	death
	{
		trigger self startup
		// Some kind of UI pop-up to alert players
		wm_announce	"Axis team has destroyed the construction!"
	}

	trigger startup
	{
		setstate construction_extra invisible
		setstate construction_mg42 invisible
		setstate construction_materials default
		repairmg42 construction_mg42
	}
}

The code is an alternative way again of creating single staged constructions but instead of duplicating the same commands over and over again in each of the different functions. I use a single trigger function at the bottom of the routine which does the same stuff.

Sock
:moo: ing


(swaggers) #5

Thanks sock. Had most of that figured out now. You just beat my edit. This is a big help.

Nice trigger shortcut in the script too.

So an origin brush is just a small brush with the common origin texture? What does it do? So far I haven’t done this and I have had no problems.


(sock) #6

Check the goldrush map for examples of the origin brushes. (Look at the tank barriers construction crates etc) They are needed because they can produce strange results for no apparent reasons. Like for example your construction appearing in the wrong place on the command map, dynamite not destroying func_constructible correctly. Trust me just add the origin brushes and it will save you loads of grief later.

Weekend time for me, later peps.

Sock
:moo: ing


(swaggers) #7

Trying to get multiple stage constructions to work now. I don’t understand the use of func_brushmodel. I keep getting a func_brushmodel missing model error.


(sock) #8

Cant say Im too happy with the name of this entity because it does not generally contain any models but is made from brushwork. Multiple construction are fairly straight forward once you have mastered single stage constructions. But they must contain a origin brush to work correctly.

First create your initial “func_constructible” in its final construction state. This current map location of the “func_constructible” is where all of the other stages are placed/built/damaged.

Then take a copy of your “func_constructible” entity and convert it into a “func_brushmodel”. A quick way is either to edit the classname manually or just right-click and choose func_brushmodel from the list. GTK will convert the entity into the right type for you but will lose all key/values of the previous entity.

The trick with “func_brushmodel” entities is to get the “targetname” key right because they will appear in the “constage” “desstage” keys for the “func_constructible” entity.

The ET reference manual contains a really good diagram showing the flow of multiple stage constructions. (There is a slight error in the diagram but technically its not important) The sample script in the manual is a perfect example of multiple stage constructions and is a very good template to build from.

As long as you always include origin brushes in construction entities you will be fine. The Origin brush is extremely important and is often the cause of the most bizarre errors.

Sock
:moo: grass


(swaggers) #9

thanks again.

Got it working.


(lennyballa) #10

modescale, 0.4

I just wanna tell it’s modeLscale, for the new mapper :stuck_out_tongue:


(Flash95) #11

I got one constructable to work in my map no prolems. but then I tried to add a second one in another place in the map. both for them broke and I cant figure out why. I made sure there were no duplicate names on any of the entitys.

the only dup is on the trigger objective inf enty
scriptname - construction_toi and tagretname - construction_toi
but I dont know what else to set them to…


(Flash95) #12

oh one other thing each constructable works if I remove the other one from the map and script.


(lennyballa) #13

Sock, could you please explain those constage things and desstage. I’m trying to make a double constructable (Like bridge in Fueldump), but i can’t figure it out :frowning:


(sock) #14

The “constage” and “desstage” keys on the “func_constructible” entity are simply lists of the various stages. Remember all the various construction/destruction stages have to be “func_brushmodel” entities.

So for example if you had two “func_brushmodel” entities with “targetname” keys of “bridgepart1”, “bridgepart2” then the “constage” key on the “func_constructible” would be “bridgepart1;bridgepart2;”. The “constage” “desstage” keys are very touchy on extra spaces or grammer.

Sock
:moo:


(lennyballa) #15

Thx sock this can help me out :slight_smile:
Do you also need a script for it?


(opus) #16

That’s what I’m wondering too. That script is only an alternate method, correct?

:???:


(sock) #17

Yes you certainly do, ALL CONSTRUCTIBLE in ET need scripting and multiple stage construction is no different. the Level Design Rreference has a very good generic script for understanding multiple stage constructions.

Sock
:moo:


(*[SfS]*OpTeRoN) #18

I understand and have made a constructable MG42 but I’m now trying to make a single-stage constructable footbridge.

I can’t give the actual footbridge brush the keys and values that I would with the MG42 entity.

Sock, can you explain how to replace the MG42 with a footbridge? :smiley:


(Storm) #19

i don’t know what went wrong my mg42 won’t fire infact i can’t even get on it the hand symbol is there but i can’t get on it i fallowed this tutorial to the T whats wrong!!! this and low fps are all that is holding my map from comming out this weeked like planed!!!


(kennie) #20

is there to a easy tutorial with much pics please