The Dink Network

&story

February 21st 2005, 11:17 AM
milder.gif
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?

February 21st 2005, 11:26 AM
custom_fish.png
SabreTrout
Noble He/Him United Kingdom
Tigertigertiger. 
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.
February 21st 2005, 11:45 AM
milder.gif
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.
February 21st 2005, 04:16 PM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
&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.
February 21st 2005, 04:22 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
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)
February 21st 2005, 04:51 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
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
February 21st 2005, 05:03 PM
wizardb.gif
merlin
Peasant He/Him
 
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.
February 21st 2005, 05:06 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
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.
February 21st 2005, 05:26 PM
wizardb.gif
merlin
Peasant He/Him
 
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.
February 21st 2005, 10:51 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
Whoops, I forgot to subtract one, my bad.

Edit: and I posted my reply to magicman's, and didn't know about your correct one.