Constructible problem


(MadJack) #1

I’m not new to mapping but I’ve been out of the loop for some time…

Anyway, I’ve started to think about a map for ET and I’ve started re-learning most of what I’ve leared in the past and it’s been going well… Up to now. :S

I created a func_constructible (a ramp), some axis boxes as materials, the clipping for those boxes, the trigger and the origin textures (which are linked at their proper places)…

Before I continue, I have to say that I did an allied MG42 with sandbags which I took from the tutorial (sock’s) and it constructs nicely and the material dissappearr when it’s finished.

Now… My problem is that my ramp will get constructed ONLY if I remove the “scriptname axisrampway1” BUT the material will stay there. If I use “g_scriptdebug 1”, there is no scriptname (as it should) so the trigger in the script file doesn’t fire. Here’s the debug lines:

36036100: (n/a) GScript event: buiiltstart final
36038650: (n/a) GScript event: built final

For those that are seeing this for the first time, where there is (n/a) there usually is the “scriptname” key you set the entity to and it takes that key and go to the script and process the script’s command.

If I leave the scriptname key, I can’t construct the ramp, there is no pliers icon where I can wave mine to construct.

I have checked the numerous tuts, the ton of links, several forums but I just can’t figure it out.

So… anyone have any idea? It’ll be very much appreciated!

Thanks


(Ifurita) #2

Can you post your script?


(MadJack) #3

Here it is… I hope it’ll be ok

As you can see, it’s pretty small. It’s nothing really complicated. The first part (alliedconstruct1) is what I took from the tut.

I have changed “self” in the trigger to “axisrampway1” as a test and since bob used that same way in goldrush it shouldn’t make any difference/problem.

// ================================================
game_manager 
{ 
} 

// ================================================
alliedconstruct1
{
	spawn
	{
		wait 50
		trigger alliedconstruct1 setup
		constructible_class 2			// Dyno+Satchel
	}

	trigger setup
	{
		setstate alliedconstruct1_materials default	// Crate Models
		setstate alliedconstruct1_clip default	// Clip brushes
		setstate alliedconstruct1_flag default

		setstate alliedconstruct1_extra invisible	// Sandbags
		setstate alliedconstruct1_mg42 invisible	// MG42 entity
		repairmg42 alliedconstruct1_mg42
	}

	built final
	{
		setstate alliedconstruct1_materials invisible	// Crate Models
		setstate alliedconstruct1_clip invisible	// Clip brushes
		setstate alliedconstruct1_flag invisible

		setstate alliedconstruct1_extra default	// Sandbags
		setstate alliedconstruct1_mg42 default	// MG42 entity

		wm_announce "Allied Team have built the Rooftop MG42 nest!"
	}

	decayed final
	{
		trigger alliedconstruct1 setup
	}

	death
	{
		trigger alliedconstruct1 setup
		wm_announce "Axis have destroyed the Rooftop MG42 Nest!" 
	}
}

axisrampway1
{

	spawn
	{
		wait 50
		trigger axisrampway1 setup
		constructible_class 2
		
	}
	
	trigger setup
	{
		setstate axisrampway1_materials default
		setstate axisrampway1_clip default
		setstate axisrampway1_flag default
		
		setstate axisrampway1 invisible
	}
	
	built final
	{
		setstate axisrampway1_materials invisible
		setstate axisrampway1_clip invisible
		setstate axisrampway1_flag invisible
		
		setstate axisrampway1 default
		
		wm_announce "Axis Team have built the First Ramp!"
	}
	
	decayed final
	{
		setstate axisrampway1_materials default
		setstate axisrampway1_clip default
		setstate axisrampway1_flag default
		
		setstate axisrampway1 invisible

	}
	
	death
	{
		setstate axisrampway1_materials default
		setstate axisrampway1_clip default
		setstate axisrampway1_flag default
		
		setstate axisrampway1 invisible

		wm_announce "Allied Team have destroyed the First Ramp!"
	}
}

(Overtaker) #4

I am a noob, so pardon if this is a stupid suggestion… but dont you need a


         buildstart final
         {
         }

in your constructible script?

Also, I had a similar problem concerning command posts (closed) not disappearing. My problem was that I misspelled a targetname.

Sorry, if I knew more, I would offer help. But, this does sound exactly like my CP problem. Double check your targetnames just to be sure because your script looks right (except no buildstart final).

EDIT: To address the following:

Did you provide a scriptname key AND a targetname key for the func_constructible axisrampway1?


(MadJack) #5

Overtaker,

Thanks for your reply. :slight_smile:

buildstart is used when you start building something and can be used to do about anything. The first thing that comes to mind is to tell the other team that they are starting to construct (so they can try to stop them before it’s too late). But this is an optional step.

Check all the tutorials and you’ll see that this step is not used. Think about the Allied MG32 that is in that script. That step is not there and it works flawlessly.

As a side note to what I posted in my first message: Even though the materials don’t dissappear and the construction is made. I can destroy it with satchel or dynamite and I can rebuild it.


(Overtaker) #6

Ok, I just went back and looked at my map…this is what I did, and it works for me flawlessly. Make your construction box (misc_gamemodel), your flag, and your clip brushes all have the same targetname.

i.e.

construction crates
key: targetname
value: axis_construction_material

flag
key: targetname
value: axis_construction_material

clip brushes (grouped as script_mover <solid>)
key: targetname
value: axis_construction_material

