Stripped ProjectAlchemy Source Code

01/21/2011 03:26 argon69#781
Quote:
Originally Posted by pro4never View Post
I'm bored so here's some code ideas

C.Recording = true;
C.Path = new List<Coord>();
C.PathIndex = 0;
C.Path.Add(new MakeCoord(C.X, C.Y));


Then in receiving jump packet do

if (C.Recording == true)
C.Path.Add(new MakeCoord(C.X, C.Y));

In your path finding code do something like...

if(Distance to C.Path[C.PathIndex] < 7)
//path found, move to next one
if(C.PathIndex + 1< C.Path.Count)
C.PathIndex++;
else
{
C.Path = C.Path.Reverse();
C.PathIndex = 1;
}
Coord To = Calculations.PullClosest(MakeCoord(C.X, C.Y), C.Path[C.PathIndex]);
Jump or shift to the pulled coord

or something like that...



That's the ABSOLUTE simplest way to code it. Keep in mind pull closest will be a method pulling all possible coords near you that are valid and then checking their distance vs target and returning the closest one. Assuming no large obstacles it will return the most efficient coord to move to each time.


TEACHING MOMENT:

Keep in mind when working with enumerated elements in a list or an array, the .count will ALWAYS be greater then your current index value as they start at 0, not 1!


Pulling element 1 means you are actually pulling the second element in a list/array.

List<int> A = new List<int>{5, 4, 3, 2, 1, 0};

Console.WriteLine(A[0]);

This will produce the output '5'

Alternatively doing A[1] would be '4' and so on.
P4N,

I was busy with my real work. So I didn't really catch up with this thread. You are too good to be nice to noobie hackers :) Anyway, can you pm me with IM address? I want to pay you back with answer to map issues. It was little time consuming but I think I got right.
01/21/2011 05:59 warning3#782
Umm... When I exequte the .sql file I get errors. Can someone help me on TeamViewer or on msn or something please? I will appreciate the help.
01/21/2011 11:19 KraHen#783
Quote:
Originally Posted by warning3 View Post
Umm... When I exequte the .sql file I get errors. Can someone help me on TeamViewer or on msn or something please? I will appreciate the help.
Reinstall MySQL with InnoDB enabled :)
01/21/2011 16:05 OELABOELA#784
Or he should install xampp. make a new latin1 database and just import the script in there.
01/21/2011 19:42 warning3#785
Quote:
Originally Posted by OELABOELA View Post
Or he should install xampp. make a new latin1 database and just import the script in there.
Quote:
Originally Posted by KraHen View Post
Reinstall MySQL with InnoDB enabled :)
I tried both they dont work.
01/21/2011 21:23 Warlax#786
Quote:
Originally Posted by warning3 View Post
I tried both they dont work.
clue as to the error ur getting?
01/21/2011 21:57 warning3#787
[Err] 1286 - Unknown table engine 'InnoDB'
[Err] CREATE TABLE `characters` (
`UID` int(11) NOT NULL,
`Hp` int(6) NOT NULL DEFAULT '1',
`X` int(4) NOT NULL DEFAULT '1',
`Y` int(4) NOT NULL DEFAULT '1',
`Map` int(4) NOT NULL DEFAULT '1',
`Level` int(4) NOT NULL DEFAULT '1',
`Job` int(4) NOT NULL DEFAULT '1',
`Server` varchar(20) NOT NULL DEFAULT 'Default',
`Name` varchar(22) NOT NULL DEFAULT 'Default',
`Spouse` varchar(22) NOT NULL DEFAULT 'None',
`Money` int(10) NOT NULL DEFAULT '0',
`CP` int(10) NOT NULL DEFAULT '0',
`JumpSpeed` int(5) NOT NULL DEFAULT '800',
`AttackSpeed` int(5) NOT NULL DEFAULT '500',
`LootSpeed` int(5) NOT NULL DEFAULT '500',
`ActionSpeed` int(5) NOT NULL DEFAULT '500',
`Username` varchar(22) DEFAULT NULL,
`Password` varchar(22) DEFAULT NULL,
PRIMARY KEY (`UID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
[Msg] Finished - Unsuccessfully
--------------------------------------------------
01/21/2011 22:12 warning3#788
Thats the error Warlax.
01/21/2011 23:36 pro4never#789
You are making a database first to execute it into, right?
01/21/2011 23:42 warning3#790
Quote:
Originally Posted by pro4never View Post
You are making a database first to execute it into, right?
Ofcourse.
01/22/2011 00:22 OELABOELA#791
Quote:
Originally Posted by warning3 View Post
Ofcourse.
If you have xampp, you just make a latin1_bin database, and then you import your file. Try that, it works 120%
01/22/2011 00:54 warning3#792
Quote:
Originally Posted by OELABOELA View Post
If you have xampp, you just make a latin1_bin database, and then you import your file. Try that, it works 120%
Do you have teamviewer?
01/22/2011 02:07 OELABOELA#793
Quote:
Originally Posted by warning3 View Post
Do you have teamviewer?
Yea, pm me your msn, yahoo and ill help ya.
01/22/2011 03:06 Warlax#794
yea ur mysql hasnt been built to understand innodb from the looks of things
01/22/2011 03:15 warning3#795
Quote:
Originally Posted by Warlax View Post
yea ur mysql hasnt been built to understand innodb from the looks of things
Lol im such a noob.


How do I make it understand it? :S