Special Attacks! (..with tutorial!)

A secret forum for people who preorder Overgrowth!
User avatar
Freshbite
Posts: 3256
Joined: Thu Jan 14, 2010 3:02 pm
Location: Stockholm, Sweden.

Special Attacks! (..with tutorial!)

Post by Freshbite » Thu Feb 25, 2010 3:06 pm

So in Johns honor and as a response to This Blogpost, I present to you... some special attacks!

Notation: The second bunny (your target) has currently been unavailable from recent Alphas. If you want to try any of my attacks out, please use Alpha 67.
Spartan Kick!.rar
(4.5 KiB) Downloaded 84 times
Regular Kick: Left Click!
Spartan Kick: Right Click!

Uppercut!.zip
(6.06 KiB) Downloaded 69 times
Regular Kick: Left Click!
Uppercut: Control + Left Click!

Push!.zip
(4.84 KiB) Downloaded 64 times
Push: Left Click!
Regular Kick: Right Click!




I also put all of the attacks in one single file, if you'd like them all.
Notice that the controls are different.
Attack Pack!.zip
(19.29 KiB) Downloaded 111 times
Push - Mouse 1
Kick - Mouse 2
Uppercut - Ctrl + Mouse 1
Spartan Kick - Ctrl + Mouse 2



And so you know!
Animations is not really my "area-of-expertise", I just create functions.


It's really simple to set it up, just follow these steps:

1. Extract the .zip file anywhere.
2. Locate your Overgrowth Server (Should be Alpha 67 or after)
3. Place the "spartankick.anm" inside the "Data" -> "Animations" folder.
4. Place "aschar.as" and "ascharother.as" inside the "Data" -> "Scripts" folder.

You might want to place copies of the two original files somewhere else so that you could easily restore it IF something goes wrong.

5. Launch Overgrowth.
6. Kick the shit out of that Rabbit Guard!



Here's some clips for you poor people who can't get it to work:

Spartan Kick!


Uppercut!


Push!



Have fun with it!
Freshbite, out.








Tutorial: How to make your own special attack!

First things first, open up "aschar.as".
You can download the one from my Spartan Kick!.zip and just edit that one if you don't want to mess with your original files.

Code: Select all

bool spartanKick = false;
bool regularKick = false;  
Be sure to place these in the root of the bracket-tree. (At the very top of the file)
"Bool" variables are used as testers and can only be true or false . We will later set them to true when the button has been pressed.
Leave regularKick be, but you could change spartanKick to be any name you want for your attack.




Code: Select all

if(GetInputDown("grab") && distance_squared(this.position,target.position) < 1.2){
			
	spartanKick = true;
			
	attacking = true;
	attacking_time = 0.0;
	this.StartAnimation("Data/Animations/spartankick.anm");
	this.SetAnimationCallback("void EndAttack()");
}
" if(GetInputDown("grab") " checks if a key is being pressed. In this case, "grab" (Right-Click), so grab is the key that is pressed to ignitiate the animation.
See THIS wiki-page, recently added by John, for a complete list of key- and mouse-inputs.

We also have " distance_squared(this.position,target.position) < 1.2 " which checks the distance to the target and will only allow us to proceed with the code if the distance is smaller ( < ) than 1.2OM (Overgrowth Meters), you can change this to say... 30OM, if you'd like a ranged-attack that should be possible to trigger from far away.

Notice that we set "spartanKick" to true, so that later we can check if this is the animation we want to use, and not the default one. If you change the name of spartanKick up top, you need to do this here aswell.

