Can't make Solid

Post your scripting questions / solutions here

Moderator: Moderators

LiquorKraZy
Captain
Posts: 267
Joined: Tue Aug 10, 2004 5:38 am
Location: CA
Contact:

Can't make Solid

Post by LiquorKraZy »

ok...i've spawned some trees into some of the maps using the following code which works perfect....the only problem is that the trees arent solid...so if i add $xtra# solid to the script it makes it solid but you cant even walk within like 10 ft of the tree....
xtras:
spawn static/tree_oak "targetname" "xtra7"
$xtra7.origin = ( -2985.37 4070.72 -447.88)
$xtra7.angles = (0 30.84 0)

spawn static/tree_commontree "targetname" "xtra8"
$xtra8.origin = ( -696.66 4558.11 -447.88)
$xtra8.angles = (0 115.05 0)
$xtra8.scale = 1.50

spawn static/tree_commontree "targetname" "xtra9"
$xtra9.origin = ( -2077.90 1889.62 -447.88 )
$xtra9.angles = (0 30.84 0)
$xtra9.scale = 2
so i tried to spawn a script_object using
local.block = spawn script_object
local.block.origin = ( 0 0 0 )
local.block setsize ( -50 -50 0 ) ( 50 50 100 )
but that doesnt work at all...any ideas on what to do to make the trees so that people cant walk thru them or shoot through them....???
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Make the script_object smaller (just to cover the root of the tree) and solid and immune to damage, eg.:

Code: Select all

