ID:149641
 
Sorry to be greedy :D

Q1. How would i go about when youre shooting at another player there is a different probability that they will be hit depending on what gun youre using, and how far the player is away from you or if they are behind an object (eg a hedge)?

Q2. The missle library was quite complicated and didnt go too well with my game, is there a simpler one, for just 1 gun somebody could hook me up with please?

Q3. How do i make either players walk slower or only make them able to move by clicking (id prefer this one) but so when u click they move slower and u actually see them walk

thats all, thanks for any help
The first problem will probably take the most effort. You'll have to use a combination of get_dist(), a variable for the gun, and then a variable for cover that the player is under.

The specifics really depend on what you think is most important and how you want combat to work.

One way you could handle this is to start with the weapons accuracy var and the players skill, then decrease it based upon the distance and cover.

probability = round(probability * (get_dist(target,src)+1) / max_range) //max_range is weapons max range

That would decrease the hit probability based upon distance.


As for the second problem you can just use the missile proc. You simply supply the icon, the target, and the src.


I'd suggest using Deadron's EventLoop library or one of the various other libraries that handle movement of this type quite nicely.
Chibbi wrote:
Q1. How would i go about when youre shooting at another player there is a different probability that they will be hit depending on what gun youre using, and how far the player is away from you or if they are behind an object (eg a hedge)?

This is probably best handled as separate problems. Each weapon could have a different probability of hitting its target, a range (or a range modifier for that probability), and a chance of blasting through certain objects.

The second part of the problem is to "walk" your projectile or beam through the turfs it would have to cross to get to the player. You'd have to use a line-drawing algorithm to do this. Anywhere an object/turf was found that could block the shot, you'd apply your test to see if the shot would manage to make it through--and if it would be slowed or its hit probability altered by that collision (like, say, direction changing a bit after it hits a shrub).

Lummox JR
Chibbi wrote:

Q3. How do i make either players walk slower or only make them able to move by clicking (id prefer this one) but so when u click they move slower and u actually see them walk

I have a fairly intuitive system for clicking-and-walking that I'm still trying to perfect... when it's done, I'll release it. In the meanwhile, try this:
atom
Click()
..()
walk_to(usr,src,src.density)
client
NORTH()
SOUTH()
EAST()
WEST()
NORTHEAST()
SOUTHEAST()
NORTHWEST()
SOUTHWEST()


-Lord of Water