Shootable Constructibles?? HELP


(BloodLusts) #1

ok my problem is this

I need to make a Item a Func_explosive – so u can shoot and destroy it

but i also need it so the team can re-build it when its destroyed

Example:

in my map i have a shooting range

u shoot the target which is a func_explosive - so it explodes makes a sound and is gone

now after u shoot all the targets - i want them to be able to be rebuilt via constructibles

now ive racked my brain trying to figure this out

any help is much appreicated

  • please if u know how - post the instructions here

JW


(FireFly) #2

I’m afraid that what you want to achieve is not possible as far as I know.The Main problem is that a func_constructible (class 1) can only be destroyed by Dynamite, Satchel Charge, Grenades, Panzerfaust, Mortars, Air Strikes but not by guns/ bullets. ( For example the tank in fueldump and goldrush)


(kamikazee) #3

You can destroy script_movers with a health key/value.
Link these to a func_explosive. And once a construction is complete “alert” the script movers using “alertentity” and they will be “revived”.

Ifurita used the script_movers for his “Tactical” shooting course. Check it out!

EDIT: Okay, so it may be func_statics. Anyhow, it could work with script_movers as well. :smiley:


(Ifurita) #4

and you cannot rebuild func_destructibles. You can use func_statics with a timed respawn, which is what I did in Tactical.


(BloodLusts) #5

ok so a Func Static - that u can destroy but - do i set a timer in the Script for respawning them - or a timer entity for it — can u gimme a example of the script for that

im not sure if what key i assign the static - to allow the script to alert it

example: alert entity Target001

and in game the target 1 - have a targetname of Target001 – or should its Target be Target001

get what im saying


(Ifurita) #6

Here’s the coding for the first target (move randomly, makes a noise when hit, and respawns 15 seconds after it’s destroyed) in Tactical:


target1
{
	spawn
	{
		wait 100
		trigger target1 loop
	}

	trigger loop
	{
		accum 0 random 4
		accum 0 trigger_if_equal 0 target1 point1
		accum 0 trigger_if_equal 1 target1 point2
		accum 0 trigger_if_equal 2 target1 point3
		accum 0 trigger_if_equal 3 target1 point4
	}

	trigger point1
	{
		gotomarker target1_1 90 wait
		trigger target1 loop
	}

	trigger point2
	{
		gotomarker target1_2 90 wait
		trigger target1 loop
	}

	trigger point3
	{
		gotomarker target1_3 90 wait
		trigger target1 loop
	}

	trigger point4
	{
		gotomarker target1_4 90 wait
		trigger target1 loop
	}

	pain 
	{
		playsound sound/tactical/hit.wav
	}

	death
	{
		wm_announce "target 1 destroyed"
		trigger game_manager target_counter
		trigger self reset
	}

	trigger reset
	{
		setstate target1 invisible
		wait 15000
		setstate target1 default
		alertentity target1
		trigger target1 loop
	}	
}


(BloodLusts) #7

ughh

this is the code i have now


target1
{
   
spawn
   {
      wait 100
   }

death
   {
	playsound sound/world/debris2.wav
      wm_announce "target 1 destroyed"
      trigger target1 reset
   }

trigger reset
   {
      setstate target1 invisible
      wait 15000
      setstate target1 default
      alertentity target1
   }   
} 

Now in game - I can shoot it and destroy it - but it plays no Sound – no does it respawn after killed

it does however show target 1 destroyed - on screen

so in a nutshell

shoot target - it dies - says target 1 destroyed - BUT plays no sound nor does it respawn

in game my func_static is setup like so

targetname = target1
scriptname = target1
health = 1
classname = func_static

see all i need is a stationary target - so i removed the codes for moving things etc…

please help


(codejockey13) #8

Couldn’t you just use a func_constructible that points to a func_explosive and trigger the explosive thru the script and kill the func_constructible? Then upon death of the func_constructible the crates should pop back up and you should be able to rebuild.


(codejockey13) #9

nevermind me that doesn’t work.


(BloodLusts) #10

yea i tried that way lol – no go


(BloodLusts) #11

I still need help on this

this is FINALLY the LAST THING wrong on my map – Everything else works 100%

I need to know how to setup a target which can be destroyed - then in say like 3 seconds - respawn itself to be shot again - as a practice target

someone please help me with this - the script the guy above suggested Didnt Work

BIG THANKS

JW


(kamikazee) #12

Ifurita’s code should work, otherwhise you haven’t set the correct key/value pairs for your shootable entity. (Check the health key, it should be higher then zero)


(Ifurita) #13

FWIW, I have a map with 36 of those shootable thingies and they work quite well.


(BloodLusts) #14

ok so is the Entity a Func_static - or a Script_Mover for the Target??

and if i edit out the moving parts of the code will it still function ok??

Ill give it a shot with a Func static and a script mover see what i get while i await ur reply


(Ifurita) #15

http://www.planetwolfenstein.com/4newbies/source/tactical_final_source.zip <— source file


(BloodLusts) #16

Thank u


(BloodLusts) #17

for some reason that thing still dont work

i used - script_mover entity with Solid & Resurrectible flags set like in ur map

but in server u can only destroy the target using a grenade –

that worked - dies then respawns -

but u cannot kill it by shooting it for some reason

any ideas -


(BloodLusts) #18

works now – lol i dont know what i did - i just rebuilt it all again and it worked lol


(Ifurita) #19

voodoo mapping if you ask me


(BloodLusts) #20

Well i was using GTK 1.3 something or another thanks to a certain individual in this forum who suggested and it sucks lol – so now im on 1.4

but im still having 2 issues - please check the thread named Weird map bug etc…
i can use some help very badly