Author Topic: Homing Player With Sword Weapon  (Read 2373 times)

How would I make a player aim at another player in a specific radius then thrust at it and attack it? How am I supposed to do this code?
« Last Edit: January 08, 2011, 05:55:26 PM by Uxie »

It should be possible unless this engine is to weak to take it.

I'm sure the engine could take it.


You mean like a melee aimbot? Dude, shame.

You mean like a melee aimbot? Dude, shame.
it does that in the game

As in, all this happens with OnTrigger.

I have an idea for how it is done.
You have a constant test being run that tests the distance of all players with a raycast.  If a player comes close enough, then you have a simple command that causes your player to face the raycast, and attack.

I'm busy with other stuff though, so get someone else to do it.

You mean like a melee aimbot? Dude, shame.
What

I have an idea for how it is done.
You have a constant test being run that tests the distance of all players with a raycast.  If a player comes close enough, then you have a simple command that causes your player to face the raycast, and attack.

I'm busy with other stuff though, so get someone else to do it.
I highly doubt you actually know what you're talking about, let alone if you know how to do this.

On triggering you would use a containerRadiusSearch to find a nearby player (I believe the first target returned by containerSearchNext will be the closest one) then you would use setTransform on the player that will be attacking to rotate them. However, I have no idea how to convert from a vector to the 4-point rotation thing setTransform uses.

What

How would I make a player aim at another player in a specific radius then thrust at it and attack it? How am I supposed to do this code?

Although I guess he's doing serverside code, so it's... more okay...

Anyways, this is a video of the gameplay of the energy sword. I have the hitting part down. But the right click OnTrigger is what I'm stuck on.

http://www.youtube.com/watch?v=BjwzVFXBuWg

The first strike is not what I am doing.
The second strike is more of a thrust. Basicly what I am talking about.


I'm new to coding, so would this work?
Code: [Select]
function armor::onTrigger(%this, %obj, %triggerNum, %val)
{
     %obj.containerRadiusSearch();
}
else
{
     %obj.setVelocity("5 0 2");
}
« Last Edit: January 09, 2011, 09:30:39 AM by Uxie »

Anyways, this is a video of the gameplay of the energy sword. I have the hitting part down. But the right click OnTrigger is what I'm stuck on.

Ah, it all makes sense now. Sorry.

Nope, my code was a Syntax Error.

Code: [Select]
function armor::onTrigger(%this, %obj, %triggerNum, %val)
{
     %obj.containerRadiusSearch();
}
else
##
##{
     %obj.setVelocity("5 0 2");
}

Nope, my code was a Syntax Error.

Code: [Select]
function armor::onTrigger(%this, %obj, %triggerNum, %val)
{
     %obj.containerRadiusSearch();
}
else
##
##{
     %obj.setVelocity("5 0 2");
}

Why do you have a floating "else" check when there's no "if?" In fact, since it's a command floating in the file, it'd just try to do setVelocity on a non-existent %obj whenever you load the script.

Code: [Select]
function armor::onTrigger(%this, %obj, %triggerNum, %val)
{
     %obj.containerRadiusSearch();
     %obj.addVelocity("-5 0 2");
}

This?
« Last Edit: January 09, 2011, 11:20:54 AM by Uxie »