object movement

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

object movement

Post by ViPER »

is it possble to have an object orbit a pathnode?

and how to make moving brush interact with water ?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

orbit

Post 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.
Tom Trude,

Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

cool ! How to set/offset the origin of a brush?

and no wake then in the water?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

script_object

Post 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.
Tom Trude,

Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 ?
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post 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.

Image


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
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

how to bind my brush script object to script origin in radient ?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

You don't you use script .
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post 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.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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 .
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post 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 ?
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

lol don't look at me .
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

Thank you Im looking at Tom. :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 »

Lol. :P Maybe I'm weird, but I wouldn't use a script_origin and bind the meteors to them, but rather handle the movement manually. :P

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. :)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply