How to make a pendelum?

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
EmeraldTiger
Posts: 392
Joined: Fri Sep 17, 2010 1:53 am

How to make a pendelum?

Post by EmeraldTiger »

...like those on q3dm15?

Except in my case I`m not trying to make a crucifix that kills the player on contact, but rather a kind of "swing" which goes back and forth, and is capable of carrying the player to the other side.

Any tips?
[color=#00FF00][b]EmeraldProductions[/b][/color]
http://emeraldproductions.weebly.com/index.html
Rav3n
Posts: 51
Joined: Sat Mar 12, 2011 7:50 pm

Re: How to make a pendelum?

Post by Rav3n »

I'm not sure if Urban Terror and Q3 have exactly the same func entities but i make a pendulum with func_bobbing.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: How to make a pendelum?

Post by obsidian »

Pendulums are hard-coded to kill players on contact. You might be able to to create some sort of invisible clip brush that oscillates with a func_bobbing at the same rate as the pendulum swing, but it'll be tricky pulling that off in a convincing manner.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
EmeraldTiger
Posts: 392
Joined: Fri Sep 17, 2010 1:53 am

Re: How to make a pendelum?

Post by EmeraldTiger »

Will a pendelum kill a player if he is on top of it? Like on the top face, not facing down, left, right, front or back?
[color=#00FF00][b]EmeraldProductions[/b][/color]
http://emeraldproductions.weebly.com/index.html
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: How to make a pendelum?

Post by obsidian »

I'm not sure, though you can test it out easily enough.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
dONKEY
Posts: 566
Joined: Mon Oct 15, 2001 7:00 am

Re: How to make a pendelum?

Post by dONKEY »

Am pretty sure if the pendulum is textured with a non solid shader it won't kill the player. Having an invisible func_bobbing sounds like the best idea, although apart from getting the two in sync, I find movement gets really jerky when you stand on moving ents like that.
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Re: How to make a pendelum?

Post by Eraser »

I dunno, but a func_bobbing is something quite different than a pendulum. How do you people suggest a func_bobbing can mimick the movement of a pendulum?
Rav3n
Posts: 51
Joined: Sat Mar 12, 2011 7:50 pm

Re: How to make a pendelum?

Post by Rav3n »

Well bobbing is basically constant movement from one side to another.
He can use that to create a n invisible brush that will move with the pendulum and push the player away rather then to kill him.
themuffinman
Posts: 384
Joined: Fri Mar 05, 2010 5:29 pm

Re: How to make a pendelum?

Post by themuffinman »

Use func_pendulum. And your entity.def is your friend:
Solid entity that describes a pendulum back and forth rotation movement. Rotates on the X axis by default. Pendulum frequency is a physical constant based on the length of the beam and gravity. Blocking the pendulum instantly kills a player.
-------- KEYS --------
angle : angle offset of axis of rotation from default X axis (default 0).
speed : angle of swing arc in either direction from initial position (default 30).
phase : sets the start offset of the swinging cycle. Values must be 0 < phase < 1. Any integer phase value is the same as no offset (default 0).
noise : path/name of .wav file to play. Use looping sounds only (eg. sound/world/drone6.wav).
model2 : path/name of model to include (eg: models/mapobjects/jets/jets01.md3).
origin : alternate method of setting XYZ origin of entity's rotation axis and .md3 model included with entity (default "0 0 0" - See Notes).
light : constantLight radius of .md3 model included with entity. Has no effect on the entity's brushes (default 0).
color : constantLight color of .md3 model included with entity. Has no effect on the entity's brushes (default 1 1 1).
notfree : when set to 1, entity will not spawn in "Free for all" and "Tournament" modes.
notteam : when set to 1, entity will not spawn in "Teamplay" and "CTF" modes.
notsingle : when set to 1, entity will not spawn in Single Player mode (bot play mode).
-------- Q3MAP2 KEYS --------
_targetname : Used to attach a misc_model entity to this entity.
_lightmapscale : Floating point value scaling the resolution of lightmaps on brushes/patches in this entity (default 1.0).
_cs OR _castshadows : Allows per-entity control over shadow casting. Defaults to 0 on entities, 1 on world. 0 = no shadow casting. 1 = cast shadows on world. > 1 = cast shadows on entities with _rs (or _receiveshadows) with the corresponding value, AND world. Negative values imply same, but DO NOT cast shadows on world.
_rs OR _receiveshadows : Allows per-entity control over shadow reception. Defaults to 1 on everything (world shadows). 0 = receives NO shadows. > 1 = receive shadows only from corresponding keyed entities (see above) and world. < 1 = receive shadows ONLY from corresponding keyed entities.
_celshader : Sets the cel shader used for this geometry. Note: omit the "textures/" prefix.
-------- Q3MAP2 TERRAIN KEYS --------
_indexmap OR alphamap : Path/name for the art file used to guide the mapping of textures on the terrain surface.
_layers OR layers : Integer value is the number unique root shaders that will be use on the terrain.
_shader OR shader : Path to the metashader used to assign textures to the terrain entity. Note: Omit the "textures/" prefix.
-------- NOTES --------
You need to have an origin brush as part of this entity. The center of that brush will be the point through which the rotation axis passes. Setting the origin key is simply an alternate method to using an origin brush. Pendulum will rotate along the X axis by default. Very crude operation: pendulum cannot rotate along Z axis, the speed of swing (frequency) is not adjustable. When using the model2 key, the origin point of the model will correspond to the origin point defined by either the origin brush or the origin coordinate value.

Target this entity with a misc_model to have the model attached to the entity (set the model's "target" key to the same value as this entity's "targetname").
The ones in q3dm15 have these keys:
"dmg" "10"
"phase" ".20"
"speed" "60"
"angle" "90"

... and despite the def saying that pendulums need an origin brush, dm15's doesn't have that.

It might be possible to have it not kill the player by using dmg 0, but still if you block the path of the pendulum it kills.
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Re: How to make a pendelum?

Post by Eraser »

Q3Dm15 probably uses the origin key, which is exactly what the def says.
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Re: How to make a pendelum?

Post by Eraser »

Rav3n wrote:Well bobbing is basically constant movement from one side to another.
Yes but only along one axis. The movement of a pendulum is arc shaped.
themuffinman
Posts: 384
Joined: Fri Mar 05, 2010 5:29 pm

Re: How to make a pendelum?

Post by themuffinman »

Eraser wrote:Q3Dm15 probably uses the origin key, which is exactly what the def says.
It doesn't, so I'm not quite sure how the game interprets the origin. Or maybe sometimes origin brushes don't decompile.
spirit_
Posts: 47
Joined: Fri Dec 10, 2010 2:29 pm

Re: How to make a pendelum?

Post by spirit_ »

@Eraser: I think they just want a square brush that pushes the player away that is "roughly near or around" the pendulum while it moves. (If you look at it from above it only moves on one axis as well.) Since it's invisible it doesn't really matter that much I guess.
[url=http://maps.rcmd.org]my FPS maps[/url]
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Re: How to make a pendelum?

Post by Eraser »

hm, I think it would just feel and look really weird, because you'd have a player sliding from left to right who basically just floats in the air.

I wouldn't call that an acceptable solution.
Rav3n
Posts: 51
Joined: Sat Mar 12, 2011 7:50 pm

Re: How to make a pendelum?

Post by Rav3n »

Yes it is a rough solution i know.
I guess the best solution would be to use func_rotating, spawnflags 8, speed -100 (negative speed value on one brush).

Basically you can create kind of clock hands type of movement where each hand moves in the opposite direction.
So you need one brush that goes left and one that goes right. Together they will align at angle of 0 degrees so your pendulum has to reach that angle. If it doesn't I'm not sure how to tweak the func_rotating brushes to match the pendulum angle.
And I'm not sure if it will be able to carry a player across the room.

Image
Post Reply