local.block = spawn script_object origin $xtra7.origin
local.block setsize ( -12 -12 -16 ) ( 12 12 100 )
local.block solid
local.block nodamage
local.block immune bullet
local.block immune fast_bullet
local.block immune rocket
local.block immune explosion
local.block immune grenade
local.block immune shotgun
local.block immune bash
local.block immune crush
local.block immune falling
local.block immune vehicle
That will make the root of the oak solid and not let bullets and projectiles, whatever through. It sets the size to 24x24x116 (24 is 3/4 of a player's width) - this -16 is just in case. :P
Petey wrote:if i add $xtra# solid to the script it makes it solid but you cant even walk within like 10 ft of the tree....
That's because executing the solid command on a spawned object uses its bounding box as the collision entity. It appears that the box in this case is like 20 by 20 feet. ;)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

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

Solid makes the bounding box solid (if anyone can tell me otherwise im open)... you could spawn a clip... if you know how...
you beat me to my crappy advice rookie
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
LiquorKraZy
Captain
Posts: 267
Joined: Tue Aug 10, 2004 5:38 am
Location: CA
Contact:

Post by LiquorKraZy »

ok..i included the script file for Remagen....i tried to paste that code you gave me ROOKIE but it doesnt seem to work...if anyone could, please take a look at the scripting and tell me what im doing wrong...
// REMAGEN
// ARCHITECTURE: WOLF
// SCRIPTING: WOLF

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Remagen"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" "The 101st Screamin'"
setcvar "g_obj_axistext1" "Eagles"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" "www.101stairborneclan.com"

setcvar "g_scoreboardpic" "mohdm3"

// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread

level waittill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

level.script = maps/dm/mohdm3.scr
exec global/ambient.scr mohdm3

thread global/door_locked.scr::lock

level waittill spawn
$world farclipoverride -1

thread block
thread xtras
thread truck
end


//-----------------------------------------------------------------------------

xtras: spawn static/tree_commontree "targetname" "xtra11"
$xtra11.origin = ( 1340.37 197.46 -63.88 )
$xtra11.angles = ( 0 -83.51 0 )
$xtra11.scale = 1.75

spawn static/tree_commontree "targetname" "xtra10"
$xtra10.origin = ( 621.13 -1388.71 8.13 )
$xtra10.angles = ( 0 -83.51 0 )
$xtra10.scale = 2

spawn static/tree_commontree "targetname" "xtra9"
$xtra9.origin = ( 4409.73 -3591.01 8.13 )
$xtra9.angles = ( 0 -83.51 0 )
$xtra9.scale = 1.25

spawn static/tree_commontree "targetname" "xtra12"
$xtra12.origin = ( 461.57 -42.81 -48.70 )
$xtra12.angles = ( 0 -83.51 0 )
$xtra12.scale = 1.50

spawn static/tree_commontree "targetname" "xtra15"
$xtra15.origin = ( 2552.09 -2789.01 8.13 )
$xtra15.angles = ( 0 -34.85 0 )
$xtra15.scale = 1.25
end
//-----------------------------------------------------------------------------
truck: local.truck = spawn script_model
local.truck model "static/vehicle_dtruck_burnt.tik"
local.truck.origin = ( 3624.18 -3766.56 1.60 )
local.truck.angles = ( 0 144.40 0 )
local.truck solid
end
//-----------------------------------------------------------------------------

block: local.block = spawn script_object origin $xtra9.origin
local.block setsize ( -12 -12 -16 ) ( 12 12 100 )
local.block solid
local.block nodamage
local.block immune bullet
local.block immune fast_bullet
local.block immune rocket
local.block immune explosion
local.block immune grenade
local.block immune shotgun
local.block immune bash
local.block immune crush
local.block immune falling
local.block immune vehicle
end

//-----------------------------------------------------------------------------

roundbasedthread:

// Can specify different scoreboard messages for round based games here.

level waitTill prespawn

level waittill spawn

// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw

level waittill roundstart

end
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Try this:

Code: Select all

// REMAGEN
// ARCHITECTURE: WOLF
// SCRIPTING: WOLF

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Remagen"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" "The 101st Screamin'"
setcvar "g_obj_axistext1" "Eagles"
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" "www.101stairborneclan.com"

setcvar "g_scoreboardpic" "mohdm3"

// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread

level waittill prespawn

//*** Precache Dm Stuff
exec global/DMprecache.scr

level.script = maps/dm/mohdm3.scr
exec global/ambient.scr mohdm3

thread global/door_locked.scr::lock

level waittill spawn
$world farclipoverride -1

thread block
thread xtras
thread truck
end


//-----------------------------------------------------------------------------

xtras:
spawn static/tree_commontree "targetname" "xtra11"
$xtra11.origin = ( 1340.37 197.46 -63.88 )
$xtra11.angles = ( 0 -83.51 0 )
$xtra11.scale = 1.75
thread block $xtra11.origin

spawn static/tree_commontree "targetname" "xtra10"
$xtra10.origin = ( 621.13 -1388.71 8.13 )
$xtra10.angles = ( 0 -83.51 0 )
$xtra10.scale = 2
thread block $xtra10.origin

spawn static/tree_commontree "targetname" "xtra9"
$xtra9.origin = ( 4409.73 -3591.01 8.13 )
$xtra9.angles = ( 0 -83.51 0 )
$xtra9.scale = 1.25
thread block $xtra9.origin

spawn static/tree_commontree "targetname" "xtra12"
$xtra12.origin = ( 461.57 -42.81 -48.70 )
$xtra12.angles = ( 0 -83.51 0 )
$xtra12.scale = 1.50
thread block $xtra12.origin

spawn static/tree_commontree "targetname" "xtra15"
$xtra15.origin = ( 2552.09 -2789.01 8.13 )
$xtra15.angles = ( 0 -34.85 0 )
$xtra15.scale = 1.25
thread block $xtra15.origin
end
//-----------------------------------------------------------------------------
truck: local.truck = spawn script_model
local.truck model "static/vehicle_dtruck_burnt.tik"
local.truck.origin = ( 3624.18 -3766.56 1.60 )
local.truck.angles = ( 0 144.40 0 )
local.truck solid
end
//-----------------------------------------------------------------------------

block local.org:
local.block = spawn script_object origin local.org
local.block setsize ( -12 -12 -16 ) ( 12 12 100 )
local.block solid
local.block nodamage
local.block immune bullet
local.block immune fast_bullet
local.block immune rocket
local.block immune explosion
local.block immune grenade
local.block immune shotgun
local.block immune bash
local.block immune crush
local.block immune falling
local.block immune vehicle
end

//-----------------------------------------------------------------------------

roundbasedthread:

// Can specify different scoreboard messages for round based games here.

level waitTill prespawn

level waittill spawn

// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw

level waittill roundstart

end
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
LiquorKraZy
Captain
Posts: 267
Joined: Tue Aug 10, 2004 5:38 am
Location: CA
Contact:

Post by LiquorKraZy »

perfect man...thanks so much! :D :D :D
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

No problem, glad to help. 8-)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Rookie One wrote: local.block = spawn script_object origin $xtra7.origin
local.block setsize ( -12 -12 -16 ) ( 12 12 100 )
local.block solid
local.block nodamage
local.block immune bullet
local.block immune fast_bullet
local.block immune rocket
local.block immune explosion
local.block immune grenade
local.block immune shotgun
local.block immune bash
local.block immune crush
local.block immune falling
local.block immune vehicle
Wouldn't "nodamage" on it's own elimenate the need for all the immune lines below it. :?:
Grassy
An ambiguous question will get a similar answer...
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

No, Grassy, as the immune command makes the script_object clip bullets and everything (I know it's illogical, but that's the way it is) - if you just use nodamage, you can still shoot through it.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Ah ok, thanks for the explanation, pitty they didn't just add one more option, "immune All" :D