Now, in your script. Replace the flag, crates, and clip targets with:
“setstate axis_construction_material invisible” under the built final subroutine.

Also, not to sound repetitive, but make sure your targetnames are spelled correctly in Radiant. The reason I say this, is because your script looks perfect. Its got to be an error within your entities. Although, I am a noob. So take that advise for what it is worth. Lol. Hope you get it fixed.
Best Wishes,
-Over

EDIT:

As a side note to what I posted in my first message: Even though the materials don’t dissappear and the construction is made. I can destroy it with satchel or dynamite and I can rebuild it.

Thats gotta mean that your targetname for your crates, flag, and clip dont match your scripting.

Again, make sure you have both scriptname and targetname set for your func_constructible. You need the targetname to make it disappear/appear, but you need the scriptname for the routine.

Someone please correct me if im wrong!


(nUllSkillZ) #7

You can also summarize some actions that are in some of the events.
And create a new even which is called via a trigger action out of the other events.
Don’t know where I’ve got this from.
But I think it’s from sock’s LDR.
For example my constructible part of an script:


// func_constructible "Klotz"
Klotz
{
	spawn
	{
		wait 200
		trigger self setup
		constructible_class 3 // 3 = dynamit / 2 = satchel charge
	}

	trigger setup
	{
		setstate Klotz invisible
		setstate Crates default
	}

	buildstart final
	{
		setstate Klotz underconstruction
		setstate Crates default
	}

	built final
	{
		setstate Klotz default
		setstate Crates invisible
		wm_announce "The Klotz has been build!"
	}

	decayed final
	{
		trigger self setup
	}

	death
	{
		trigger self setup
		wm_announce "The Klotz has been destroyed!"
	}
}


(Overtaker) #8

//This controls the axis emergeny barrier (construction)
axis_const_script
{
	spawn
	{
		wait 200
		constructible_class 2
		trigger self startup  //triggers startup routine...see below!
	}
	
	buildstart final
	{
	}
	
	built final
	{
		setstate axis_emergancy_door_info default  //ignore this
		setstate axis_const_toi invisible  //this is the target obj info
		setstate axis_construction default  //actual construction
		setstate axis_const_materials invisible  //this is crates,clips, & flag
		wm_announce  "The Axis have constructed an emergancy barrier!!"
	}
	
	decayed final
	{
		trigger self startup
	}
	
	death
	{
		trigger self startup
		wm_announce  "The emergancy barrier has been destroyed!!"
	}
	
	trigger startup  //This is the trigger routine.
	{
		setstate axis_const_toi default
		setstate axis_construction invisible
		setstate axis_const_materials default
		setstate axis_emergancy_door_info invisible  //ignore this
	}
}

This is my script snipit for the func_constructible.

Now here are the related entities:


// entity 19____this is the crates
{
"classname" "misc_gamemodel"
"origin" "-1084 -320 0"
"model" "models/mapobjects/cmarker/cmarker_crates.md3"
"skin" "models/mapobjects/cmarker/axis_crates.skin"
"targetname" "axis_const_materials"

// entity 20_____this is the flag
{
"classname" "misc_gamemodel"
"origin" "-1112 -316 48"
"model" "models/mapobjects/cmarker/cmarker_flag.md3"
"skin" "models/mapobjects/cmarker/axis_cflag.skin"
"modelscale" "0.4"
"spawnflags" "2"
"targetname" "axis_const_materials"
"frames" "190"
"angle" "360"

// entity 21________this is the script mover that contains clips and an origin
{
"classname" "script_mover"
"spawnflags" "2"
"targetname" "axis_const_materials"
"scriptname" "axis_const_materials"

// entity 22___this is the trigger objective info
{
"classname" "trigger_objective_info"
"targetname" "axis_const_toi"
"scriptname" "axis_const_toi"
"track" "the Axis emergancy door materials."
"spawnflags" "1"
"target" "axis_construction"

// entity 23_____this is the constructible
{
"classname" "func_constructible"
"spawnflags" "4"
"targetname" "axis_construction"
"scriptname" "axis_construction"

// entity 24      //***disreguard this one!  Its something im playing with, I only included it
                        //so you can see my full setup!
{
"track" "the Axis emergancy door!"
"targetname" "axis_emergancy_door_info"
"classname" "trigger_objective_info"

Hope this helps.


(MadJack) #9

Alright…

Thanks again Overtaker but though you were kinda close, and you tried really hard, it wasn’t neither the key values or scriptname or anything else…

Ok ok! No suspense! Actually, and I don’t know if it’s always like this, but my scriptname AND targetname were the same ones on my func_constructible and that was probably generating some confusion in the script interpreter. I can’t really understand why it let things get destroyed and built again since there wasn’t any scriptname but it did.

Now instead of having:

scriptname axisrampway1
targetname axisrampway1

I have:

scriptname axisramp1way_scr
targetname axisramp1way

Now… It seems to me that I’d already tried that but… who knows maybe I didn’t. How I found out? Since I have several ramps that are built one upon the other and that they’ll be multiple steps in the final construction and that had done the second floor of the ramps but not its trigger/crates/etc, I decided to start the second stage and see what would happen… Fortunately, I put a different name in the scriptname!

Again, thank! lol :smiley:


(Overtaker) #10

Sweet! I love a happy ending!!! :drink: