PDA

View Full Version : Quick and easy suggestion..


aportner
02-06-2002, 06:53 PM
The #size command seems to have some adverse effects on combat. Basically, you have to be right underneath the monster if the size is too big. My suggestion is to just multiply the monster's size through the distance formula, probably inside the square root or something. I haven't had time to toy around with it, but it's a simple fix that'd save some trouble.

Trumpcard
02-07-2002, 12:26 AM
Ive noticed and wondered about that myself.. There must be a good way to determine how far from the mob you can be and still attack. Using a formula based off size makes sense, but how is that handled in the code? I havent looked thought the code alot for anything related to something like a 'combat radius'.

aportner
02-07-2002, 03:33 AM
float Mob::DistNoRootNoZ(Mob* other)
{
return (other->x_pos-x_pos)*(other->x_pos-x_pos)+(other->y_pos-y_pos)*(other->y_pos-y_pos);
}

There are two others, of course I'm looking at probably version 0.1.5 source. But you just have to include other->size, assuming we have that property. I should probably download the latest source and stop being lazy, especially because I have "developer" under my name and I haven't "developed" anything lately.

aportner
02-07-2002, 03:33 AM
They need to disable emoticons in code excerpts.

Drawde
02-07-2002, 03:56 AM
On the subject of size, the "size" value in npc_types doesn't seem to work, though the in-game #size command does. Is it possible to fix this (since the opcode or whatever for size is presumably known)?

aportner
02-07-2002, 11:18 AM
We should probably stick an "int8 size;" in the Mob class's public variables and "int8 GetSize() { return size; }" and "void SetSize(int8 newsize) { size = newsize; }" in private.

In client.cpp, we should then target.SetSize(newsize) after the "#size" command is called and store the information. That way the size information could be taken into account in the distance formula. The problem is that when clients sign in, I'm not sure if the server sends the user the packet telling him or her the size of spawns, so you could create a size 100 monster, zone in and out, and the monster would probably look normal sized. I'm not sure if this is how it works, but it's just an educated guess. So I think when the user signs it, their .size should be set to 0. It should then go through all the mobs in the zone, and when it encounters a mob with a size > 0 it tells the client. That's how I'd do it. Unless I'm wrong about the whole thing.