Stealable tank..? - Problem... -_-'


(Flippy) #1

Hey people…

I really need a stealable tank (like in Goldrush) tutorial :frowning:
a prefab would be nice too maybe, but i could take the one from goldrush so…
but i tried it about 5 times now with the goldrush tank, no succes… i just dont understand everything, and copy/pasting it is not my style :smiley:

i would search ofcourse but the search function is f*cked…
i can remember a few threads with tutorials, but all of them were offline at that time… :\


(iwound) #2

Heres a thread with update links for the prefabs.
http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=12725&sid=98ffc69ffe6727f9c23d42e15e2e3868
Use google and search by url its works just aswell if not better.


(WeeBull) #3

I made a few prefabs, you can get them at Map-Craft.com


(Flippy) #4

Oki many thanks i found one :slight_smile:

So… im trying to get it to work in my map now… but there are a few problems, of which one is one i dont think i can solve myself … (the others should be easy to solve i think)

At the start, before the tank is build, it is facing the wrong direction AND it is sloping upward, with its butt in the floor :smiley:
I tried looking for the green thingies (yes im a TOTAL noob in tank stuff) under the floor, but there were none…

the first green block has these settings:


target - spln3
targetname - spln2
classname - info_train_spline_main

the script i use (i dont use all 76 spline points so i simply deleted a few in the map and in the script (i hope i did it right lol)):



tank
{
	spawn
	{
		wait 400
		followspline 0 spln2 50000 length 32 wait

		trigger tank sound_idle
		trigger tank tracks_stop
	}

	// ========================================
	// sound stuff

	trigger sound_idle
	{
		stopsound
		playsound sound/vehicles/tank/tank_idle.wav looping volume 512
	}

	trigger sound_start
	{
		stopsound
		playsound sound/vehicles/tank/tank_revup.wav volume 196
	}

	trigger sound_move
	{
		stopsound
		playsound sound/vehicles/tank/tank_move.wav looping volume 512
	}

	trigger sound_stop
	{
		stopsound
		playsound sound/vehicles/tank/tank_revdown.wav volume 196
	}

	trigger sound_death
	{
		stopsound
		playsound sound/vehicles/tank/tank_stop.wav volume 256
	}

	trigger sound_rebirth
	{
		stopsound
		playsound sound/vehicles/tank/tank_start.wav volume 196
	}

	// ========================================
	// ========================================


// ===========================================================================================
// ===========================================================================================
	trigger tracks_forward
	{
		accum 0 abort_if_equal 1
		accum 0 set 1

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_alt_forward

		remapshaderflush
	}

	trigger tracks_stop
	{
		accum 0 abort_if_equal 0
		accum 0 set 0

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_left
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_right
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_left
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_right
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_left
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_right

		remapshaderflush
	}

	trigger tracks_turn_left
	{
		accum 0 abort_if_equal 2
		accum 0 set 2

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_alt_forward

		remapshaderflush
	}

	trigger tracks_turn_right
	{
		accum 0 abort_if_equal 3
		accum 0 set 3

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_alt_backward

		remapshaderflush
	}

// ===========================================================================================
// ===========================================================================================

	trigger run_continue
	{
		accum 3 inc 1
		trigger self deathcheck
		trigger self stopcheck
		trigger self move
	}


// ===========================================================================================
// movement

	trigger move_check
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3

		trigger self dispatch
	}

	trigger move
	{
		trigger self move_check

		wait 500

		trigger self move
	}

	trigger dispatch
	{
		accum 3 trigger_if_equal 0 tank run_0
		accum 3 trigger_if_equal 1 tank run_1
		accum 3 trigger_if_equal 2 tank run_2
		accum 3 trigger_if_equal 3 tank run_3
		accum 3 trigger_if_equal 4 tank run_4
		accum 3 trigger_if_equal 5 tank run_5
		accum 3 trigger_if_equal 6 tank run_6
		accum 3 trigger_if_equal 7 tank run_7
		accum 3 trigger_if_equal 8 tank run_8
		accum 3 trigger_if_equal 9 tank run_9
		accum 3 trigger_if_equal 10 tank run_10
		accum 3 trigger_if_equal 11 tank run_11
		accum 3 trigger_if_equal 12 tank run_12
		accum 3 trigger_if_equal 13 tank run_13
		accum 3 trigger_if_equal 14 tank run_14
		accum 3 trigger_if_equal 15 tank run_15
		accum 3 trigger_if_equal 16 tank run_16
		accum 3 trigger_if_equal 17 tank run_17
		accum 3 trigger_if_equal 18 tank run_18
		accum 3 trigger_if_equal 19 tank run_19
		}


	trigger run_0
	{
		trigger self tracks_forward
		accum 1 bitset 2
		followspline 0 spln2 50 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_1
	{
		trigger self tracks_forward
		trigger game_manager allies_steal_tank

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

		trigger self run_continue
	}

	trigger run_2
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_3
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_4
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_5
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_6
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_7
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_8
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_9
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_10
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_11
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_12
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_13
	{
		trigger self tracks_turn_right

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

		trigger self run_continue
	}

	trigger run_14
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_15
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_16
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_17
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_18
	{
		trigger self tracks_forward

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

		trigger tank stuck_check_barrier1_built_msg

		trigger self run_continue
	}

	trigger run_19
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_20
	{
		trigger self tracks_forward

		// Old location of defense1 remove

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

		trigger self run_continue
	}

	trigger run_21
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

It is probably a VERY easy answer for someone who did tanks before :stuck_out_tongue: but im a total noob…

so also a few little questions:

  • what are the purple blocks for? (info_train_spline_control) I just left them where they were…

  • What name of the spline points (green ones) is used in the script? target / targetname…

  • Last, my tank dissapears at when it reaches the last spline points and my map crashes, then it says something about a missing spline point… (nr 22 i think) i guess its because my script has one spline point too much, but im not sure, as i dont know which “number” in the script equals to which number in the editor… (see question above this)

I know, long post, lots of questions… but because i cant find anything about tanks (tutorials / explanations i mean) i dont know what to do… lol

MANY thnx in advance if someone helps me :stuck_out_tongue:

Ah yes, a screenshot of the tank at the start:


(WeeBull) #5

To turn the tank around you might want to use faceangles in the script:

You have to put it in the ‘spawn’ sub-routine of the tank. They did the same in Fueldump:

Purple blocks; check the LDR (on the left, click on ‘Spline Path System’).

Again from the LDR:

It’s quite weird how this works, I found out that when your first splinepoint has targetname spln1 and target spln2 and the second has targetname spln2 and target spln3 and in your script you have: followspline 0 spln1 10000 wait length -64, the tank will start on your second spline point. It’s probably a bit confusion, you have to test these things out yourself to understand it.

I suggest you take a look at my prefabs, I’ve added comments in the script to help you understand it. You can copy/paste the tank you want and the only thing you have to do is add/delete spline points and add/delete stuff in the ‘trigger dispatch’ and add/delete some ‘trigger runs’.
I hope it will help you.


(Flippy) #6

Ok i ALMOST got it working perfectly… MANY THNX!! :smiley:

BUT… 3 more problems which i cant solve… They are:

  1. When the tank has stopped at the tankbarrier, and THEN the tankbarrier gets blown up, the tank wont move anymore.
    I havent tried it without building the barrier, so im not sure if it keeps moving when the barrier was never build… will check this tomorrow

  2. The corners my tank makes are simple “squares”… no fancy spline curving, I want the tank to ride up the the corner, stop, turn around, drive on… but now, it doesnt stop, but it spins really quickly while still driving…

  3. When the tank is repaired/damaged etc… There is a message on the left (console) but NO VOICE message… im not sure if this is in the script or not? Ive never done voice messages… so it might be that its simply not in the script…

Part of my script which i think you will need to solve this…:
(Ofcourse the “…” are not in the script, its merely to point out that there is some stuff there too which i guess you dont need…)


...
...

trigger run_16
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}

	trigger run_17
	{
		trigger self tracks_forward

		// **********************************
		trigger defense2 remove
		// **********************************

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

		trigger self run_continue
	}

	trigger run_18
	{
		trigger self tracks_forward

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

		trigger self run_continue
	}
