HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Making cam shaking on impact?

11-22-2007, 09:10 PM#1
IVIajinSCV
well im getting anoying with my questions but here we go...
How get my screen (the terrain) shaking on impact of an mortar-shell?
I know the trigger Camera - But i dont know how to trigger it exactly when one of the mortar shells hit the ground. The tricky part is that the shells don't hit units as a point. Its location pointed ability, not unit-pointed.
Mayb this is getting weird and so, so i include the map with so you can check it out yourself.
The archamage is the Mortar Designator, use the Call mortar ability to test.
Its not an urgent question, but i would be helped if someone could help me out a bit!
Attached Files
File type: w3xMortar_test.w3x (226.3 KB)
11-22-2007, 09:45 PM#2
cohadar
Well if you know how to use timers you can start shaking it after some approximate time (1 sec maybe?)
11-22-2007, 09:49 PM#3
IVIajinSCV
the problem is

-the grenades are launched from a static point
-the targets are variable

so sometimes the distance could be 500 from the point, but it could be also 5000. timers could not be helpful since that the shells are traveling different distances, so different impact times.

(note. my appologies for making this trhead in wrong forum, if i could undo it i 'd done it, but was to late before i was aware i was in wrong forum posting this thread)
11-22-2007, 10:08 PM#4
cohadar
Ah this is simple, I just did not see it right away.

time = distance/missile_speed

See what is the missile speed of those mortars and calculate distance like this:

distance = SquareRoot(dx*dx + dy*dy)

where
dx = GetUnitX(mortar)-GetLocationX(attacked_location)
dy = GetUnitY(mortar)-GetLocationY(attacked_location)

Piece of cake.
11-22-2007, 10:36 PM#5
IVIajinSCV
Its not working for some weird reason...
look the 2 pictures below.
the first one calls the trigger on the second picture.
I know the first trigger actually 'triggers' because the other actions runs.
I add a debug text in the second trigger what returns the value of the realvar Time. But nothing appears on the screen while playing.
is there something im doing wrong?


Zoom (requires log in)

Zoom (requires log in)
Attached Images
File type: jpgtrig1.JPG (79.0 KB)
File type: jpgtrig2.JPG (37.2 KB)
11-22-2007, 10:44 PM#6
cohadar
You need to save those random points where mortars are attacking not where generator is casting the spell.
11-22-2007, 10:49 PM#7
IVIajinSCV
i know what you mean, but i was testing it global (from 1 point (the generator) and an anotherpoint (the place where the spell was cast)) because there many points to store and takes more work to test that this simple test. But im worried about the fact that even the debugmessage is not returning anything?
i mean it doesnt matter if i use 2 relevant points or just the distance between some trees (for example) isnt it? or am i doing something wrong here?
11-22-2007, 10:54 PM#8
cohadar
I know how to help you but I am too tired, going to sleep now, sorry.
See ya tomorrow, if noone helps you by then I will send you a demo map with this.

EDIT:
I looked at your map this morning and I can honestly say that you don't need shakings there.
Mortars are firing too frequently and if you shook the camera it would be impossible to play.