ID:159334
 
I just had the idea of a noobish damage calculation
for Grab and throw
any one have good ideas
Thrown.Damage(max(0, Thrown.mass * Thrown.acceleration + Thrown.velocity - (Thrown.Defense+Thrower.Strength)))

:o

Ask a vague question, get a vague answer. What do you mean by throw/hold? What stats are in the game?
In response to GhostAnime
Sorry but it really made good sense as concerned for Physiscs
but my stats are
Strenght , Defense
:-/
In response to Getenks
mob/verb/Attack(mob/M in get_step(src,src.dir))
var/dmg = strength - M.defense
if(dmg>0) M.health -= dmg


That's as simple as you can get.
In response to GhostAnime
Shouldn't it be Thrown.mass*Thrown.velocity? It will calculate force or thrown object, acceleration isn't really needed as when you release it, it has top speed, I think... Probably should have studied physics more
In response to Ripiz
Well, F = ma, and we know m and F (Thrown.mass and Thrower.strength, respectively), so we could calculate the acceleration from that.

Acceleration = velocity/time, and in this case I would think the time that it takes to throw the other person could remain constant (although more accurately the distance could remain constant and you could calculate how long the acceleration takes place over that distance, but it would be a lot of extra thinking on my part for the sake of explaining a system that doesn't look like it's going to be used).

But past that, I would think Thrown.mass*Thrown.velocity would be the correct way to calculate the damage (minus however you want to calculate defense).
In response to Spunky_Girl
A good Grab and Throw damage
not hit and kick
see mine is if damage > 50 then
walk(enemy,usr.dir,1)
In response to Getenks
Just change the name of the verb? >_>
mob/verb/Grab_Throw(mob/M in get_step(src,src.dir))
if(M && M.defense < strength) //if M exists and is not as strong as the grabber
var/dmg = strength
step(M,src.dir) //make it appear as it they were "thrown" away
M.dir = turn(M.dir,180) //make it so they don't turn when stepping
M.health -= dmg
M<<"You took [dmg] damage from [src] throwing you!"


Something like that?
In response to Spunky_Girl
Uhh
can we put somthing like the damages decide how far the oponent is thrown
my MSN :[email protected]
any1 willing to help me :-)
In response to Getenks
Of course you can. If you know how to make loops, it's pretty simple, too; I'm not sure if you even tried to do it yourself first. Maybe you're good enough for the language to do this or maybe you're not, but either way the forum surfers aren't your personal programmers to do everything for you, so you're going to have to learn to program yourself and think about designing things and how to write them.
In this case you can simply loop a given number of times (based on the damage) and each time move the mob once.
mob/verb/Supar_Throw(mob/M in get_step(src,src.dir))
//general fail-safe to ensure M still exists and our\
condition is still present

if(!(M in get_step(src,src.dir))) return
var/dmg = src.strength - M.defense / 2
var/steps = round(dmg / 10,1) //every 10 dmg pushes one step more
var/throw_dir = src.dir
for(var/i,i <= steps,i++)
//as Move() is called and the proc sleeps as well, \
M could get deleted between iterations, so account for that.

if(!M) break
var/destination = get_step(M,throw_dir)
//attempt to move M into destination (and keep its \
current dir value)

if(!M.Move(destination,M.dir))
//if the movement failed (ie was blocked), don't \
attempt to move the mob any more-stop the loop

break
sleep(1) //put a small delay between movements

Of course, there are multiple ways of writing a loop. The above one could be optimized to this:
   //loop steps times, stop if M was deleted or a movement was blocked
while(M && steps-- && M.Move(get_step(M,throw_dir),M.dir))
sleep(1)
In response to Kaioken
Kaioken wrote:
(...)the forum surfers aren't your personal programmers to do everything for you, so you're going to have to learn to program yourself and think about designing things and how to write them(...)
CODE


Why would he, since every keeps spoon-feeding him?
In response to Schnitzelnagler
Why, because I've said what you've quoted, perhaps? :P I posted commented code because I couldn't find a good way to explain it in more detail than "make a loop that moves the mob X times based on the amount of damage", so hopefully he'll learn from the code, as that's also another method of learning other than reading guides and tutorials. Do forgive me. :P As I've told him, he'll have to eventually learn to program on his own because people who go 'help vampire' won't be fed code examples (or even replies in drastic cases) forever.
In response to Kaioken
Kaioken wrote:
I posted commented code because

And here's the problem.
Too many people did that for him due to various reasons, asides that I'm by no means trying to sound offensive, but if you follow his postings, you will clearly see him ignoring each advice to work his way through the guide, because there is a way more comfortable way for him.


Kaioken wrote:
so hopefully he'll learn from the code, as that's also another method of learning other than reading guides and tutorials. Do forgive me. :P

Hehe, I'm not trying to attack you, so, there's nothing to forgive you, even if it was meant ironically ;)
Actually, I admire the time, effort and endurance you spend on helping people in these forums.
I know that this is a way to learn, yet it can easily lead to people unwilling to learn, which is the risk I tried to point at.


Kaioken wrote:
As I've told him, he'll have to eventually learn to program on his own because people who go 'help vampire' won't be fed code examples (or even replies in drastic cases) forever.

So, you wouldn't categorise about a hundred posts with easy questions in less than 20 days as "help vampire"?
In response to Schnitzelnagler
Hmm.If ya thought this was a personal help
Guess what -
Your Wrong I mean -X
My codin has way far similarities with what Kaiokin posted or anyone posted in these forums
.
Cause u just have to take care of 1 proc i gotta connect all

More over thnx for the idea but i found a better one myself
So dont even think That u spoon fed me even a bit..
Dantom 's guide is far better than anyone but i just wanted to clear some doubts thats all
-Simple
Please take these words as a kind information and not as an offence.
XD