Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 12,885 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
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,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
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,377
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,377
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