Tank Issues


(*[SfS]*OpTeRoN) #1

mmm k, I’m attempting to make a map with a tank objective.
I’ve copied and pasted the tank, some splines, and the tank script from goldrush.

But, when I play my map, my tank is walkthrough, and you can shoot through it. I have clip brushes but it’s still walkthrough.

Can anyone help? :???:


(Danyboy) #2

Not done any work with moving objects but you could try loading goldrush up - make sure that View > Filter hasn’t got any clip brushes being hidden - then making a box around the tank - copy + paste into a new map.

Worth a try - if you already done that - then erm - soz cant really help


(*[SfS]*OpTeRoN) #3

OK, I’ve fixed this.
Can anyone tell me how to make the tank stop at a barrier?

When I put:

trigger tank stuck_check_barrier1_built_msg

On the spline I want the tank to stop at, it just plays the “Destroy the tank barrier.” sound and moves right through the barrier. :???:


(*[SfS]*OpTeRoN) #4

Plz, this is really annoying, can someone help? :bash:


(damocles) #5

do you have an abortmove or stop command in your script?


(Mean Mr. Mustard) #6
trigger tank stuck_check_barrier1_built_msg

I believe this calls the voice over messages when a barrier is built (Allies - destroy barrier, Axis - barrier constructed)

You need to set up an accum to alert the tank if the barrier is built or destroyed. This requires two parts: (1) in the barrier section call a trigger in the tank section to set the accum. Called in two places: built final sets the accum to say 1 and death sets it to 0. (2) for the tank run_xx (where xx is the spline through the barrier) put in an ‘accum x abort_if_equal 1’ as the first line. If the barrier is bulit, then the tank will not move through it

If you post your script, I’ll help you put in the necessary scripting


(*[SfS]*OpTeRoN) #7
trigger run_10
	{
		trigger self tracks_forward

		accum 1 bitset 2
		followspline 0 spln12 50 wait length 32
		accum 1 bitreset 2

                trigger tank stuck_check_barrier1_built_msg
                
		trigger self run_continue
	}

That’s the spline where I want the tank to stop until the barrier is destroyed.

defense1
{
	spawn
	{
		wait 400
		trigger defense1 setup

		constructible_class 3
	}

	trigger setup
	{
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default


		setstate defense1_teeth invisible
	}

	buildstart final
	{
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default


		setstate defense1_teeth underconstruction
	}

	built final
	{
		setstate defense1_materials invisible
		setstate defense1_materials_clip invisible
		setstate defense1_flag invisible


		setstate defense1_teeth default

		trigger tank disable_stage2

		wm_announce "Tank Barrier #1 has been constructed."

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "goldrush_axis_tankbar_constructed"

		wm_removeteamvoiceannounce 0 "goldrush_axis_tankbar_construct"
		wm_removeteamvoiceannounce 0 "goldrush_axis_tankbars_construct"
		// *---------------------------------------------------------------------------------*
	}

	decayed final
	{
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default


		setstate defense1_teeth invisible
	}

	death
	{
		setstate defense1_materials default
		setstate defense1_materials_clip default
		setstate defense1_flag default


		setstate defense1_teeth invisible

		trigger tank enable_stage2

		wm_announce "Tank Barrier #1 has been destroyed."

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "goldrush_axis_tankbar_construct"

		wm_teamvoiceannounce 0 "goldrush_axis_tankbar_destroyed"

		wm_teamvoiceannounce 1 "goldrush_allies_tankbar_destroyed"
		// *---------------------------------------------------------------------------------*
	}

	trigger remove
	{
		setstate defense1_toi invisible
		setstate defense1_materials invisible
		setstate defense1_materials_clip invisible
		setstate defense1_flag invisible
		setstate defense1_teeth invisible

		remove
	}
}

My barrier 1 script. (Taken from goldrush)

I think I see what you mean, I’ll try it.


(Mean Mr. Mustard) #8

In the goldrush script, check the ‘stuck_check’ parts. You can just use that part of the script, but just change the value of the spline point for the barrier - change the 23 to 10 (if you have copied the whole tank part of the script)

trigger stuck_check_barrier1_built
	{
		accum 3 abort_if_not_equal 23

		accum 1 abort_if_not_bitset 0

		accum 1 bitset 3
	}

(*[SfS]*OpTeRoN) #9

Thank you so much, it works! :smiley:


(*[SfS]*OpTeRoN) #10

Now, the only thing left is… (Yes there is still one remaining problem)

The tank makes no sound what-so-ever, even though I copied the entire script file from Goldrush, and I copied the sound script file just to be sure.

Thanks a lot for your help Mr. Mustard!


(chavo_one) #11

If you’ve copied the script file from goldrush, then you probably just need
to add an info_notnull entity with the key/value pair “scriptname” “tank_sound” to your map.