Well lets start by defining exactly what you want random. Do You Want?
Random Type of Kit
Random Spawn Position, and Rotation
or
Both.
And now we look at what we all know is possible with bf1942 engine, serverside or not.
Random Weapons for kits, this can be seen put to good use in Forgotten hope.
Random Spawn Points (Spawn Points on the Same Spawn Group that have Randomized Locations)
There might be, and probably is more. But those are two that i know can be done.
Since kits are not attached to a spawn group, but rather a spawn template, the random spawn by Group Number seems impossible. Unless the Spawn Group code can work for kits, but i dont believe it will.
Random Kits for weapons, are done by putting multiple weapons coding into the same objects.con, and naming them as one. The computer doesnt know which gun you want, and randomly chooses one for you. This cannot Be applied to kits thus i dont believe it will work.
Now, There is the Kit Type code in the init.cons of levels that interest me on this subject. As you See in them that they have this type of code:
game.setkit 1 0 German_Scout.
The 1 Represents What team, as the 0 represents the Kits Number. Could this inturn be applied to a Spawn Template to produce a randomized type of Spawn? like this:
ObjectTemplate.create ShermanSpawner ObjectTemplate.setObjectTemplate 2 0 Sherman ObjectTemplate.setObjectTemplate 2 1 T-34/85
I have not personally tried this, but if it does work it might result in a Randomized spawn, where it spawns a different object each time.
Now There is Also Code in the BF1942.exe you can read using the Text Scan, that Says This, but im assuming it was part of an underbrush creator that never got finished:
EnableRandScale EnableRandRotation EnableRandPosition EnableRandOffset EnableRandTilt EnableRandColor
randScaleHeight randScaleWidth randPosVariance randOffset randColorMin randColorMax randAllObjectsOfTemplate <-- Most interesting
I do not know if these codes along with
ObjectTemplate Though in the Scan they are Under ObjectTemplate: 8464100,Char,15,ObjectTemplate: 8464116,Char,32, not found. object.create fails! 8464172,Char,23,world::IObjectTemplate* 8464196,Char,15,world::IObject* 8464220,Char,21,listObjectsOfTemplate 8464252,Char,11,Objects.con 8464272,Char,17,setObjectToGround 8464292,Char,12,getGroundPos 8464308,Char,15,defaultSaveFile 8464324,Char,29,const world::IObjectTemplate* 8464384,Char,19,ObjectTemplates.con 8464412,Char,20,saveAllUsedTemplates 8464436,Char,16,deleteAllObjects 8464456,Char,11,listObjects 8464468,Char,23,getActiveObjectTemplate 8464492,Char,15,getActiveObject 8464508,Char,16,saveAllTemplates 8464528,Char,14,saveAllObjects 8464544,Char,15,saveAllSpawners 8464560,Char,12,saveSpawners 8464576,Char,26,saveAllTemplatesAndObjects 8464604,Char,14,loadAllObjects 8464620,Char,26,loadAllTemplatesAndObjects 8464648,Char,15,listAllVehicles 8464664,Char,18,updateAllTemplates 8464684,Char,13,listTemplates 8464700,Char,15,setActiveObject 8464716,Char,23,setActiveObjectTemplate 8464740,Char,24,moveActiveObjectToCamera 8464768,Char,24,moveCameraToActiveObject 8464796,Char,14,deleteTemplate 8464812,Char,14,updateTemplate 8464828,Char,12,deleteObject 8464844,Char,27,printTemplateCreationScript 8464872,Char,25,printObjectCreationScript 8464900,Char,19,quickReloadTemplate 8464920,Char,25,quickReloadActiveTemplate 8464948,Char,18,saveTemplateToFile 8464968,Char,14,saveAllEffects 8464984,Char,19,saveFolderToArchive 8465004,Char,12,saveVehicles 8465020,Char,10,listMeshes 8465032,Char,12,listTextures 8465048,Char,15,deleteAllLayers 8465064,Char,14,getActiveLayer 8465080,Char,16,getActiveLayerId 8465100,Char,10,listLayers 8465112,Char,14,setActiveLayer 8465128,Char,16,setActiveLayerId 8465148,Char,11,removeLayer 8465184,Char,11,renameLayer 8465196,Char,14,createNewLayer 8465212,Char,15,ShowEntryPoints 8465228,Char,11,fixToGround 8465240,Char,17,fixToGroundHeight 8465260,Char,10,isStrafing 8465280,Char,18,enableChildEditing 8465300,Char,19,disableChildEditing 8465320,Char,11,setStrafing 8465332,Char,22,setForceCameraToGround 8465356,Char,15,setCameraHeight 8465372,Char,23,showObjectEditorObjects 8465408,Char,18,setRotatingAxisYPR 8465428,Char,18,setPositionAxisDUR 8465448,Char,18,getRotatingAxisYPR 8465468,Char,18,getPositionAxisDUR 8465488,Char,17,ObjectEditorState 8465532,Char,17,setCameraPosition 8465552,Char,14,moveAllObjects 8465568,Char,15,enableRandScale 8465584,Char,18,enableRandRotation 8465604,Char,18,enableRandPosition 8465624,Char,16,enableRandOffset 8465644,Char,14,enableRandTilt 8465660,Char,15,enableRandColor 8465676,Char,15,randScaleHeight 8465692,Char,14,randScaleWidth 8465708,Char,15,randPosVariance 8465736,Char,10,randOffset 8465748,Char,12,randColorMin 8465764,Char,12,randColorMax 8465780,Char,24,randAllObjectsOfTemplate Another Way to Simulate this, would be to create Multiple Spawners With the Same object, your kit, and make them spawn at different times, One in 10 Seconds, the Other in 60, another in 15 minutes. And timing them just right so that when one spawns, there are no others on the map, by editing the TimeToLive commands.
Try some of these. I will try some myself, in hopes of finding an answer.
|