atom/var/const/INF = 99**99
/*
Code File.dm:1:error:= :constant initializer required
*/
Problem description:
What's a constant initializer? I tryed to make a veriable to equal Inf (or at least close to it) but it asks me for a constant initializer.
ID:145321
Apr 17 2006, 5:46 am
|
|
Code:
atom/var/const/INF = 99**99 Problem description: What's a constant initializer? I tryed to make a veriable to equal Inf (or at least close to it) but it asks me for a constant initializer. |
In response to CaptFalcon33035
|
|
We tryed something like 999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999 but we didn't get the result we wanted. ("we" as in X and I)
|
In response to KirbyRules
|
|
KirbyRules wrote:
We tryed something like 999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999 but we didn't get the result we wanted. ("we" as in X and I) Why do you two want to have a variable of infinite any way? Any who, an idea I do have. Maybe create your own datum of inf short for infinate. It would be an object of infinite value, kinda like how null is of a value of nothing. |
In response to Green Lime
|
|
Green Lime wrote:
Why do you two want to have a variable of infinite any way? We don't wanna go through the hassle of changing all the attack procs and things like that. All we have to do is make their HP inf! Any who, an idea I do have. Maybe create your own datum of inf short for infinate. It would be an object of infinite value, kinda like how null is of a value of nothing. I'm not sure I know what you mean... |
In response to KirbyRules
|
|
If all NPCs are defined under a certain path, you'll be off much quicker and lot less messyer if you'd check what mob they're attacking.
|
In response to KirbyRules
|
|
KirbyRules wrote:
Green Lime wrote: So your going for the imortality, You could assign a mob an extra variable of imortal. If that variable is true then the person can't be killed. You could use object inheatence for procs, sorry but I am not to sure how you set up you combat system, but if you have many attack() procs. Then you could just create a parrent attack() proc defined under mob. Then again if you did that you would have to get ride of the "proc"/attack() when defining your procedures, cause they would just be child of the parrents. Please provide more infomation on your combat system if you wish for futher help. Any who, an idea I do have. Maybe create your own datum of inf short for infinate. It would be an object of infinite value, kinda like how null is of a value of nothing. |
Xkirby2 wrote:
Code: atom/var/const/INF = 99**99 Problem description: DM doesn't know that it can handle 99**99 at compile-time, so it assumes you're trying to do a calculation that has to be done at runtime. Of course, a much easier way to get infinity is 1e100 (which is 1×10100 in scientific notation; a google), since regular floating point only goes up to a certain power, and past that it'll just give up and call the number infinite. Lummox JR |
Just use something like 9999999999999999999999.