Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,251 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

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

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

Joined: May 2009
Posts: 5,370
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 | chip programmers | 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