Variable Help - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Variable Help (/thread-23295.html) |
Variable Help - saito100 - 09-20-2013 Ok, so this is my problem. I'm wondering how I could randomly generate an amount of numbers while staying in a limit for the total of all of them. So say I have four variables. (2, 5, 2, 3 (This is what I would like it to look like.)) And they all are randomly generated and they can't go above a certain condition but they have to meet it. (Being 12 for this case.) My question is firstly how would you fairly generate these numbers without certain variables being oped in a sense. As in when its generating the first one it could for all we know make it nine and then there's only a total of 3 more you can add before the condition is reached. The first variable would be oped to the other ones which I do not want. I still want it to be random but make it so that they're spread out somewhat. Because if it generated the numbers in order then each variable after another would become smaller and smaller before some would have to be zero in some cases. Then what else i'm wondering is how would you make it so when they are generated they DO reach the goal. Not just stay under it but reach it. Sorry if i'm making this sound confusing but i'm very tired atm. But if anyone has any idea please leave a reply saying what you think I could do. Thank you! RE: Variable Help - Your Computer - 09-20-2013 http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#general |