&story
How far can I go with &story in the scripts.
I am now on 1/4 of my dmod and I am already at &story == 35. Is there a limit?
I am now on 1/4 of my dmod and I am already at &story == 35. Is there a limit?
Not as far as I'm aware, no. But I shouldn't imagine you'll run into any problems anyway... it's a long way before you get to 100.
I have already made it really difficult for myself. SOmetimes I forget the <, > or = and then everything goes wrong.
But now I am writing everything down so nothing will go wrong. Because I have already so many scripts that everything is hard to find already. Because I could make a mistake in one of the scripts that could be cause a lot of troubles.
SInce yesterday I installed next our computer a closet with everything that becomes handy in it.
Paper, pencils, diskettes for the a: drive, cd's for backups etc. everything that is handy.
And we also bought a good chair for us to sit on. With nice and shiny silver colored wheels under it.
But let stay this to the title of this topic. Now I know there is no limit for the &story I am gonna make a lot of scripts.
But now I am writing everything down so nothing will go wrong. Because I have already so many scripts that everything is hard to find already. Because I could make a mistake in one of the scripts that could be cause a lot of troubles.
SInce yesterday I installed next our computer a closet with everything that becomes handy in it.
Paper, pencils, diskettes for the a: drive, cd's for backups etc. everything that is handy.
And we also bought a good chair for us to sit on. With nice and shiny silver colored wheels under it.
But let stay this to the title of this topic. Now I know there is no limit for the &story I am gonna make a lot of scripts.
&story is an integer variable - so there is bound to be an upper limit. Can't remember what it is... but Redink or Paul will know.
Letting & story get so high is a symptom of a 'hallway' story. You know, everything must be done in an exact sequence. Try having some events happen as subquests with other variables tracking them.
To keep track of scripts try having the first letter represent the area they are used in, or like the original Dink, start the script name with the value &story will be at when used. (eg. s7-warp.c)
To keep track of scripts try having the first letter represent the area they are used in, or like the original Dink, start the script name with the value &story will be at when used. (eg. s7-warp.c)
It's 2^32 afaik. And the minimum is -(2^32) +1
So in total, you can have 2^33 values! I'm sure your D-Mod won't need all of them
So in total, you can have 2^33 values! I'm sure your D-Mod won't need all of them
Nope, sorry magicman. Doesn't work like that.
Story is a signed variable so its range is between -2147483648 to 2147483647 because integers are represented using longs for the full 32 bits. The range is thus effectively -2^31 to 2^31 - 1.
Story is a signed variable so its range is between -2147483648 to 2147483647 because integers are represented using longs for the full 32 bits. The range is thus effectively -2^31 to 2^31 - 1.
Actually, the limit is 2^31 (or 2,147,483,648). I think you'll go insane before getting the story limit up that high.
No it isn't. ANSI standard defines -2147483648 to 2147483647. I can't be bothered to look it up at this moment but I made a quick little C++ program to prove it:
#include <iostream>
#include <limits>
int main()
{
std::cout << "largest int == " << std::numeric_limits<int>::max() << "\n";
std::cout << "smallest int == " << std::numeric_limits<int>::min() << std::endl;
return 0;
}
Yields this:
raven@aida ~$ g++ limittest.cpp
raven@aida ~$ ./a.out
largest int == 2147483647
smallest int == -2147483648
I'll find it in the ANSI standard if you want.
#include <iostream>
#include <limits>
int main()
{
std::cout << "largest int == " << std::numeric_limits<int>::max() << "\n";
std::cout << "smallest int == " << std::numeric_limits<int>::min() << std::endl;
return 0;
}
Yields this:
raven@aida ~$ g++ limittest.cpp
raven@aida ~$ ./a.out
largest int == 2147483647
smallest int == -2147483648
I'll find it in the ANSI standard if you want.














