HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Bouncing Rubber Ball

04-09-2006, 04:38 AM#1
lars
[jass]
A rolling rubber ball, bounces when hitting edge of terrain, building, even other moving units! Maybe you will start thinking how complex it is, but in fact this solution is finished in only sevral lines. Is it incredible? Enjoy it:)
To use it in your own map, you need custom a "ball" unit and a launch ability, other details can be found in the demo. And don't forget to give me a credit. :)
btw: made in jass
Attached Images
File type: jpgRubberBall.jpg (76.6 KB)
Attached Files
File type: w3xRubber Ball.w3x (27.8 KB)
04-09-2006, 04:52 AM#2
gnolllord
nice spell. Similar to rolling Boulder by Vexorian.
04-09-2006, 06:20 AM#3
lars
I've seen some bouncing abilities but mine is totally different with them. How about Vexorian's ? I can't find it-___-

Omg, time difference is so terrible; a Q-A between us costs one day ^_^
04-09-2006, 10:30 AM#4
Tim.
.. Just be patient. Merged your posts.
04-09-2006, 10:09 PM#5
vile
The calculations are nice but there are a few problems with them.
When casting on several angles, it just doesnt look very realistic. Sometimes the ball just bounces off the wall in the opposite direction, instead of changing it angle properly.
04-10-2006, 02:19 AM#6
lars
That's because this line:
if (GetUnitX(ball)-lx)*(GetUnitX(ball)-lx)+(GetUnitY(ball)-ly)*(GetUnitY(ball)-ly)<100 then
set angle2=ModuloReal(GetRandomReal(90,270)+angle,360)
This line has a special use in my Offensive map. The number "100" is relative to Ball's collision. You can just disable this line and try again. It will work fine:)
04-10-2006, 08:13 AM#7
vile
I removed it and it still doesnt bounce off properly
try at a very flat angle to throw the ball at the wall
it will just bounce in the opposite angle
04-10-2006, 01:10 PM#8
lars
yep,It's not very accurate when you use it at a very flat angle. It can be fixed by some conditional expression if it's needed.
04-10-2006, 01:46 PM#9
vile
I set the angle to minus if the terrain isnt pathable and it worked well. Try it.
04-10-2006, 02:54 PM#10
lars
Thank you:)
I want to keep it simple and effective because it's used in my Offensive map Conqueror's 3C.
I've made a lot of new style abilities in my maps. If you are interested pls send me a mail: [email protected] :)
04-10-2006, 04:49 PM#11
vile
Too bad you dont have msn, its easier to contact through that. We should talk.
04-10-2006, 05:04 PM#12
Tim.
Have you made the change Vile suggested to your file uploaded here?
04-10-2006, 07:43 PM#13
Blade.dk
The only real problem I see is that the dummy unit seems to have the worker classification, which makes the idle workers icon show up. Please fix that.
04-11-2006, 02:23 AM#14
lars
Thank you all. I've removed the worker classification and uploaded again.
to Tim: I added that method as a comment in stead, because it doesn't
matter in a map with complex terrians:)

to Vile: The worse thing is there is time difference between us and IM soft
can't solve it :P
04-11-2006, 09:52 AM#15
Blade.dk
Approved.

You might want to add some instructions to help people implement and configure it, that usually makes more people use a spell.