Grassy
An ambiguous question will get a similar answer...
LiquorKraZy
Captain
Posts: 267
Joined: Tue Aug 10, 2004 5:38 am
Location: CA
Contact:

Post by LiquorKraZy »

ok...i tried using the BLOCK thread posted above in the omaha map..i guess it doesnt work when the map is obj but this is the error i get which is shown in the screenshot below:

Image

this is what part of my script looks like:
level waittill spawn

thread xtras
thread block

end

//-----------------------------------------------------------------------------
xtras:
spawn static/tree_commontree "targetname" "xtra11"
$xtra11.origin = ( 1340.37 197.46 -63.88 )
$xtra11.angles = ( 0 -83.51 0 )
$xtra11.scale = 1.75
thread block $xtra11.origin

end
//------------------------------------------------------------------------------
block local.org:

local.block = spawn script_object origin $xtra7.origin
local.block setsize ( -12 -12 -16 ) ( 12 12 100 )
local.block solid
local.block nodamage
local.block immune bullet
local.block immune fast_bullet
local.block immune rocket
local.block immune explosion
local.block immune grenade
local.block immune shotgun
local.block immune bash
local.block immune crush
local.block immune falling
local.block immune vehicle

end
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

//-----------------------------------------------------------------------------
level waittill spawn

thread xtras
// thread block **dont need this line your xtras thread calls it**
//but the whole script was falling over before this when trying to spawn the tree the wrong way

xtras:
spawn static/tree_commontree "targetname" "xtra11"
$xtra11.origin = ( 1340.37 197.46 -63.88 )
$xtra11.angles = ( 0 -83.51 0 )
$xtra11.scale = 1.75
thread block $xtra11.origin
here is the problem, notice the error in your console with a ^ pointing to spawn? you have to define what model it is first, and you forgot the .tik. It should look like this.

local.tree = script_model "model" "static/tree_commontree.tik" "targetname" "xtra11"

Grassy
An ambiguous question will get a similar answer...
LiquorKraZy
Captain
Posts: 267
Joined: Tue Aug 10, 2004 5:38 am
Location: CA
Contact:

Post by LiquorKraZy »

ill try that...but whats weird is that the xtras thread and the block thread worked fine on all the other maps i scripted like:
xtras:
spawn static/tree_commontree "targetname" "xtra11"
$xtra11.origin = ( 1340.37 197.46 -63.88 )
$xtra11.angles = ( 0 -83.51 0 )
$xtra11.scale = 1.75
thread block $xtra11.origin

but then i put them in OMAHA Beach and the trees spawn just fine...only the BLOCK thread that ROOKIE gave me suddenly wont work...kinda weird!
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Doh I just re read your script again, still problems there.

//-----------------------------------------------------------------------------
xtras:
spawn static/tree_commontree "targetname" "xtra11"
$xtra11.origin = ( 1340.37 197.46 -63.88 )
$xtra11.angles = ( 0 -83.51 0 )
$xtra11.scale = 1.75
//thread block $xtra11.origin <<--dont add .origin just the targetname

thread block $xtra11
end

//------------------------------------------------------------------------------
block local.org:
//local.block = spawn script_object origin $xtra7.origin <<--?? where did this name come from?

local.block = spawn script_object "origin" local.org.origin

local.block setsize ( -12 -12 -16 ) ( 12 12 100 )
local.block solid
etc etc

So now the code should look like:

Code: Select all

//-------------------- 
xtras:
//-------------------- 
local.tree = script_model "model" "static/tree_commontree.tik" "targetname" "xtra11" 
$xtra11.origin = ( 1340.37 197.46 -63.88 ) 
$xtra11.angles = ( 0 -83.51 0 ) 
$xtra11.scale = 1.75 
thread block $xtra11
end

//----------------------- 
block local.org: 
//----------------------- 
local.block = spawn script_object "origin" local.org.origin 
local.block setsize ( -12 -12 -16 ) ( 12 12 100 ) 
local.block solid 
local.block nodamage 
local.block immune bullet 
local.block immune fast_bullet 
local.block immune rocket 
local.block immune explosion 
local.block immune grenade 
local.block immune shotgun 
local.block immune bash 
local.block immune crush 
local.block immune falling 
local.block immune vehicle 
end 
An ambiguous question will get a similar answer...
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

Hey Petey, use this one.

// oak tree
local.static = spawn script_model
local.static model "static/tree_oak.tik"
local.static.origin = ( -1234 657 99 )
local.static.angles = ( 0 0 0 )
local.static setsize "-16 -16 0" "16 16 180"
local.static solid
Post Reply