Page 2 of 2

Posted: Thu Aug 16, 2007 3:45 pm
by Ambassador
Got it, my problem was that I couldn't figure out how to select the dang brushes! :lol:

Now I am trying to figure out why the brushes are slightly off after the move. I think it has to do with the angles you mentioned. Do I move everything to (0 0 0) before the CNTL K? Not sure I understand that part...are you referring to the origin? How do I do this?

Thanks for all your help and patience guys! 8-)

CAN2 Model

Code: Select all

// entity 72
{
"targetname" "can2"
"origin" "-4.05 -860.27  4.00"
"testanim" "idle"
"model" "milkshape/npplcan.tik"
"scale" "1.2"
"classname" "script_model"
}
CAN2 Brush

Code: Select all

// entity 7
{
"targetname" "canb2"
"classname" "script_object"
// brush 0
{
( 33.445557 -823.324341 0.615784 ) ( -34.445557 -823.324341 0.615784 ) ( -34.445557 -887.763428 0.615784 ) common/clipall 0 0 0.00 0.500000 0.500000 983040 2193 0 -surfaceparm noimpact 
( -34.445557 -887.763428 130.384216 ) ( -34.445557 -823.324341 130.384216 ) ( 33.445557 -823.324341 130.384216 ) common/clipall 0 0 0.00 0.500000 0.500000 983040 2193 0 -surfaceparm noimpact 
( 33.445557 -887.763428 118.041870 ) ( 33.445557 -823.324341 118.041870 ) ( 33.445557 -823.324341 -7.384216 ) common/clipall 0 -8 0.00 0.500000 0.500000 983040 2193 0 -surfaceparm noimpact 
( -34.445557 -823.324341 118.041870 ) ( -34.445557 -887.763428 118.041870 ) ( -34.445557 -887.763428 -7.384216 ) common/clipall 0 -8 0.00 0.500000 0.500000 983040 2193 0 -surfaceparm noimpact 
( -34.445557 -848.639648 -7.384216 ) ( -16.034424 -823.324341 -7.384216 ) ( -25.239990 -835.981934 118.041870 ) common/clipall 0 -8 0.00 0.500000 0.500000 983040 2193 0 -surfaceparm noimpact 
( -45.952576 -839.434082 -7.384216 ) ( 3.527466 -822.173584 -7.384216 ) ( -21.212585 -830.803833 118.041870 ) common/clipall 0 -8 0.00 0.500000 0.500000 983040 2193 0 -surfaceparm noimpact 
( -1.075317 -823.324341 -7.384216 ) ( 32.294922 -834.831299 -7.384216 ) ( 15.609802 -829.077759 118.041870 ) common/clipall 0 -8 0.00 0.500000 0.500000 983040 2193 0 -surfaceparm noimpact 
( 16.185181 -824.475098 -7.384216 ) ( 35.747009 -850.941040 -7.384216 ) ( 25.966064 -837.708008 118.041870 ) common/clipall 0 -8 0.00 0.500000 0.500000 983040 2193 0 -surfaceparm noimpact 
( 38.048401 -863.598755 -7.384216 ) ( 15.034424 -895.818237 -7.384216 ) ( 26.541382 -879.708496 118.041870 ) common/clipall 0 -8 0.00 0.500000 0.500000 983040 2193 0 -surfaceparm noimpact 
( 24.239990 -886.612671 -7.384216 ) ( -4.527466 -895.818237 -7.384216 ) ( 9.856262 -891.215454 118.041870 ) common/clipall 0 -8 0.00 0.500000 0.500000 983040 2193 0 -surfaceparm noimpact 
( 0.075317 -894.667603 -7.384216 ) ( -37.897583 -882.010010 -7.384216 ) ( -18.911133 -888.338745 118.041870 ) common/clipall 0 -8 0.00 0.500000 0.500000 983040 2193 0 -surfaceparm noimpact 
( -16.034424 -894.667603 -7.384216 ) ( -40.199097 -861.297363 -7.384216 ) ( -28.116760 -877.982544 118.041870 ) common/clipall 0 -8 0.00 0.500000 0.500000 983040 2193 0 -surfaceparm noimpact 

collision

Posted: Thu Aug 16, 2007 6:43 pm
by tltrude
Bdbodger is talking about using clip brushes and an origin textured brush as a single script_object that can be used by all the obsticle models. That way you only need one script_object that does not have to be moved. All the models can target the one script_object, so you wont need a different one for each obsticle.

Add this to all the models. Ctrl+K will do it too, but you must select the model first and the script_object second -- it may be easier to just type it in.

Key: target
Value: canb2
<-- targetname of the script_object

The origin brush is just like the ones used for rotating doors. It moves the center point of the door to the center of the origin brush (the red brush).

The center point of the truck (its origin) is on the ground. So, the origin brush of the script_object moves its center point down -- no script adjusting needed. His script_object has three brushes, but yours will only have two -- the clip brush and the (red) origin brush.

You should not have to worry about the model's angles because "can2" does not have any angels set and it will use the default ( 0 0 0 ).

Posted: Fri Aug 17, 2007 6:48 am
by Ambassador
OK...How do I make a brush an origin brush? Are you talking about script_origin and then grouping it with the script_object? Or is this another real easy step that I just don't know yet (like selecting a brush :) )

I am hoping that if I can set an origin brush that it will fix my clip issue. Otherwise maybe shrinking the brushes inward will help. It is weird how it juts out in various places, hopefully its the origin.

Posted: Fri Aug 17, 2007 8:34 am
by bdbodger
An origin brush is just a brush with the common/origin texture on it . To select all the brushes you want to make into one script_object hold down the shift key and select each brush untill they are all selected then right click in the 2d area and choose script_object . After you do that then selecting one of the brushes or all of them you can press N and the entity window will be the same as for a model only the classname will be script_object you can then add any keys you want like targetname .

view origin points

Posted: Fri Aug 17, 2007 10:54 am
by tltrude
I know there is a way to see the origin points in the game, but I don't remember how. It might be a button on the "leveldesign" menu, but you have to be in developer mode, and have the cheats on, to use it.

In the console type, "togglemenu leveldesign".

Posted: Sat Aug 18, 2007 5:51 am
by Ambassador
I got it! I have to move the origins for the brushes just like you said.

yea for some reason when I set/bound the models to one brush the clips are way off...even with an origin brush with it, but if I give each model its own assigned brush its ok and then I just script in the brushes also.


Thanks so much for your help!

Posted: Mon Aug 20, 2007 6:29 pm
by Ambassador
Got another question :roll:

See I have moved as many as possible, but I need to add some extra obstacles (same kind) so I am wondering if there is a way to spawn these using a script even though they are not script_models? Or even better yet, clone a model and its brush and then place in new coords? I found this but Im not sure how to make it work:

Code: Select all

// duplicates any entity $t1 at the position of any entity $t2 
local.clone = spawn $t1.classname model $t1.brushmodel origin $t2.origin angles $t2.angles 
See my problem is that as soon as I make these script_models, they get all wacked out "collision/brush-wise" and its not as simple as origins. The classname for the models ressemble the name ie: milkshape_npplcan, milkshape_halfmoon, etc. But I have given them all target names and they ALL move fine as long as they aren't script_models.

this was my attempt to add a 7th can (there's only 6 in the original map), but I assume this needs to be a script_model? i suggested cloning because I doubt the brush can be spawned as it has no tik. if cloning won't work, is there anything that can be added to the brush to get it to spawn as well?

Code: Select all

thread addstuff

addstuff:

local.can7 = spawn milkshape_npplcan

local.can7 = model ?models/milkshape/npplcan.tik?

local.can7 targetname can7

local.can7.origin = ( -326.4 259 4 )

local.can7.angles = ( 0 0 0 )

local.can7.scale = 1.2

local.can7 notsolid

local.canb7 = spawn script_object

local.canb7 targetname canb7

local.canb7.origin = ( -321.4 261 63 )

local.canb7.angles = ( 0 0 0 )

end

Posted: Mon Aug 20, 2007 6:41 pm
by bdbodger

Code: Select all

thread addstuff 

addstuff: 

local.can7 = spawn models/milkshape/npplcan.tik origin ( -326.4 259 4 ) targetname can7 

local.can7.angles = ( 0 0 0 )  // useless if angles not set then angles are ( 0 0 0 )

local.can7.scale = 1.2 

local.can7 notsolid // ??????

local.canb7_col = spawn script_object 

local.canb7_col targetname "canb7_col" 

local.canb7_col.origin = ( -321.4 261 63 ) 

local.canb7_col setsize ( -10 -10 0 ) ( 10 10 100 ) // size of spawned clip 20x20x100

end

Posted: Mon Aug 20, 2007 8:19 pm
by Ambassador
thanks man, it just wont give me the script_object/solid brush. even if it did, these are detailed brushes not just boxes. is all that info relayed in the set size section? if so how can I find out the brushes' size info...some have many faces.

this is why I was wondering about cloning one to a specific coord. I guess I could just hide some of these detailed brushes under the map and pull them up with my move.scr if I had to.

Posted: Tue Aug 21, 2007 6:38 am
by bdbodger
You can't spawn brushes . The script_object is the best you can do . I am having a hard time understanding you what do you mean . Entities are not used in Vis only world brushes , brushes that are not script_objects . So you don't make brushes used as script_objects detail that is pointless .
thanks man, it just wont give me the script_object/solid brush
Not sure what that mean but if you make brushes a script object you can only do that once then to add to it you have to either use add to entity from the menu or select the script obect and ungroup it makeing the brushes world brushes again then make them a script object again with all the brushes you want selected . To make your script model don't select the model then make it a script model instead make a script model and set it's model key to the model you want . Some custom models don't want to work so the only way to use them is to spawn them but then that makes collision harder and spawning a script object and using setsize to create a sort of collision for them maybe the only thing you can do . I don't know if you can spawn a script_model and have it target a script_object you made in radiant and have the collision work . It maybe only possible if done in radiant so that the compilers can make the script object the collision . You can of course make a script_object and move it to the coords of your script model that can be done but you will have to scirpt that . Any entity can be moved with script except for lights .

spawn script_object

Posted: Tue Aug 21, 2007 4:37 pm
by tltrude
I think you can duplicate one of the other script_objects.

Code: Select all

thread addstuff // this line goes up in the "main" thread under "level waittill prespawn".
end

addstuff: 

	local.can7 = spawn models/milkshape/npplcan.tik origin ( -326.4 259 4 ) targetname "can7"  
	local.can7.scale = 1.2 
	local.can7 notsolid 

	local.canb7 = spawn $canb6.classname model $canb6.brushmodel targetname "canb7"
	$canb7.origin = $can7.origin

end
If what jv_map said is right, it should copy the classname and brushes of canb6.

Re: spawn script_object

Posted: Tue Aug 21, 2007 5:55 pm
by Ambassador
THANKS SO MUCH! Got it to work like this:

Code: Select all

thread addstuff 
end 

addstuff: 

local.can7 = spawn $can6.classname model $can6.brushmodel targetname "can7"  
$can7.origin = ( -326.4 636 4 )
$can7.scale = 1.2

local.canb7 = spawn $canb6.classname model $canb6.brushmodel targetname "canb7" 
$canb7.origin = ( -321.4 638 63 ) 

end