Need Help Emulating SoTN Batsmash on player touch
Moderator: InsideQC Admins
3 posts
• Page 1 of 1
Need Help Emulating SoTN Batsmash on player touch
I'm trying to emulate the batsmash from symphony of the night,
so when you fly towards an enemy, they go flying backwards.
I have the flying forwards part down, but setting the enemies
velocity just freezes the enemy.
I've added a .touch function for the player and have a .smash flag
and a .smash_finished timer as well.
Any ideas?
so when you fly towards an enemy, they go flying backwards.
I have the flying forwards part down, but setting the enemies
velocity just freezes the enemy.
I've added a .touch function for the player and have a .smash flag
and a .smash_finished timer as well.
Any ideas?
-

gnounc - Posts: 424
- Joined: Mon Apr 06, 2009 6:26 am
Re: Need Help Emulating SoTN Batsmash on player touch
gnounc wrote:I'm trying to emulate the batsmash from symphony of the night,
so when you fly towards an enemy, they go flying backwards.
I have the flying forwards part down, but setting the enemies
velocity just freezes the enemy.
I've added a .touch function for the player and have a .smash flag
and a .smash_finished timer as well.
Any ideas?
Hey Gnounc,
Perhaps MauveBibs chaplain_pushplayers function could be modified for your purpose (more info here):
- Code: Select all
// Credit: MauveBib
void() chaplain_pushplayers =
{
local entity guy;
local vector direc;
local float dist;
guy = findradius(self.origin, 100);
while(guy)
{
if ((guy.flags & FL_CLIENT) && (guy.team != self.team))
{
if (vlen(guy.origin - self.origin) < 100)
{
direc = normalize(guy.origin - self.origin);
dist = (100 - (vlen(guy.origin - self.origin)));
guy.velocity = guy.velocity + direc * (dist * 3);
self.velocity = self.velocity - direc * dist;
}
}
guy = guy.chain;
}
};
- OneManClan
- Posts: 243
- Joined: Sat Feb 28, 2009 2:38 pm
Thanks Error
Error pointed out that to set the enemies velocity, you need to remove their on ground flag like so:
other.flags = other.flags - (other.flags & FL_ONGROUND);
other.flags = other.flags - (other.flags & FL_ONGROUND);
-

gnounc - Posts: 424
- Joined: Mon Apr 06, 2009 6:26 am
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest