PDA

View Full Version : Point n click movement system


DrakilorP2P
03-22-2007, 01:40 AM
This script implements a Diablo 2 style movement system. You click on a location and the player will attempt to move there. Included is acceleration and friction, which are configurable from onCreated().
This script used to have stamina and walking/running, but I removed it since most people would probably want to implement their own such system anyway (And to avoid bloating the script with features no one will use which only make it harder to read.).

Here's some documentation to help you expand it if necessary.

onCreated():
Variable initialisation.
onTimeout():
Acceleration, friction and movement.
SetTarget(x, y):
Properly sets this.target.[x/y] which is where the player will accelerate towards.
Accelerate(xspeed, yspeed, maxspeed):
Properly increases this.speed.[x/y] to avoid accelerating further than maxspeed.
Move(x, y):
Moves the player with block detection.
Distance(x, y):
Helper function; returns distance between (0, 0) and (x, y).

Installation: Used as a weapon.
//#CLIENTSIDE

//**************************************************
function onCreated()
{
this.baseSpeed = 8;
this.acceleration = 4;
this.baseFriction = 0.5;

this.target.x = player.x + 1.5;
this.target.y = player.y + 2;

onTimeout();
}


//**************************************************
function onTimeout()
{
// *****Set target position so we know where to move
if (leftmousebutton) {
SetTarget(mousex, mousey);
}

// *****Friction (We aren't walking on ice)
this.speed.x *= this.baseFriction;
this.speed.y *= this.baseFriction;

// *****Accelerate so we'll eventually reach that target position.
if (Distance(this.target.x - player.x - 1.5, this.target.y - player.y - 2) > 1 && !this.stopped) {
temp.angle = getangle(this.target.x - player.x - 1.5, this.target.y - player.y - 2);
temp.speed.x = cos(temp.angle) * this.acceleration;
temp.speed.y = -sin(temp.angle) * this.acceleration;

Accelerate(temp.speed.x, temp.speed.y, this.baseSpeed);

setani("walk", "");
}
else
{
if (this.speed.x < 0.5 && this.speed.x > -0.5) this.speed.x = 0;
if (this.speed.y < 0.5 && this.speed.y > -0.5) this.speed.y = 0;
this.stopped = true;
setani("idle", "");
}

// *****Actually move the player according to current speed.
Move(this.speed.x, this.speed.y);
if (this.speed.x != 0 && this.speed.y != 0) player.dir = getdir(this.speed.x, this.speed.y);

setTimer(0.05);
}


//**************************************************
function onMouseDown(button)
{
// Set target position so we know where to move.
if (button == "left") {
SetTarget(mousex, mousey);
}
}


//**************************************************
// Set the position the system will try to reach.
function SetTarget(targetx, targety)
{
if (Distance(targetx - player.x - 1.5, targety - player.y - 2) > 1) {
this.target.x = targetx;
this.target.y = targety;
this.stopped = false;
}
}


//**************************************************
// Increase the speed in pixels per frame.
function Accelerate(xSpeed, ySpeed, maxSpeed)
{
if (Distance(this.speed.x, this.speed.y) < maxSpeed || (Distance(this.speed.x + xSpeed, this.speed.y + ySpeed) - Distance(this.speed.x, this.speed.y)) <= 0) {
this.speed.x += xSpeed;
this.speed.y += ySpeed;

if (Distance(this.speed.x, this.speed.y) > maxSpeed) {
temp.angle = getangle(this.speed.x, this.speed.y);
this.speed.x = cos(temp.angle) * maxSpeed;
this.speed.y = -sin(temp.angle) * maxSpeed;
}
}
}


