catapult. howto fire higher/faster/longer??


(Tyrlop) #1

im using Grahams (xenon) Catapult prefab from santas grotto
http://www.gamedesign-online.com/upload/prefabs/2006_01_22-10_25_50/catapult_prefab.zip
all works well the catapult fires but it just shot too close, it dont hit the target i want it to hit.
i want it to fire longer but i dunno what i need to edit on the script, so it fires harder.
here it is :

catapult_script
{
	trigger run
	{
		trigger catapult fire
	}
}

catapult
{
	spawn
	{
		wait 500
		accum 0 set 0
		setstate catapult_push_trig invisible
	}

	trigger fire
	{
		accum 0 abort_if_equal 1
		accum 0 set 1
		playsound sound/movers/switches/switch_01.wav
		wait 2000
		setstate catapult_trigger invisible
		playsound sound/weapons/rocket/rocket_fire.wav
		setstate catapult_push_trig default
		faceangles 0 0 90 500
		alertentity catapult_dust
		setstate catapult_push_trig invisible
		wait 2000
		playsound sound/movers/doors/door4_closeq.wav volume 600
		faceangles 0 0 0 4000
		playsound sound/movers/doors/door4_endcq.wav volume 500
		wait 1000
		setstate catapult_trigger default
		accum 0 set 0
	}
}

could any one help me here please?
and i also got another question.
how can i make so when i hit the ground i dont just crush and die?

thanks very much!! and sorry for my english, if u dont understand what i mean then ask plz.


(murka) #2

you can make it do the faceangles faster…
to land without death you need a cushion(shader).


(Flippy) #3

Murka is probably right.

Although I haven’t seen the example, the throwing effect is most probably caused by the faceangles command, which makes the catapult rotate.

The faceangles command works as follows:

faceangles <pitch> <yaw> <roll> <duration>

.
Changing the duration parameter will make it move faster, thus (probably) throwing the player faster and further.

If you look closely at the script you can see two faceangles commands. The first, which has a short duration of 500 ms, is the firing rotation and the second, with a longer duration of 4 s (4000 ms) is the rotation back to it’s starting point.

If you decrease the first duration (500 ms) to maybe 250, you will fly further.

About the landing without dying, murka is right too. You need a ‘cushion’ shader.
This texture can be found in the common folder (it’s a blue one).
You need to create a second brush, that overlaps with the normal ground brushes, and give it this texture.
Now your players won’t die or get hurt when falling on this brush.


(Tyrlop) #4

ow thank you very much!! :slight_smile: i tried to higher the duration before i posted here, and couldnt understand why i just flyed less :slight_smile: lmao

thank you very much i would place you both in credits lol :twisted: and also SD :slight_smile:


(Tyrlop) #5

okey i still got a problem! it dosnt help very much, so i ask if its possible to add some entityes in the air that makes the player fly faster??


(murka) #6

yes you can add a trigger_push(or something similar)… maybe place it where the catapult arm reaches the furthest so it will look natural.


(Tyrlop) #7

1 problem, i dont got : trigger_push in my entitys lis? what to do?

PS: do you guys know any misc_portal_camera tutorials??


(murka) #8

well there should be some trigger, look at them all, i dont have radiant right now and i last mapped 3 months back. maybe it was target_push?(edit:quick install of radiant and found it, its target_push)

and to use misc_portal and misc_portal_camera you need a shader with some portal thingies in the shader(there is an example map&shader with the new entities). also you need to have /r_fastsky 0 to see what it has to show.

And the camera, more useful for making portals, not really a camera because it functions like a window for the viewer, move to the left/right/up/down etc and you see like you are looking through a hole.


(Tyrlop) #9

ow yea it is thank you, :shock: now i just need to find out how it works? any ideas?
lol i dont hope i ask to much questions :stuck_out_tongue:


(murka) #10

ist not the quantity of the questions, its the quality of the questions.
how it works… i could describe it with 4 A4 pages. maybe something specific.

