constructible_health


(Drakir) #1

Im having a small problem setting the health of a constructible.

From the LDR:

example_tank
{
    spawn {
        constructible_class 1
        constructible_health 1200
    }
} 

My code:

defence_sentry
{
	spawn
	{
		wait 400

		constructible_class 1
		constructible_health 1200

		trigger defence_sentry setup
	}
etc...

Everything works fine except the fact that its still destructable by only 1 grenade!


(Schaffer) #2

Not that I know much about scripting, but just looking at the fueldump script, they set the constructible_class to 2 for the allied and axis radios. I know there are differernt classes and I think it has to do with how they can be destroyed (eg 1 = nade, 2=satchel or 3=dyno)

I only mention this since in fueldump the allies health and ammo get knocked out by a satchel or dyno against the command post.

This is also the script for the tank in fueldump and it dosn’t set the health of class:


tank
{
	spawn
	{
		wait 50
		faceangles 0 180 0 50
		trigger self sound_idle

		accum 1 bitset 5
		trigger self tracks_stop

		// Reset the tank+turret into correct position
		followspline 0 spln0 10000 wait length -64
		followspline 1 spln0 10000 wait length -64

		// Instant test teleporter
		// accum 3 set 90
	}
...

Actually, looking at the code a bit mode (ah what a bitch it is to code in the movement of a vehicle), I did find this which is much as what I did above:


tank_construct
{
	spawn
	{
		wait 400

		constructible_class 2
		constructible_health 1200
	}
...

Try this and see what happens (ie use defence_sentry_construct to set the class and health)


(chavo_one) #3

For a tank, I believe the game uses the health key of the clip brush script mover and not the constructible_health value. I tried what Drakir is trying for something I wanted in Venice (gun canopy), but by definition, it seems anything set to constructible_class 1 can be destroyed by a single grenade. I found no solution to this and ended up dropping the idea.


(G0-Gerbil) #4

Same with panzer. Lame really.


(Drakir) #5

Found the solution, but it seems like a dumb way to go about it…must be a feature they missed to implement!

The solution is to make a script_mover to act like the destructable item that can be destroyed by multiple grens.
But u still need the func_constructible to make a constructible item…so this means i have to set the func_constr to at least constructible_class 2 in the script so that it cannot be destroyed by 1 gren or move it out of place so that its not damaged by misstake.

Then i set the script_mover to be only hurtable by explosive weapons, resurectable and set the health to an amount that suites me and when the script_mover is destoyed it calles its “death” part and in there i call upon a trigger in the func_constr. that sets it do its destroyed state so that it can be built again.

Seems like alot of work, but its doable this way…


(Drakir) #6

This should be added to the Topic of “Documentation / Editor Errors” as its not working as it should!


(G0-Gerbil) #7

Nice work Drakir, shame you had to do such a workaround :frowning:


(]UBC[ McNite) #8

I encountered the same prob with constructible_class 1 and k: health v: 0… damage done by 1 lousy nade :angry:

As I want a constructible to be undestroyable once it is built, is this the only way to acchieve the effect (by setting the for the brush of the constructible k: health v: 0 and in the script constructible_class 2)?
I didn’t find any other solutions to this, only this post…

Do I understand you right that I have to make the brushes that are the fun_constructible also a script_mover (i thought u can’t make a brush 2 entities?)…

The only script_mover i use up to now for the constructible is set on the clip of the cmarker :???: