Tank Stop at Barriers?!


(ayatollah) #1

I have a working tank, I can damage it and rebuild it. It follows its course perfectly and stops where its supposed to. But I am having a problem getting it to stop at barriers that are built for it. I have studied the Goldrush script and can’t find the problem. What do I need to do?


(EB) #2

are you using the goldrush script ?

or just looking at it ?


(ayatollah) #3

I have cut/paste parts of the goldrush script I need to do with the tank.


(EB) #4

Well, an easy way to do it that way is to make your barriers the same scripting as tank barriers 1 and 2 and then place them within the same location along the splines as they are in goldrush and then make sure you have the whole script copied/pasted. There is a good amount of script and you need every little bit for it to work properly.


(ayatollah) #5

Well I could’ve done that but that won’t tell me HOW its done. I don’t want exactly as is done in Goldrush I want to know how it would be done for any case. What triggers do I need, basically what tutorial can help me?


(Ifurita) #6

There are several parts to this:

in the constructible scripting for Tank Barrier 1, you will find


	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"
		// *---------------------------------------------------------------------------------*
	}

Which calls the below and sets an accum


	trigger disable_stage2
	{
		accum 1 bitset 0
	}

Which prevents the tank from moving beyond spline 23 if built


	trigger stuck_check_barrier1_built
	{
		accum 3 abort_if_not_equal 23

		accum 1 abort_if_not_bitset 0

		accum 1 bitset 3
	}

or, once the tank runs past spline 23, the barrier is automatically removed


	trigger run_23
	{
		trigger self tracks_forward

		// **********************************
		trigger defense1 remove
		// **********************************

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

		trigger self run_continue
	}

and the coders added some handy dandy notes explaining what the various accums do


// accum 1
//  - bit 0: barrier1 state		( 0 = not built,	1 = built		) <------------------------------
//  - bit 1: barrier2 state		( 0 = not built,	1 = built		) <------------------------------


(EB) #7

Don’t get frustrated, you need to give more information for “more” of an answer.
Is what Ifurita typed, what you were looking for ?


(ayatollah) #8

Yeah perfect, sorry EB for being a tad frustrated, just home from work at 4 in the morn so slighty tired. Cheers to you both… :clap:

BTW it was the stuck_check_barrier1_built bit that was knocking me. Didnt know how to stop it at a certain spline.


(ayatollah) #9

Sorry posted last message without checking my map. Still doesn’t work and everything seems to be right from my position. Don’t know whats gone wrong… :banghead:

EDIT: I can post my script if you want to have a look at it?


(EB) #10

If you do post it, can you make it downloadable from http or ftp ? …as the script would be a hassle from within this thread due to the length. Thanks.


(ayatollah) #11

Sorry I am a noob…All that was wrong was the wrong spline point was entered, sorry, but thanks for the help.