Exploding barrels instead of Tltrude's popup boomcrates ?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Kalti
Major
Posts: 325
Joined: Sun Mar 16, 2003 11:46 am
Contact:

Exploding barrels instead of Tltrude's popup boomcrates ?

Post by Kalti »

I've added exploding barrels to my Venice map and I would like to respawn them after a given time but only when the one at that specific location has been destroyed.

Tltrude's Thread for spawning explosive crates in stock maps has convinced me to try and use that setup... but I have no idea how to let the script determine wheter or not the barrel at that spot is destroyed.
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

this should work

Code: Select all

if($barrel isalive)
{
// dadadadadadadada
}
isalive is really meaning, in existance.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

func_barrel

Post by tltrude »

Far as I know, you can't move a func_barrel--not sure if you can even spawn one. My exploding crate thread uses the indicrate model, and there is no model for barrels.

So, your barrels will have to be script_objects that are already in the map. You can use "hide" and "show" to make them vanish and come back. But, the rest of the crate thread should work for the explosions and stuff.
Tom Trude,

Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

not sure if you can even spawn one
it seems easy to me, make your barrel, make it a script_object, open your .mp file with Notepad, find the barrel, copy it's sizes, and spawn it at xyz with setsize ... ... ... .. ... ..
Far as I know, you can't move a func_barrel
i thought all entities could move as well :S jsut not brushes.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yeah probably you could just do:

Code: Select all

local.barrel_pos = $mybarrel.origin
local.barrel_bmodel = $mybarrel.brushmodel // bsp brush ref

local.barrel =$mybarrel
while(1)
{
  local.barrel waittill death

  wait 5.0

  // make new barrel
  local.barrel = spawn BarrelObject origin local.barrel_pos model local.barrel_bmodel
}
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

wow!

Post by tltrude »

That is cool, jv_map! That means there only has to be one real barrel, somewhere in the map, and more barrels can be spawned using it.

Of course, they are not exploding barrels--just the brushes.
Tom Trude,

Image
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Re: Exploding barrels instead of Tltrude's popup boomcrates

Post by Master-Of-Fungus-Foo-D »

Kalti wrote:I've added exploding barrels to my Venice map...
hes not script spawning guys a func_barrel outta nowhere.. he'll map it.
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

I would like to respawn them after a given time
He has a barrel, he wants it to respawn. can only be done via script. jv gave him the script.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Post Reply