I have been working with PKM on the paintball arena to go along with my new paintball mod and I want the "obstacles" to have targetnames so that I can script different field layouts with different obstacle positions into the server. This way there's only one map with multiple layouts.
My question is, How do I make these "targets" and how would I give these obstacles each its own target name?
Any help would be so appreciated, I was hoping to release this today
The most common way is to turn them into script_object entities. Just highlight the brushes that make up one of your obstacles, hit key N and double click "script_object" on the list. Then you can give it a targetname like this.
Key: targetname
Value: obst1 <--- any name you like.
Last edited by tltrude on Wed Aug 15, 2007 12:03 am, edited 1 time in total.
ok one more problem. i can move the model but the brushes don't move with them. if I make the obstacle solid with a script then the clips are off and the paintballs explode when you try to shoot around them.
is there any way to move the brushes with the model by a targetname?
You will have to move them as seperate entities because one is solid and the other is not solid. Turn the model into a "script_model" and give it a different targetname. The clip brushes can all be one "script_object".
I tried double clicking Script_Model and Script_Object and it says:
Entity NOT created, brushes not all from world
Actually, I thought I should say that this is how I got it to move in the first place:
thread movestuff
movestuff:
$targetname.origin = ( 0 0 0 )
$targetname solid
end
But in making it solid it made it so the clips were larger than the obstacle and it wasn't fit properly. I was told that I could just move the modles and then manually script in the clips/brushes? Man I wish I knew more about Radiant! See I have these models imported from milkshape. If I have them in my MOH folder I get a large box to select when selecting one of these obstacles, but if the modles are out of MOH then there is a small dot. I assume these are different one being the brush and one the model. But they have the same name once I name one of them...either brush or model. I have tried naming them separate names, but they end up with the same name.
The blue box is called a bounding box and that is what would be solid. Select the clip brushes and the model, then go to Selection > Ungroup Entity. That should seperate the two, but they will no longer be entities.
A script model is an entity with a model key/value applied to it. So, you will need the model's .tik name and location.
Key: classname
Value: script_model
Key: model
Value: models/milkshape/myobst.tik
key: targetname
Value: obst1a
For the clip brushes, make them all one script_object with a targetname.
Key: classname
Value: script_object
key: targetname
Value: obst1b
So, now you can change their origins in the script.
$obst1a notsolid
thread movestuff ( 0 0 0 ) // coordinates become variable named "local.origin" in the thread.
end
movestuff local.origin:
$obst1a.origin = local.origin
$obst1b.origin = local.origin + ( 0 0 64 ) // <--- origins are adjustible, in this case, up 64 units
end
Note: Now that the model and clip brushes are seperate entities, there origins may not be in the same place. Normally a model's origin is on the ground, and a script_object's origin will be in the center. So, you will probably have to adjust the script_object's origin.
I just can't seem to get it. I was told to take the models out of MOH to see the brushes better, but everytime I change one, it changes the other. I must not be selecting the brushes?
With models in MOH I get a box that outlines the model. I know this is the model. So I take the models out of MOH and I see the outline of my models with small boxes inside them. Aren't these the brushes?
Also when I do successfully ungroup an entity, it just goes black and I can't select it or work with it anymore.
Do me a favor. Open the .map file with Notepad and copy the text lines for one of the obsticle entities and paste it here. It should look something like this.
Not all entities have brushes. Well, if there are clip brushes, they may not be an entity. They could just be worldspawn brushes. If you delete the model, are the brushes still there?
I see that the obsticle has its own classname. Have you tried changing the classname to "script_model"? Although, I guess you don't really need to because the model can be moved as is.
TIKI
setup
{
scale 1.000000 // Set default scale to 16/30.5 since world is in 16 units per foot and model is in cm's
path models/milkshape/npplcan
skelmodel npplcan.skd
surface redside shader npplcan_redside
surface bluetop shader npplcan_bluetop
}
animations
{
idle npplcan.skc
}
/*QUAKED milkshape_npplcan (0.5 0.0 0.5) (-33 -30 0) (26 32 109)
npplcan
Exported from Milkshape3D using ScorpioMidgets plugin.
*/
when I delete the model all I see is a black outline and to the right it shows a transparent model with the word CLIP all over it. turning it into script_model does nothing. still can't find the brushes.
Ambassador wrote:ok one more problem. i can move the model but the brushes don't move with them. if I make the obstacle solid with a script then the clips are off and the paintballs explode when you try to shoot around them.
is there any way to move the brushes with the model by a targetname?
What you are talking about is the collision for the models am I right ? To do that move the brushes for the model up above the model so that they are in the air . The brushes I assume are all clip brushes used to make the model solid . Make the model a script model by creating a script model then setting it's model to the model you want . Select the bruhes if you have not already made them a script object and make them a script object . Deselect your script object then select your script model first . Then select a brush of your script object and press control K so that the script model targets the script object . All this has to be done with the model at angles 0 0 0 you will have to change the angle with script . Thats it when a script model targets brushes that have been made into a script object the game uses the script object as the models collision . Thats how you make vehicles that move be solid . The game will move the script object where it is needed . I usually put an origin brush in my script object so the game can position it better . This picture is one done for a truck but the principle is the same . Once you have done it this way all you have to do is move the model and the collisiion will still be where you need it moved there by the game . Also by the way if you didn't select all the brushes when you made it a script object you can use ungroup entity from the menu to unmake them a script object then select all the brushes at once and make them a script object again .