Back to the Vavoom Forum Archives
Karnizero
Janis Legzdinsh
Crimson Wizard
script 255 OPEN { int var0; delay(const:8400); var0 = random(const:0, 1); if(var0 == 1) { Thing_Spawn(255, T_ETTIN, 128); } var0 = random(const:0, 1); if(var0 == 1) { Thing_Spawn(254, T_ETTIN, 0); } var0 = random(const:0, 1); if(var0 == 1) { Thing_Spawn(253, T_ETTIN, 0); } var0 = random(const:0, 1); if(var0 == 1) { Thing_Spawn(252, T_ETTIN, 0); } var0 = random(const:0, 1); if(var0 == 1) { Thing_Spawn(251, T_ETTIN, 0); } var0 = random(const:0, 1); if(var0 == 1) { Thing_Spawn(250, T_ETTIN, 128); } var0 = random(const:0, 1); if(var0 == 1) { Thing_Spawn(249, T_ETTIN, 128); } var0 = random(const:0, 1); if(var0 == 1) { Thing_Spawn(248, T_ETTIN, 128); } var0 = random(const:0, 1); if(var0 == 1) { Thing_Spawn(247, T_ETTIN, 96); } var0 = random(const:0, 1); if(var0 == 1) { Thing_Spawn(246, T_ETTIN, 128); } var0 = random(const:0, 1); if(var0 == 1) { Thing_Spawn(245, T_ETTIN, 0); } restart; }This script spawns random number of monsters at specified positions each 8400 tics (240 seconds). Then, if you are not against modding, you may modify progs correspondingly, so that new monsters spawn on same place where dead ones corpses lie. I think nighmare mode does this, though I never looked for this in code, so can't say anything specific. Also items respawn in deathmatch mode, so you can check that part also.
Karnizero
script 2 (int seconds, int monstId, int spotTag) { delay (35 * seconds); //The required delay: 35 Tics = 1 second Thing_Spawn (..., monstId, spotTag); //Dont remember this function syntax. Must check at WikiDoc. }This will ([u:oy4uribh]should[/u:oy4uribh], not tested) work fine, but we need to "duplicate" the Thing Action and all its parameters for the new Ettin we will spawn. Only that is needed for the procedure to work correctly, more than once. The bad point is that standing over the MapSpot object (the player or any other Object), will make the procedure not to work (at GzDoom, Thing_Spawn does not work if something is over the MapSpot). Any way to "duplicate" the Thing Action for the new object? Any question about the explanation? (mainly for my bad english <!-- s:P --><img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz" /><!-- s:P -->) And another last question: What console command "respawn" does? I set that to 1, but i dunno what it really does... Thanks and cya.
Firebrand
Crimson Wizard
Karnizero
script 2 (int seconds, int monstId, int spotTag) { int monsterTAG; monsterTAG = spotTag + 1; delay (35 * seconds); //Time until respawn Thing_Spawn (spotTag, monstId, 0, monsterTAG); //Spawn Thing. Angle = 0. SetThingSpecial (monsterTag, 226, 2, 0, seconds, monstID, spotTag); //This is "226:ACS_ExecuteAlways ()" }Thanks for sintax tips, [color=red:ds6tc2k8]Crimson Wizard[/color:ds6tc2k8], and yes, the most ACS Vavoom sintax is the same as GzDoom one. I cant tell the same for ZDoom, cause i have not used ZDoom since 2005 or 2006, but probably the same... I have attached a file, containing the sample wad with all this stuff working. I have already tested, and works fine. Also contains the .gwa file and a .bat file for faster running. Now we need to make the script to "erase" the dead body after some seconds, maybe with "Thing_Destroy()", but i am very lazy now. <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> Click [u:ds6tc2k8]here[/u:ds6tc2k8] to download sample map.
Crimson Wizard
Now we need to make the script to "erase" the dead body after some seconds, maybe with "Thing_Destroy()"Probably it will work.
Karnizero
script 2 (int seconds, int monstId, int spotTag) { int monsterTAG; monsterTAG = spotTag + 1; delay (35); //1 second before deleting corpse Thing_Remove (monsterTag); //Remove the corpse. No the special gibbed items delay (35 * seconds - 1); //Time until respawn. One second less. Thing_Spawn (spotTag, monstId, 0, monsterTAG); //Spawn Thing. Angle = 0. SetThingSpecial (monsterTag, 226, 2, 0, seconds, monstID, spotTag); //"226:ACS_ExecuteAlways ()" }The only limitations for all this stuff are: [color=red:2osm82hx]1.-[/color:2osm82hx] No item, monster or player should be over the Map Spot where monster will spawn, or Thing_Spawn() will not work. [color=red:2osm82hx]2.-[/color:2osm82hx] If a gibbed monster leaves items (for example, Centaurs leaves shield and sword), those items wont be deleted. But that is not a script limitation. That is a engine issue, also present at GzDoom and ZDoom (and probably any other engine/source). New version for Respawning testing map is now available, letting you all to test new script functionality. Also a small bug has been detected and fixed. Click [u:2osm82hx]here[/u:2osm82hx] to download [color=white:2osm82hx]version 1.1[/color:2osm82hx] - 2 Kb -> .GWA file -> .WAD file -> .BAT easy launcher Any other tip or issue will be wellcome, and happy new year. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Crimson Wizard
if (! Thing_Spawn(...)) { delay(70); Thing_Spawn(...), or repeat same script from beginning }[quote="Karnizero":2ak6krn5][color=red:2ak6krn5]2.-[/color:2ak6krn5] If a gibbed monster leaves items (for example, Centaurs leaves shield and sword), those items wont be deleted. That's because these are separate objects, not connected to main body anymore. BTW - that looks like a reason for a suggestion to engine Author: maybe these items should be linked somehow to corpse and be removed with it also.
Janis Legzdinsh
while (!Thing_Spawn(...)) { delay(70); }
That's because these are separate objects, not connected to main body anymore. BTW - that looks like a reason for a suggestion to engine Author: maybe these items should be linked somehow to corpse and be removed with it also.They are added to the list of dead bodies and will be removed automatically when certain amount of dead bodies are on the level.