//**************************************************
// Move the player by specified amount of pixels.
function Move(xSpeed, ySpeed)
{
if (!isapplicationactive) return;

xSpeed = xSpeed<0?int(xSpeed)+1:int(xSpeed);
ySpeed = ySpeed<0?int(ySpeed)+1:int(ySpeed);

// --- 'x' movement of the player --- \\
if (xSpeed != 0) {
temp.x = int(player.x * 16);
temp.xDir = (abs(xSpeed) / xSpeed);
for (i=0; i<abs(xSpeed); i++) {
if (!onwall2(temp.x / 16 + 1 + temp.xDir * (1/16), player.y + 2, 1, 1)) temp.x += temp.xDir;
else break;
}
player.x = temp.x / 16;
}

// --- 'y' movement of the player --- \\
if (ySpeed != 0) {
temp.y = int(player.y * 16);
temp.yDir = (abs(ySpeed) / ySpeed);
for (i=0; i<abs(ySpeed); i++) {
if (!onwall2(player.x + 1, temp.y / 16 + 2 + temp.yDir * (1/16), 1, 1)) temp.y += temp.yDir;
else break;
}
player.y = temp.y / 16;
}

//Hack
if (tiletype(player.x + 1.5, player.y + 2) == 3) {
setani("sit", "");
}
}


//**************************************************
//Calculate the distance between (0, 0) and (dx, dy).
function Distance(dx, dy)
{
return ((dx)^2 + (dy)^2)^0.5
}

Angel_Light
03-22-2007, 02:35 AM
awesome ^_^

Rapidwolve
03-22-2007, 02:48 AM
Nice

theHAWKER
03-22-2007, 03:15 AM
where do u put this script? in weapons?

Switch
03-22-2007, 03:49 AM
It looks good. Doesn't work on servers O.o

killerogue
03-22-2007, 04:12 AM
where do u put this script? in weapons?

Damn, GS1 using....UIGGGHGHGSDNGSK

It looks good. Doesn't work on servers O.o

It works on Mythic so YOU must've ****ed it up.

Twinny
03-22-2007, 04:37 AM
You click on a location and the player will attempt to move there.

Haha one part of my master plan has been taken >_<. I wanted to make a point and click styled system like Monkey Island.

DrakilorP2P
03-22-2007, 09:47 AM
More precise installation instructions:
1. Get access to a server using GS2.
2. Insert the script as a "weapon". For example: System/Movement.
3. Add the weapon to your account, or add a script that automatically adds it when a player connect.

Haha one part of my master plan has been taken >_<. I wanted to make a point and click styled system like Monkey Island.

You can view it in two ways:
1. Part of your master plan was taken.
or 2. Someone wrote the script for you.

xXziroXx
03-22-2007, 11:01 AM
Thats right folks! Now YOUR server can have a small part of Mythic on them!

Twinny
03-22-2007, 03:13 PM
You can view it in two ways:
1. Part of your master plan was taken.
or 2. Someone wrote the script for you.

I'd have to write a pretty damn good pathfinding system for mine...or get some unlucky LAT to map out possible paths in each level ^^. I suppose you could write a spider to scan all possible paths then save them to a database...hmm...

Angel_Light
03-22-2007, 10:20 PM
Links don't work with this, nor does onPlayerTouchsMe() :| Gotta make some checks and so forth, works well on a gmap =D

Crow
03-22-2007, 10:37 PM
It looks good. Doesn't work on servers O.o
Pretty nice script! I checked it, looks pretty cool. I got no server to test it atm though :/

Edit: Correction: I actually got one, but my RC seems to be totally ****ed up.

Switch
03-22-2007, 11:19 PM
Pretty nice script! I checked it, looks pretty cool. I got no server to test it atm though :/

Edit: Correction: I actually got one, but my RC seems to be totally ****ed up.

I happen to OWN a server and I put it on to test it and it DIDN'T work. AND I had one of my GATs test it RIGHT now. It ALSO didn't work.

Twinny
03-22-2007, 11:41 PM
Did you add the weapon to yourselves? :rolleyes:

Angel_Light
03-23-2007, 12:48 AM
I had one of my GATs test it RIGHT now. It ALSO didn't work.

GAT != NAT

lol

