ID:266203
 
is there a command to set var/Health to infinite?
Air _King wrote:
is there a command to set var/Health to infinite?

1.#INF
Infinity, not being a number, is impossible to represent in computer terms.

The easiest solution, is just to set it to a ludicrously high number, like 100 billion. The better solution is to make it so no damage can be done to people who's health is supposed to be infinite.

-AbyssDragon
In response to Nadrew
Nadrew wrote:
Air _King wrote:
is there a command to set var/Health to infinite?

1.#INF

Thanks!
In response to AbyssDragon
AbyssDragon wrote:
Infinity, not being a number, is impossible to represent in computer terms.

The easiest solution, is just to set it to a ludicrously high number, like 100 billion. The better solution is to make it so no damage can be done to people who's health is supposed to be infinite.

-AbyssDragon
what about:
1.#INF
it works!!!
In response to Air _King
I think 1.#INF actually just represents the "really really really large number that your computer won't bother to increase", something like 100000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000

You know... But then it doesn't really matter either.
In response to Foomer
Foomer wrote:
I think 1.#INF actually just represents the "really really really large number that your computer won't bother to increase", something like 100000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000

You know... But then it doesn't really matter either.

Ok, but since its so big it wont let me run!!!
In response to Air _King
I can't find any reference for that.

It also won't compile for me, so..

-AbyssDragon
In response to AbyssDragon
AbyssDragon wrote:
I can't find any reference for that.

It also won't compile for me, so..

-AbyssDragon

How would yu do 9 to the tenth power?
In response to Air _King

How would yu do 9 to the tenth power?

9**10
In response to Theodis
Theodis wrote:
How would yu do 9 to the tenth power?

9**10

or i discovered 9^10
In response to AbyssDragon
AbyssDragon wrote:
Infinity, not being a number, is impossible to represent in computer terms.

The easiest solution, is just to set it to a ludicrously high number, like 100 billion. The better solution is to make it so no damage can be done to people who's health is supposed to be infinite.

-AbyssDragon

I dunno if it changed but back in the days when Cityworkz was around I found an exploit. You could give people negative money. But anyway afer giving enough negative money my money stat changed to Infinite. So I guess at a certain value a number just becomes infinite.
In response to Air _King
Air _King wrote:
Theodis wrote:
How would yu do 9 to the tenth power?

9**10

or i discovered 9^10

That will compile but the ^ operator is the exclusive or operator not the exponent one.
In response to Air _King
Air _King wrote:
Theodis wrote:
How would yu do 9 to the tenth power?

9**10

or i discovered 9^10

^ is for exponentiation in some languages but not in others. In DM, only ** works for this, since ^ is for the bitwise XOR.

Curious why you'd want 3,486,784,401 as a number in there, though. Sounded to me more like you wanted 109 (10**9 in DM), which is a billion (1,000,000,000).

Lummox JR
Air _King wrote:
is there a command to set var/Health to infinite?

I don't know to what extent DM supports special number values like infinity. Usually my solution is to use a negative number to indicate infinity, in cases where the number is meant to always be positive anyway.

For example:
  proc/Damage(amount as num)
    if(Health<0) return  // do no damage, infinite health
    Health=max(Health-amount,0)
    if(!Health) Die()    // call the death proc, whatever it does

  Stat()
    // other code here just like usual
    stat("Health",(Health>=0)?Health:"Infinite")

Lummox JR
In response to Foomer
Holy Crap thats alot of 0s i wish i got a check for that. IS that bill gates salary?