"Data/Animations/spartankick.anm" is the "location/location/animation.file" we want to use for our attack. See Silverfish's Custom Animation Tutorial if you'd like to create your own animation. (That's the one I used)



Code: Select all

if(spartanKick){
	if(attacking_time > 1.3 && old_attacking_time <= 1.3){
		target.ApplyForce(direction*80);
		TimedSlowMotion(0.1,3);
		
		spartanKick = false;
	}
}
Now this is where the magic happens.

" if(spartanKick) " checks if the bool spartanKick is set to true. If we have pressed the corresponding button, it should be.
If so, it executes the next lines of code.
You might need to change spartanKick to whatever you named your own attack.

attacking_time & old_attacking_time both follow by the number 1.3.
1.3 is the time in seconds after the start of the animation.
You want this to be the point in the animation where the foot / hand / head hits the enemy.
This might be tricky to get timed correctly, especially if you have longer animations.


" target.ApplyForce(direction*80); "
This is the amount of force being put into the attack.
Notice that a force equal to 10 is more than enough to make the rabbit fly trough the air.
A regular kick (made by a person upon another person) would have an amount of force around 5-6. Have the force go over the thousand, and you might not ever see your enemy again.


" TimedSlowMotion(0.1, 3); "
Now this is something really cool the Developers just added, the ability to create slow-motion.
What you see here is two numbers, 0.1 and 3.

0.1 declares the motion speed of the effect, on a 0-1 percentage scale.
1 = 100% speed, Normal.
0.1 = 10% speed, Slow.
0.01 = 1% speed, Very Slow.

3 declares how long the effect will last, in seconds.
1 = 1 second, Normal.
10 = 10 seconds, Long.
0.1 = 1/10 of a second, Short.


Last, but not at all less important comes " spartanKick = false; "
If we do not do this step, whenever we press another attack-button that will launch us into this section of the code, it will launch both that attack AND the spartan kick.
Since " if(spartanKick) " is in fact true, it will run this animation aswell.
So don't forget to have that in there. And don't forget to rename spartanKick to whatever you named your attack.




Please see the aschar.as for the PLACEMENTS of the code I have showed you here.
An even easier way would be to just EDIT the code I have already put into that file.
However, now you know what it is that you're actually changing :)

And for all that is holy's sake! You CAN edit the file's while the Overgrowth client is running!
Just make sure you compile them without errors, or you might need to restart the Overgrowth Client.

Anyways, that's it. Have a good one.



*EDIT* 27th of February - 03:15 -: Added "Uppercut!" available for download! :-
*EDIT* 27th of February - 03:42 -: Added a embedded Youtube clip for Uppercut! :-
*EDIT* 27th of February - 15:01 -: Added the "Attack Pack!" with a collection of all my attacks! :-
*EDIT* 1st of March - 17:50 -: Added "Push!" as a seperate download option! :-
*EDIT* 1st of March - 17:52 -: Added an embedded Youtube clip for "Push!" :-
*EDIT* 1st of March - 17:54 -: Fixed an error where I had turn the "jump pull" to negative, reuploaded all files! :-
Last edited by Freshbite on Mon Apr 12, 2010 4:53 am, edited 14 times in total.

User avatar
Johannes
Posts: 1374
Joined: Thu Dec 18, 2008 1:26 am
Contact:

Re: Spartan Kick! [Special Attack]

Post by Johannes » Thu Feb 25, 2010 3:08 pm

Noice! The 'poor people who can't get it to work' appretiate your video =)

User avatar
John
Posts: 122
Joined: Sun Apr 13, 2008 3:58 pm
Contact:

Re: Spartan Kick! [Special Attack]

Post by John » Thu Feb 25, 2010 3:16 pm

MADNESS?

User avatar
Freshbite
Posts: 3256
Joined: Thu Jan 14, 2010 3:02 pm
Location: Stockholm, Sweden.

Re: Spartan Kick! [Special Attack]

Post by Freshbite » Thu Feb 25, 2010 3:17 pm

John wrote:MADNESS?
THIS IS OVERGROWTH!!

Sweeneypaul
Posts: 3
Joined: Tue Feb 16, 2010 10:20 am

Re: Spartan Kick! [Special Attack]

Post by Sweeneypaul » Thu Feb 25, 2010 4:18 pm

Looks great thanks

User avatar
Glabbit
Posts: 4917
Joined: Sun Feb 06, 2005 8:38 am
Location: A mile away, with your shoes!

Re: Spartan Kick! [Special Attack]

Post by Glabbit » Thu Feb 25, 2010 5:59 pm

Oh I have chosen my foot carefully, Turner. Perhaps you should have done the saAAAAaaUUuUUgh~

User avatar
Freshbite
Posts: 3256
Joined: Thu Jan 14, 2010 3:02 pm
Location: Stockholm, Sweden.

Re: Spartan Kick! (..and Custom-Attack tutorial!)

Post by Freshbite » Thu Feb 25, 2010 6:43 pm

I have updated the original post with somewhat of a tutorial in how to create your own attack.

User avatar
Fournine
.hacker
Posts: 938
Joined: Thu Nov 20, 2003 3:07 am
Location: Boron group, period 5

Re: Spartan Kick! (..and Custom-Attack tutorial!)

Post by Fournine » Thu Feb 25, 2010 9:33 pm

My word, he flies far.

User avatar
Freshbite
Posts: 3256
Joined: Thu Jan 14, 2010 3:02 pm
Location: Stockholm, Sweden.

Re: Spartan Kick! (..and Custom-Attack tutorial!)

Post by Freshbite » Fri Feb 26, 2010 4:55 am

Fournine wrote:My word, he flies far.
That's just 80 of force.
I tried 2000... he never came back D:

Kinda like this big dude when he touches the other guys.

User avatar
nutcracker
Posts: 1119
Joined: Tue Apr 22, 2008 2:16 am
Location: Western Finland

Re: Spartan Kick! (..and Custom-Attack tutorial!)

Post by nutcracker » Fri Feb 26, 2010 8:01 am

One piece = awesome

User avatar
Freshbite
Posts: 3256
Joined: Thu Jan 14, 2010 3:02 pm
Location: Stockholm, Sweden.

Re: Special Attacks! (..with tutorial!)

Post by Freshbite » Fri Feb 26, 2010 9:22 pm

Added "Uppercut".

Oh, and a reminder...
Animations are not really my... "area of expertise". I just do functions.

So if someone would like to supply me with better animations, that would be grand. :mrgreen:
Last edited by Freshbite on Sat Feb 27, 2010 8:29 am, edited 1 time in total.

User avatar
nutcracker
Posts: 1119
Joined: Tue Apr 22, 2008 2:16 am
Location: Western Finland

Re: Special Attacks! (..with tutorial!)

Post by nutcracker » Sat Feb 27, 2010 3:44 am

Uppercut was cool

User avatar
Wilbefast
Posts: 1204
Joined: Wed Dec 31, 2008 2:32 pm
Location: In a sealed box shielded against environmentally induced quantum decoherence
Contact:

Re: Special Attacks! (..with tutorial!)

Post by Wilbefast » Sat Feb 27, 2010 4:31 am

hehehe :lol:

Awesome!

Jz12345
Posts: 2
Joined: Sun Feb 28, 2010 4:38 pm

Re: Special Attacks! (..with tutorial!)

Post by Jz12345 » Sun Feb 28, 2010 10:29 pm

This is cool, but after installing it, I can no longer jump.

User avatar
Freshbite
Posts: 3256
Joined: Thu Jan 14, 2010 3:02 pm
Location: Stockholm, Sweden.

Re: Special Attacks! (..with tutorial!)

Post by Freshbite » Mon Mar 01, 2010 1:34 am

Yeah, I noticed that aswell, I'll upload a fixed file when I'm getting home from work.
Which did you download? The Pack?

*EDIT*

If you want to change it for yourself (and feel awesome about it :D):
Read as few tips as possible to get Internet Cookies!













For 3 Internet Cookies:
There's something wrong with this statement:
" target_velocity.y -= 1.0; "












For 2 Internet Cookies:
Open "aschar.as" inside Data/Scripts.
Look for these lines (around Row 38):

Code: Select all

if(GetInputDown("jump")){
	target_velocity.y -= 1.0;
}












For just 1 Internet Cookie:
Just change the minus to a plus after the "target_velocity.y" and you should be all good.













For 0 Internet Cookies:
I reuploaded all files so that you can download them again.





Post how many cookies you were granted!
Btw, you could "jump", just with a negative pull :D
Seems as if I was toying around a little too much while making these attacks...

Post Reply