EDIT: How would I reset setTarget()? I've tried a few different method but the player spazzes out or just head north east. :/ Also I tried to make it so the players normal movement isnt afftected by this aswell and failed... any pointers to get me started?

DrakilorP2P
03-23-2007, 01:04 PM
EDIT: How would I reset setTarget()? I've tried a few different method but the player spazzes out or just head north east. :/ Also I tried to make it so the players normal movement isnt afftected by this aswell and failed... any pointers to get me started?

disabledefmovement();

this.stopped = true; or setTarget(player.x+1.5, player.y+.2).
The latter may or may not work, but it looks neater.

Angel_Light
03-24-2007, 12:22 AM
disabledefmovement();

this.stopped = true; or setTarget(player.x+1.5, player.y+.2).
The latter may or may not work, but it looks neater.

tried player goes to north west

middo
04-10-2007, 12:54 PM
I did a little modification so that it works with arrow keys :D

There was also a bug in the condition before your getdir(speed.x,speed.y)
You had &&'d it, and so it wouldn't update the direction if you were only moving one way. Just replace && with || like I did here.

EDIT: I changed a lot of the code. There were a lot of problems, I tested it with a friend and when we collided, we were stuck on each other! Now you can get out of walls and not fly through them if moving fast (only does the save check if you are stuck in a wall, otherwise you can still have a high speed set and the raytrace won't skip the wall)

LAST EDIT:
I fixed my own bugs and made it work almost perfectly! A saveCheck is set and overrides the speeds to try and get you out of the wall. Works perfectly for me :D
If you want to use it for mouse still, just uncomment the mouse lines I took out.

//#CLIENTSIDE

//**************************************************
function onCreated()
{
this.baseSpeed = 8;
this.acceleration = 4.5;
this.baseFriction = .5;

this.target.x = player.x + 1.5;
this.target.y = player.y + 2;

onTimeout();

disabledefmovement();
}

function onPlayerEnters()
{
disabledefmovement();
this.target.x = player.x + 1.5;
this.target.y = player.y + 2;
}


//**************************************************
function onTimeout()
{
modY=0;
modX=0;
if (keydown(0)) modY=-1.2;
if (keydown(1)) modX=-1.2;
if (keydown(2)) modY=1.2;
if (keydown(3)) modX=1.2;

if (modY != 0 || modX != 0) SetTarget(player.x+1.5+modX,player.y+2+modY);

// *****Set target position so we know where to move
//if (leftmousebutton) {
// SetTarget(mousex, mousey);
//}

// *****Friction (We aren't walking on ice)
this.speed.x *= this.baseFriction;
this.speed.y *= this.baseFriction;

// *****Accelerate so we'll eventually reach that target position.
if (Distance(this.target.x - player.x - 1.5, this.target.y - player.y - 2) > 1 && !this.stopped) {
temp.angle = getangle(this.target.x - player.x - 1.5, this.target.y - player.y - 2);
temp.speed.x = cos(temp.angle) * this.acceleration;
temp.speed.y = -sin(temp.angle) * this.acceleration;

Accelerate(temp.speed.x, temp.speed.y, this.baseSpeed);
setani("walk", "");
}
else
{
if (this.speed.x < 0.1 && this.speed.x > -0.1) this.speed.x = 0;
if (this.speed.y < 0.1 && this.speed.y > -0.1) this.speed.y = 0;
this.stopped = true;
}

// *****Actually move the player according to current speed.
Move(this.speed.x, this.speed.y);
if (this.speed.x != 0 || this.speed.y != 0) player.dir = getdir(this.speed.x, this.speed.y);
if ((modX == 0 && modY == 0) && (this.speed.x !=0 || this.speed.y !=0))
{
this.stopped == true;
SetTarget(player.x+1.5,player.y+2);
//Hack
if (tiletype(player.x + 1.5, player.y + 2) == 3) {
setani("sit", "");
} else {
setani("idle", "");
}
}

setTimer(0.05);
}


//**************************************************
/*function onMouseDown(button)
{
// Set target position so we know where to move.
if (button == "left") {
SetTarget(mousex, mousey);
}
}*/


//**************************************************
// Set the position the system will try to reach.
function SetTarget(targetx, targety)
{
if (Distance(targetx - player.x - 1.5, targety - player.y - 2) > 1) {
this.target.x = targetx;
this.target.y = targety;
this.stopped = false;
}
}


//**************************************************
// Increase the speed in pixels per frame.
function Accelerate(xSpeed, ySpeed, maxSpeed)
{

if (Distance(this.speed.x, this.speed.y) < maxSpeed || (Distance(this.speed.x + xSpeed, this.speed.y + ySpeed) - Distance(this.speed.x, this.speed.y)) <= 0) {
// if (modX != 0 || modY != 0) {
this.speed.x += xSpeed;
this.speed.y += ySpeed;
// }
if (Distance(this.speed.x, this.speed.y) > maxSpeed) {
temp.angle = getangle(this.speed.x, this.speed.y);
this.speed.x = cos(temp.angle) * maxSpeed;
this.speed.y = -sin(temp.angle) * maxSpeed;
}
}
}

//**************************************************
// Move the player by specified amount of pixels.
function Move(xSpeed, ySpeed)
{
//if (!isapplicationactive) return;

xSpeed = xSpeed<0?int(xSpeed)+1:int(xSpeed);
ySpeed = ySpeed<0?int(ySpeed)+1:int(ySpeed);

temp.saveCheck = onwall2(player.x+1,player.y+2,1,1); // modify our detection to get unstuck if we are

// --- 'x' movement of the player --- \\
if (xSpeed != 0) {
temp.xDir = (abs(xSpeed) / xSpeed);
temp.x = int(player.x * 16);
temp.scanx = 0;
for (i=0; i < (temp.saveCheck ? .45 : abs(xSpeed)); i ++ ) {
if (!onwall2((temp.x+(i*temp.xDir)) / 16 + 1 + (temp.xDir*(temp.saveCheck ? 24 : 8)) * (1/16), player.y + 2, 1, 1)) temp.scanx++;
else if (temp.saveCheck) continue; else break;
}
temp.x+=(temp.scanx*temp.xDir);
player.x = temp.x / 16;
}

// --- 'y' movement of the player --- \\
if (ySpeed != 0) {
temp.y = int(player.y * 16);
temp.yDir = (abs(ySpeed) / ySpeed);
temp.scany = 0;
for (i=0; i<(temp.saveCheck ? .45 : abs(ySpeed)); i++) {
if (!onwall2(player.x + 1, (temp.y+(temp.scany*temp.yDir)) / 16 + (temp.saveCheck ? 1.5 : 2) + (temp.yDir*(temp.saveCheck ? 24 : 1)) * (1/16), 1, 1)) temp.scany++;
else if (temp.saveCheck) continue; else break;
}
temp.y+=(temp.scany*temp.yDir);
temp.varia=onwall2(player.x+1,player.y+2,1,1);
player.y = temp.y / 16;
}
if (tiletype(player.x + 1.5, player.y + 2) == 3) {
setani("sit", "");
}

}


//**************************************************
//Calculate the distance between (0, 0) and (dx, dy).
function Distance(dx, dy)
{
return ((dx)^2 + (dy)^2)^0.5
}


I'll be using this I think.
Thanks <3

Angel_Light
06-07-2008, 06:56 AM
sorry to bring up an old thread but I have a question, in middo's form of this script, near the bottom of the script what is the point of

temp.varia=onwall2(player.x+1,player.y+2,1,1);

Crow
06-07-2008, 12:50 PM
sorry to bring up an old thread but I have a question, in middo's form of this script, near the bottom of the script what is the point of

temp.varia=onwall2(player.x+1,player.y+2,1,1);

Most likely an unused leftover variable.

cbk1994
06-07-2008, 07:05 PM
sorry to bring up an old thread but I have a question, in middo's form of this script, near the bottom of the script what is the point of

temp.varia=onwall2(player.x+1,player.y+2,1,1);

Without reading the script, it would seem that he is using it for some kind of wall detection, no?

Crow
06-07-2008, 07:16 PM
Without reading the script, it would seem that he is using it for some kind of wall detection, no?

Well, it isn't used anywhere else. Maybe he wanted to do that first, but I guess he didn't like that idea later ;P

cbk1994
06-07-2008, 07:24 PM
Well, it isn't used anywhere else. Maybe he wanted to do that first, but I guess he didn't like that idea later ;P

I bet it's just there to piss people off.

Angel_Light
06-07-2008, 07:44 PM
haha, I was did a search last night for all posts that have my server name in it and this came up, it puzzled me. XD

Deas_Voice
06-07-2008, 11:05 PM
haha, I was did a search last night for all posts that have my server name in it and this came up, it puzzled me. XD

how meny posts was it? xD

cbk1994
06-08-2008, 12:13 AM
how meny posts was it? xD

44841

Crow
06-08-2008, 12:26 AM
We are doomed.

44843

xXziroXx
06-08-2008, 01:27 AM
We are doomed.

44843

I don't get it.

cbk1994
06-08-2008, 02:37 AM
I don't get it.

Neither does a quick Google search ...

DustyPorViva
06-08-2008, 03:28 AM
I'm assuming the movie 23. I haven't seen it, but I think it's like the evil 42.

Angel_Light
06-08-2008, 07:45 AM
hey! 42 is the answer to life, the universe, and everything!

cbk1994
06-08-2008, 07:58 AM
hey! 42 is the answer to life, the universe, and everything!

Google agrees.

44844

Crow
06-08-2008, 11:39 AM
I'm assuming the movie 23. I haven't seen it, but I think it's like the evil 42.

Ding ding ding. 23 and its cross sum 5, Illuminati.

DrakilorP2P
06-25-2008, 03:59 AM
Since this thread is already kind of bumped:

function onActionServerSide()
{
switch (params[0]) {
case "freezeplayer":
clientr.frozen = true;
break;

case "unfreezeplayer":
clientr.frozen = false;
break;
}
}

//#CLIENTSIDE

//**************************************************
function onCreated()
{
this.baseSpeed = 12;
this.acceleration = 2;
this.friction.plain = 0.75; // <- Ordinary, which means 'normal ground'.
this.friction.water = 0.5;
this.friction.chair = 0.5;
this.friction.air = 0.95;
this.gravity = 2;

this.baseJumpPower.xy = 25;
this.baseJumpPower.z = 7;
this.doublePressDelay = 0.25;

this.gani.idle = "idle";
this.gani.walk = "walk";
this.gani.slowWalk = "slowwalk";
this.gani.swim = "swim";
this.gani.sit = "sit";

disabledefmovement();

onTimeout();
}


//**************************************************
function onKeyPressed(keycode, keyname, scancode)
{
switch (keyname) {
case "n":
this.noclip = !this.noclip;
player.chat = "Noclip: " SPC this.noclip;
break;
}
}


//**************************************************
function onTimeout()
{
temp.dirArr = {false, false, false, false};
if (this.freezetime <= 0)
{
if (keydown(0)) temp.dirArr[0] = true;
if (keydown(1)) temp.dirArr[1] = true;
if (keydown(2)) temp.dirArr[2] = true;
if (keydown(3)) temp.dirArr[3] = true;
}

// *****Loop throught the keys (temp.dirArr).
for (i=0; i<4; i++) {
temp.dir = i;
if (temp.dirArr[i] == true) {
if (this.("keyMode" @ temp.dir) == 0) {
this.("lastKeyPress" @ temp.dir) = timevar2;
this.("keyMode" @ temp.dir) = 1;
}
elseif (this.("keyMode" @ temp.dir) == 2) {
Jump(temp.dir);
this.("keyMode" @ temp.dir) = 0;
}
}
else {
if (this.("keyMode" @ temp.dir) == 1) {
this.("keyMode" @ temp.dir) = 2;
}
if (timevar2 - this.("lastKeyPress" @ temp.dir) > this.doublePressDelay) {
this.("keyMode" @ temp.dir) = 0;
}
}
}

// *****Get current friction
if (player.z == 0) {
temp.curtiletype = tiletype(player.x + 1.5, player.y + 2);
if (temp.curtiletype == 11) temp.friction = this.friction.water;
elseif (temp.curtiletype == 3) temp.friction = this.friction.chair;
else temp.friction = this.friction.plain;
}
else temp.friction = this.friction.air;

// *****Apply friction
this.speed.x *= temp.friction;
this.speed.y *= temp.friction;
if (this.speed.x < 0.25 && this.speed.x > -0.25) this.speed.x = 0;
if (this.speed.y < 0.25 && this.speed.y > -0.25) this.speed.y = 0;

// *****Accelerate so we'll eventually reach that target position.
if (player.z == 0 && this.freezetime <= 0) {
if (keydown(0)) Accelerate(0, -this.acceleration, this.baseSpeed);
if (keydown(1)) Accelerate(-this.acceleration, 0, this.baseSpeed);
if (keydown(2)) Accelerate(0, this.acceleration, this.baseSpeed);
if (keydown(3)) Accelerate(this.acceleration, 0, this.baseSpeed);
}

// *****Actually move the player according to current speed.
Move(this.speed.x, this.speed.y);
if (!clientr.frozen && (this.speed.x != 0 || this.speed.y != 0)) player.dir = getdir(this.speed.x, this.speed.y);

// *****Gravity
if (player.z > 0) this.speed.z -= this.gravity;
elseif (this.speed.z < 0) this.speed.z = 0;
player.z += this.speed.z / 16;

// *****Freeze
if (this.freezetime > 0) this.freezetime -= 0.05;

// *****Set animation.
if (Distance(this.speed.x, this.speed.y) > 0.1) {
temp.groundtype = GetGroundType();
if (temp.groundtype == "water") setani(this.gani.swim, "");
elseif (temp.groundtype == "chair") setani(this.gani.sit, "");
elseif (!clientr.frozen && Distance(this.speed.x, this.speed.y) > 0.5) {
if (Distance(this.speed.x, this.speed.y) < 7.5) setani(this.gani.slowWalk, "");
else setani(this.gani.walk, "");
}
else setani(this.gani.idle, "");
}

setTimer(0.05);
}


//**************************************************
// Increase the speed in pixels per frame.
function Accelerate(xSpeed, ySpeed, maxSpeed)
{
if (Distance(this.speed.x, this.speed.y) < maxSpeed || (Distance(this.speed.x + xSpeed, this.speed.y + ySpeed) - Distance(this.speed.x, this.speed.y)) <= 0) {
this.speed.x += xSpeed;
this.speed.y += ySpeed;

if (Distance(this.speed.x, this.speed.y) > maxSpeed) {
temp.angle = getangle(this.speed.x, this.speed.y);
this.speed.x = cos(temp.angle) * maxSpeed;
this.speed.y = -sin(temp.angle) * maxSpeed;
}
}
}


//**************************************************
// Move the player by specified amount of pixels.
function Move(xSpeed, ySpeed)
{
if (!isapplicationactive || clientr.frozen) return;

xSpeed = xSpeed<0?int(xSpeed)+1:int(xSpeed);
ySpeed = ySpeed<0?int(ySpeed)+1:int(ySpeed);

// --- 'x' movement of the player --- \\
if (xSpeed != 0) {
temp.x = int(player.x * 16);
temp.xDir = (abs(xSpeed) / xSpeed);
for (i=0; i<abs(xSpeed); i++) {
if (!onwall2(temp.x / 16 + 0.75 + temp.xDir * (1/16), player.y + 1.75, 1.5, 1.25) || this.noclip) temp.x += temp.xDir;
else break;
}
player.x = temp.x / 16;
}

// --- 'y' movement of the player --- \\
if (ySpeed != 0) {
temp.y = int(player.y * 16);
temp.yDir = (abs(ySpeed) / ySpeed);
for (i=0; i<abs(ySpeed); i++) {
if (!onwall2(player.x + 0.75, temp.y / 16 + 1.75 + temp.yDir * (1/16), 1.5, 1.25) || this.noclip) temp.y += temp.yDir;
else break;
}
player.y = temp.y / 16;
}
}


//**************************************************
// Jump in the specified direction.
function Jump(direction)
{
if (player.z == 0) {
if (this.speed.z == NULL) this.speed.z += this.baseJumpPower.z;
if (direction == 0) this.speed.y -= this.baseJumpPower.xy;
elseif (direction == 1) this.speed.x -= this.baseJumpPower.xy;
elseif (direction == 2) this.speed.y += this.baseJumpPower.xy;
elseif (direction == 3) this.speed.x += this.baseJumpPower.xy;
}
}


//**************************************************
// Prevent the player form accelerating or jumping via keydown() for the specified amount of time.
public function freeze(time) {
if (time != NULL) this.freezetime = time;
else return this.freezetime;
}


//**************************************************
// Replace ganis to be displayed when walking etc. Read onCreated() for list of variables.
public function replaceGani(type, gani)
{
makevar("this.gani." @ type) = gani;
player.chat = makevar("this.gani." @ type);
}


//**************************************************
// Returns a string representing the ground type the player is standing on. We need this in order to figure out what gani to use.
function GetGroundType()
{
temp.tiletype = tiletype(player.x + 1.5, player.y + 2);
if (temp.tiletype == 11) return "water";
elseif (temp.tiletype == 3) return "chair";
else return "ground";
}


//**************************************************
//Calculate the distance between (0, 0) and (dx, dy).
function Distance(dx, dy)
{
return ((dx)^2 + (dy)^2)^0.5;
}

It's a later revision of the original code that I completely forgot about and found again only recently.
Note: the animations might not work properly since I didn't bother with extensive debugging after modifying it slightly for Code Gallery use.

Like the previous modification posted, this one lets you use the keyboard to move around. Unlike the previous, it uses Accelerate() instead of SetTarget() (*gasp*).
In addition, as a result of the great mind leakage of 1978*, it implements a UT style jump/dodge function which is activated when you tap a direction button twice. It will usually keep you entertained for about sixty seconds.

It's been fooled around with by at least two other coders but I'm unable to deduce who did what exactly.

[Footnote*]
This disastrous event, which killed many, was a result of Xzirox running into the Barsebäck reactor to save a baby from radiation poisoning. The baby had already been burnt to a crisp by the intense heat of course, so he was faced with nought but carbon fumes. The combination of fumes, radiation and a conveniently occurring discharge of electricity momentarily mutated Xzirox into a Mindflayer with great telepathic abilities who lost control of it's telepathic wave transmitters, resulting in all of his most terrible ideas being leaked into a nearby town. I was observing a pane of lead at the time which blocked most of the waves, so I was fortunately only struck with a somewhat innocent idea. However, even this limited exposure caused me to lose a whole night of sleep by forcing me to compulsively finish the feature before finally allowing me to sleep. The Swedish government agreed to pay for the medical bills for the humanification if Xzirox would promise never to attempt to save a baby again. Nowadays the survivors of that terrible accident annually pay respects to the less lucky ones who had their heads explode.

Admins
06-30-2008, 03:52 PM
Funny story :D
Will eventually use the scripts for a future project :)

xXziroXx
07-01-2008, 12:45 AM
Funny store :D

Yeah go ahead, laugh at my expense all you want. !pissed!

cbk1994
07-01-2008, 02:19 AM
Lol Awesome Story

Samposse
11-28-2009, 04:29 PM
Think how to PK whoud be like ^^ *Old Warcraft style xD