Scripting problem with constructibles!


(Drakir) #1

What i am trying to do is to create a constructible that constructs a constructible that when constructed constructs the first constructible.

Kinda of a looping construction.
What i want to do is to construct a brushwork (the bomb), at the same time i make the brushwork visible i make a constructible visible for the other team so they have to construct the brushwork to make it invisible (defusing the bomb)

I have it working kinda, the problem is that i can only construct the first construction once, i can also defuse it. In other words build the constructible that becomes visible when i build the bomb, but after defusing the bombi dont get the plier to work on the now visisble stuff for the first constructible boxes anymore.

Seems to me like a bug, but i can be wrong somewhere :banghead:

This is the script for it, booth constructibles are set up the same way just different script and targetnames.

// ================================================
// === 	Bomb construction and defusing    =====
// ================================================
the_bomb // The visible bomb.
{	
	spawn
	{
		wait 400
		trigger the_bomb invisible
	}

	trigger visible
	{
		setstate the_bomb default
	}

	trigger construction
	{
		setstate the_bomb underconstruction
	}

	trigger invisible
	{
		setstate the_bomb invisible
	}
}

bomb // the gun bomb contruction kit
{
	spawn
	{
		wait 400
		trigger bomb setup
		accum 1 set 0
		constructible_class 1
	}

	trigger setup
	{
		setstate bomb_materials default
		setstate bomb_materials_clip default
		setstate bomb_flag default

		setstate bomb invisible
	}

	trigger buildt
	{
		setstate bomb_toi default
		setstate bomb_materials default
		setstate bomb_materials_clip default
		setstate bomb_flag default

		setstate bomb invisible
		accum 1 set 0
		wm_announce "The Bomb has been disarmed in the Gun Cave."
		trigger bomb_defuse invisible
	}

	buildstart final
	{
		setstate bomb_materials default
		setstate bomb_materials_clip default
		setstate bomb_flag default


		setstate bomb underconstruction
		trigger the_bomb construction
	}

	built final
	{
		setstate bomb_materials invisible
		setstate bomb_materials_clip invisible
		setstate bomb_flag invisible
		setstate bomb_toi invisible

		trigger bomb_defuse buildt
		trigger the_bomb visible
		setstate bomb default
		accum 1 set 1
		wm_announce "The Bomb is placed and armed in the Gun Cave."


	}

	decayed final
	{
		setstate bomb_materials default
		setstate bomb_materials_clip default
		setstate bomb_flag default

		setstate bomb invisible

	}

	trigger blowout
	{
		accum 1 abort_if_not_equal 1
		alertentity boom
		trigger game_manager allies_win
	}
}

bomb_defuse // the gun bomb defuser kit
{
	spawn
	{
		wait 400
		trigger bomb_defuse invisible
		constructible_class 1
	}

	trigger buildt
	{
		setstate defuse_toi default
		setstate defuse_materials default
		setstate defuse_materials_clip default
		setstate defuse_flag default

		setstate bomb_defuse invisible
	}

	buildstart final
	{
		setstate defuse_materials default
		setstate defuse_materials_clip default
		setstate defuse_flag default
		trigger the_bomb construction
		setstate bomb_defuse underconstruction
	}

	built final
	{
		setstate defuse_materials invisible
		setstate defuse_materials_clip invisible
		setstate defuse_flag invisible

		setstate bomb_defuse default
		trigger bomb buildt
		trigger the_bomb invisible

	}

	trigger invisible
	{
		setstate defuse_toi invisible
		setstate defuse_materials invisible
		setstate defuse_materials_clip invisible
		setstate defuse_flag invisible
		setstate bomb_defuse invisible

	}

}

(Mean Mr. Mustard) #2

Try ‘kill bomb’ from within bomb_defuse->built final and ‘kill bomb_defuse’ from within bomb->built final

I think this will trigger the ‘death’ routine of the constructible mentioned and allow for another construction…


(Drakir) #3

Tnx alot, that worked great!


(Ifurita) #4

shouldn’t it be ‘trigger built’ and not ‘trigger buildt’? maybe it doesn’t matter


(Drakir) #5

The trigger name is just a name not a function.