PDA

View Full Version : Distance



Resiliant
04-25-2003, 06:30 PM
CMB,

I tried doing this, and got it ALL screwed up because I'm not clear on how you populate the listbox at the end. What I'm trying to do is to add a column to the table for 'Dist' which is simply the spawns x,y,z distance from to the player.

All you have to do is compute the Spawn Distance (sd) as:

sd = Math.sqrt(
(si.X - mapPane1.map.playerinfo.X* (si.X - mapPane1.map.playerinfo.X) +

(si.Y - mapPane1.map.playerinfo.Y) * (si.Y - mapPane1.map.playerinfo.Y) +

(si.Z - mapPane1.map.playerinfo.Z) * (si.Z - mapPane1.map.playerinfo.Z)) ;

and then format it as:

item1.SubItems.Add(sd.ToString("#.0");

I did this, but it simply didnt seem to put it in the table.... vewwy strange..

I guess this ends up as a request ;)

R

cavemanbob
04-26-2003, 10:35 PM
You've got to add another header to the listbox or it'll be hidden. I'll add this in though.

seqmage
04-27-2003, 02:15 AM
Originally posted by cavemanbob
You've got to add another header to the listbox or it'll be hidden. I'll add this in though.

How but an seperate box which shows experiance?
Regular and AA?
How much mana, food, ect.. stats? but mostly experiance?

cavemanbob
04-27-2003, 12:11 PM
Yes all of those could be done, but I'm not doing them right now, first priority is getting the bits that are already in working properly before I add a bunch of new bugs. If someone else wants to give it a shot feel free, it'd be a lot of coding but not really all that hard.