Page 1 of 2
object movement
Posted: Mon Jan 22, 2007 9:19 pm
by ViPER
is it possble to have an object orbit a pathnode?
and how to make moving brush interact with water ?
orbit
Posted: Mon Jan 22, 2007 10:53 pm
by tltrude
If your object has an origin that is offset, you can make it rotate around that point.
A brush, or script_object, can not interact with water, but you can make it move as if it is.
Posted: Tue Jan 23, 2007 12:06 am
by ViPER
cool ! How to set/offset the origin of a brush?
and no wake then in the water?
script_object
Posted: Tue Jan 23, 2007 12:38 am
by tltrude
A "brush" is part of worldspawn. To make it move you have to turn it into an entity -- like a script_object. Just as you do with doors, you can add an origin textured brush to your script_object. The center of the origin brush will be the pivot point.
There are "wake" entities you can add.
Posted: Tue Jan 23, 2007 2:44 am
by bdbodger
To have an object orbit a coord you would have to bind it to a scirpt origin that is at that coord and then rotate the script origin or as Tom suggested make an origin brush at the rotation point or coords . You are not talking about a camera are you ?
Posted: Tue Jan 23, 2007 7:27 am
by ViPER
I have a dozen large asteroids that rotate and move around in orbit. I was trying to use followpath but learned that only works for models. they spin and move about to different script origins but its all a little messy and unnatural.
Orbit would be good - im looking into your suggestions - im used to serverside scripting everything and don't fully grasp the entity/brush/script origin binding stuff in radient. I suppose ill be able to bind spawns to a moving brush(or script_object) also when i figure it out.
Hard to find simple examples - I look at Skylimit to learn alot. but it's very complicated and alot of info to dig through.
In another I have a couple shark fins that swim about in the distance but they look funny without a wake. looking for that wake entity thing.
How to bind things to script_object ? In the little script box in entity panel? or on map script?
Thanks
Posted: Tue Jan 23, 2007 8:27 am
by bdbodger
Followpath does work for script_objects . For your map though I would bind the objects to a script_origin and rotate it and also rotate the objects as well . If you don't use an origin brush as part of the object then it's middle will be the pivot point . If you don't want the object all rotateing the exact same way then use script to change the angles of the objects first then rotate them just use different angles and rotate them slowly so it looks more natural .
Posted: Tue Jan 23, 2007 9:01 am
by ViPER
how to bind my brush script object to script origin in radient ?
Posted: Tue Jan 23, 2007 9:10 am
by bdbodger
You don't you use script .
Posted: Tue Jan 23, 2007 9:17 am
by ViPER
i tried map script.
i made my brush a script object and gave it a targetname. I made a script origin and a targetname. i bind them in map script and rotate them but it just spins in its own origin.
Posted: Tue Jan 23, 2007 9:33 am
by bdbodger
$myobject bind $myscript_origin
$myobject angles ( 20 0 20 ) // what ever do a test
$myobject rotatey 2 // degrees per second try different values
$myscript_origin rotatey 4 // degrees per second
That is just an example you will have to try different values for best results . Both the script orign and the objects have to be rotated .
Posted: Tue Jan 23, 2007 9:51 am
by ViPER
thank you, yes spin the origin. i was binding them and trying to spin the object. I see now.
This is going to work great !
Where do I find this wake(for water) entity for shark fins ?
Posted: Tue Jan 23, 2007 10:18 am
by bdbodger
lol don't look at me .
Posted: Tue Jan 23, 2007 10:58 am
by ViPER
Thank you Im looking at Tom.

Posted: Tue Jan 23, 2007 2:22 pm
by Rookie One.pl
Lol.

Maybe I'm weird, but I wouldn't use a script_origin and bind the meteors to them, but rather handle the movement manually.
Code: Select all
rotate_around_point local.point local.avel:
local.radius = vector_length (local.point - self.origin)
// we need a script_origin to get the angle
local.calcent = spawn script_origin origin local.point
local.angle = angles_pointat local.calcent local.calcent self
local.calcent delete
local.ftime = 1.0 / float(getcvar(sv_fps)) // server frame time
self time local.ftime
while (self) {
local.dest = local.point + angles_toforward(local.angle) * local.radius
self moveto local.dest
self move
local.angle += local.avel * local.ftime
waitframe
}
end
Call as
Code: Select all
$object thread rotate_around_point local.point_coordinates local.angular_velocity
where local.angular_velocity is a vector of the delta angles (increase) you want per second.