...
...

// stuck checking
// digibob: since we cant return variables, just use bit 3 of accum 1 as a register... mmmm assembly...
	trigger stuck_check
	{
		accum 1 bitreset 3

		trigger self stuck_check_barrier2_built
		trigger self stuck_check_scriptlockout
		trigger self stuck_check_finished
	}

	trigger stuck_check_finished
	{
		accum 3 abort_if_less_than 17

		accum 1 bitset 3
	}

	trigger stuck_check_scriptlockout
	{
		accum 5 abort_if_equal 0

		accum 1 bitset 3
	}



	trigger stuck_check_barrier2_built
	{
		accum 3 abort_if_not_equal 19

		accum 1 abort_if_not_bitset 1

		accum 1 bitset 3
	}

	trigger stuck_check_barrier2_built_msg
	{
		accum 1 abort_if_not_bitset 1

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "goldrush_allies_tankbar_destroy"
		// *---------------------------------------------------------------------------------*
	}

// ===========================================================================================
// stop check

	trigger stopcheck_setup
	{
		accum 1 bitset 6			// stop if we're stuck/no-one's pushing :)

		accum 1 abort_if_bitset 8		// no one in the trigger, abort

		trigger self stuck_check		// call the stop check function
		accum 1 abort_if_bitset 3		// we're stuck so break out

		accum 1 bitreset 6			// we're free to move
	}

	trigger stopcheck
	{
		trigger self stopcheck_setup
		accum 1 abort_if_not_bitset 6

		trigger self script_lockout

		// Any just stopped moving stuff goes here
		trigger tank_sound 	stop
		trigger self 		tracks_stop
		startanimation 45 	10 	15 nolerp norandom
		wait 666
		startanimation 0 	1 	15 nolerp norandom
		wait 900

		trigger self script_lockout_stop
		resetscript
	}

// ===========================================================================================
// ===========================================================================================
// script lockouts

	trigger script_lockout
	{
		accum 5 inc 1
	}

	trigger script_lockout_stop
	{
		accum 5 inc -1
	}

...
...

THe part where i think the voice announcements are… (which isnt working, dunno why)


// death / rebirth

	rebirth
	{
		accum 1 bitreset 9 // we're visibly alive
		accum 1 bitreset 7 // we're alive again

		trigger self script_lockout

		changemodel models/mapobjects/tanks_sd/jagdpanther_africa_tracks.md3

		setstate tank_smoke invisible

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_tank_stop"

		wm_teamvoiceannounce 0 "axis_hq_tank_repaired_allies"

		wm_teamvoiceannounce 1 "allies_hq_tank_repaired"

		wm_removeteamvoiceannounce 1 "allies_hq_tank_damaged_axis"
		// *---------------------------------------------------------------------------------*

		trigger tank_sound rebirth
		wait 500

		trigger self script_lockout_stop
	}

It clearly says “wm_teamvoiceannounce” so i figured that is the VOICE message? :moo:

Again thnx in advance :stuck_out_tongue: Now my tank is nearly ready :clap:


(=SC=Beef) #7

For your voice files you also need a .sounds file :slight_smile: