Tricky neutral constructible question [SOLVED]


(Yatta_Yatta-O_o) #1

Ive been :banghead:-ing on the question for too much time now and I need some help.

The thing I want to do is pretty simple, really, but I cant find a way to do it :

I want a neutral constructible being destroyable by grenades & bullets.

Heres what I did :

  • a trigger_objective_info, with no team flags, targeting on a “const” func_constructible
  • a func_constructible with targetname “const” and flag “axis constructible”
  • a func_constructible with targetname “const” and flag “allies constructible”
    with some usual constructions scripts, it works fine, both team can built it, or destroy it if the ennemy built it first.
    Now, to make it destructible by bullets, I made a thin script_mover with clip weapon shader arround the constructible, set with a health parameter so its destructible. When destroyed, it triggers a “alertentity const” script, so the “const” constructible is destroyed.
    Here comes the problem. “const” is TWO entities. One for axis, the other for allies …
    So when axis build the barricade, and then someone destroy it, the “alertentity const” turns the axis construction “dead” … and the allied construction “built” (since it wasnt constructed) !

If I name my two constructibles “const_axis” and “const_allies” (so I can alertentity the one I want), and do two distinct trigger_objective_info for those, that could work, except that having two trigger_objective_info overlaping doesnt work - one overriding the other.

This drives me crazy ! I think there’s some easy solution to that, and Im too mad for now to find it … :disgust:


(DerSaidin) #2

Perhaps spawn a func_exposive on it that then triggers the script to kill the constructable.


(nUllSkillZ) #3

Couldn’t this be done with constructible_class 1 + health X?
Not sure if it’s constructible_class 1.
But 2 is for satchels and 3 for dynamite.
I think you have to write the health as key / value pair in the entity window.


(Loffy) #4

if I understand you right, you want a wall that can be constructed by any engineer (any team)?
And this wall must be destroyable by bullets (or nades)?
When it is destroyed, any engineer can rebuild it?
//L.


(Yatta_Yatta-O_o) #5

yup loffy.
Its a door barricade, the door is the access to sort of a control room, so the defending team might want to restrain the access, and the attacking team might want to barricade themselves in to gain time operating the switches.

func_explosive are a “no good” since as far as I know they cant be respawned.
About the constructible_class 1 I dont know about that … if its “bullet destructible” it would just


(Loffy) #6

Ah, Ok. That map deisgn makes sense. Like the idea.
EDIT: Ops, that was indeed post 1337.


(Shaderman) #7

I guess that kill const instead of alertentity const could work.


(Yatta_Yatta-O_o) #8

constructible_class 1 didnt work : after testing and looking at the forum it seems to be quite a bugous parameter, whatever you do, a single explosion (grenade / panz / dyna - not bulets) will destroy it, plus it wont trigger the death event.

However, once again Shaderman saved the day !
The “kill const” worked fine. I had to remove the “setstate const underconstruction” in the “buildstart final” event, because for some reason when building the barricade for the second time it just poped up visible & solid right at the construction begining (without the script_mover hit receiver). Now its perfect, tahnk you !

If anyone ever need that - recap to do a neutral constructible vulnerable to any weapon by both teams :

  • trigger_objective_info (no teams flags) with key “target” = “constructible_name” ; targetname = “constructible_zone” // the zone where the inge wave theirs tools arround
  • func_constructible (flaged axis constructible) keys “targetname” and “scriptname” = “constructible_name” // constructed object, for the axis
  • func_constructible (flaged allies constructible) keys “targetname” and “scriptname” = “constructible_name” // same duplicated constructed object, for the allies
  • script_mover (flaged solid, resurectable) keys “targetname” and “scriptname” = “constructible_hull”; key “health” = “100” (non 0 at least) // hull receiving the hits, overlaping the constructibles, slightly thicker
  • script_mover (flaged solid) keys “targetname” = “constructible_materials” // Construction crates or whatever

Scripts :


constructible_hull
{
	spawn
	{
		wait 150
		setstate constructible_hull invisible // hide the hull at the begining of the game
	}
	death
	{
		kill constructible_name // destroy the constructible when the hull is destroyed
		trigger constructible_name setup // reset the constructible
	}
}

constructible_name
{
	spawn
	{
		constructible_class 2
		trigger self setup
	}
	trigger setup
	{
		setstate constructible_materials default
		setstate constructible_zone default // set the construction zone on

		setstate constructible_name invisible
		setstate constructible_hull  invisible // hide the construction and the hull
	}
	built final
	{
		setstate constructible_hull // show the hull
		alertentity constructible_hull // resurect the hull if it was destroyed
		setstate constructible_materials invisible // hide the construction materials
		setstate constructible_name default // hide materials and show constructed object

		setstate constructible_zone invisible // disable the construction zone so the other team cant built over the existing constructible
	}
	death
	{
		trigger self setup // reset stuff
	}
	decayed final
	{
		trigger self setup // reset stuff
	}
}

There =)