ok i try to be brief:
just place the mirror/protal/camera whatever you call it shader on a brush, place the misc_portal_surface near the face with that shader, it mustn’t exceed 64units away from the shader surface. try it. you should now have a working mirror, add the camera, it has info in the entity on how to connect and done.


(Flippy) #11

I don’t think there’s alot of documentation on target_push entities. I’m sure there is some info but it’s probably hard to find…

I’ve experimented with them alot though so I think I remember how to use them… Let’s see…

As someone above me said, it’s probably best to have the pushing entity at the top of the catapult arm (where it would release you) as this would look the most natural (although still, you would see players accelerating suddenly… but I guess there’s nothing you can do about that if making the arm movement faster really doesn’t help…).

So work out where the arm gets and create a brush at that point, roughly the size of a player. Make sure players can’t touch this brush without being in the catapult ofcourse.

Give the brush the ‘common/trigger’ texture. Then select it, rightclick inside it and select ‘trigger -> trigger_multiple’.

Next, create a ‘target_push’ entity near the trigger brush, slightly in front of it.

Then, link the two entities together by first, deselecting everything (ESC), then selecting the trigger brush, then selecting the target_push (while keeping the trigger brush selected) and then press ‘Ctrl+K’. An arrowed line should appear between them, make sure the arrow is pointing from the trigger to the target_push.

Last step is to create a info_notnull entity that will point your push entity in the right direction.

The ‘info_notnull’ entity will be the peak of the player’s flight so you might be able to work out where it should go nicely in radiant.

One important thing is that the info_notnull and the target_push entities should NOT be on the exact same height. If they are, it does not work. Just make sure to always put the info_notnull at least a tiny bit higher or lower.

Then you need to connect the target_push with the info_notnull again (arrow pointing from push to notnull).

That should do the trick!

Note that the placement of the info_notnull entity is the key here. It defines the speed and angle of the push given by the trigger.
You could also define them in the target_push itself so you won’t need an info_notnull, but it’s fare more easier with an info_notnull to work out the path of the flight of the player.

Hope this helps…


(murka) #12

i just looked at the prefab and it has those target_pushes etc in them, just move the info_notnull further or increase the speed in the entity.
tho a setstate trigger would make it better, nobody could jump in the trigger_multiple brush without being in the catapult.

edit:the setstate is already implemented, just inc the speed and your done.


(Tyrlop) #13

ow thanks for the long explanation Flippy,

tried that didnt helped much, now i made double target_push so now it should work :slight_smile: going to test.


(Tyrlop) #14

lmao!! just found out why it didnt worked, Graham added this to the script :

setstate catapult_push_trig invisible 

it makes the trigger_multiple for the target push invisible lol!


(kamikazee) #15

That’s exactly for the reason murka10 said - it should only be setstated to default when someone activated the animation.


(Tyrlop) #16

ok i found out now and it works, i just got 1 more question to change the speed on : target_push u need to do key : speed and value : 1000 but is 200 faster then 1000 or is 3000 faster then 1000? is low number faster or is high number fastes??


(kamikazee) #17

I believe it expresses the speed it should give the target in units per second, so higher numbers would mean faster speeds.

You could also just try it…


(Tyrlop) #18

i tried some but i dont realy see the difrent from : 200 to 3000 lol
okey thanks anyways


(murka) #19
      setstate catapult_push_trig default
      faceangles 0 0 90 500
      alertentity catapult_dust
      setstate catapult_push_trig invisible 

the pusher will exist right after its triggered, after the faceangles… shouldnt it have a wait at the end? right now it just makes it exist and not exist in the blink of an eye.

try to change that part to this

      setstate catapult_push_trig default
      faceangles 0 0 90 500 wait
      alertentity catapult_dust
      setstate catapult_push_trig invisible 

now it should be working.


(Tyrlop) #20

ok thanks…