Gamestudio Links
Zorro Links
Newest Posts
Zorro tutorial ideas?
by mistery. 09/19/26 17:09
Trades during a running bar
by Martin_HH. 09/18/26 12:45
Capital slider is not saving in Z12
by frutza. 09/17/26 13:36
Avoiding pop-up training parameter results
by Martin_HH. 09/16/26 21:31
What are you working on?
by rayp. 09/16/26 20:20
Future of ZorroHFT
by TipmyPip. 09/16/26 09:28
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (LoT), 1,886 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
mistery, lokkalyansamiti, rahulbuilds, speedx, liop
19236 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Damage depending on distance #366489
04/04/11 13:58
04/04/11 13:58
Joined: May 2009
Posts: 5,378
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,378
Caucasus
I tried to use "vec_dist" to make different damage from explosion.
Problem is that it works visa versa, I need to invert distance from "vec_dist"?
How to do that? Or may be there is another way which I don't see?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Damage depending on distance [Re: 3run] #366494
04/04/11 14:13
04/04/11 14:13
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Just make something like this:
if(vec_dist(my.x,you.x)>100&&vec_dist(my.x,you.x)<200)
{
blabla
}


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Damage depending on distance [Re: alibaba] #366497
04/04/11 15:05
04/04/11 15:05
Joined: Apr 2010
Posts: 172
W
wdlmaster Offline
Member
wdlmaster  Offline
Member
W

Joined: Apr 2010
Posts: 172
Code:
d = vec_dist (my.x,you.x);
my.health -= (1000 - d) * some_factor_to_control_the_strength * (d < 1000);


1000 is the maximum damage radius

Re: Damage depending on distance [Re: wdlmaster] #366504
04/04/11 16:58
04/04/11 16:58
Joined: May 2009
Posts: 5,378
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,378
Caucasus
Alibaba, thank you, but you didn't get me right laugh
I don't need to detect distance, I need to use it to decrease health.
wdlmaster, thank you, I'll give it a try, only one question:
* what number must be used for "some_factor_to_control_the_strength"?
Maximum damage radius for me is 500.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Damage depending on distance [Re: 3run] #366505
04/04/11 17:26
04/04/11 17:26
Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
xxxxxxx Offline
User
xxxxxxx  Offline
User

Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
Code:
d = vec_dist (my.x,you.x);
my.health -= (500 - clamp(d,0,500))/500 * some_factor_to_control_the_strength;


"some_factor_to_control_the_strength" is the damage, which you get in the center of the explosion with my code!
xxxxxxx

Last edited by xxxxxxx; 04/04/11 17:27.

Es ist immer wieder erstaunlich, dass Leute die riesen Scripte schreiben die einfachsten sachen nicht können zb. mich mit SIEBEN x zu schreiben! tongue
Re: Damage depending on distance [Re: xxxxxxx] #366521
04/04/11 19:08
04/04/11 19:08
Joined: May 2009
Posts: 5,378
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,378
Caucasus
OK, now it's clear for me, thank you.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1