Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Explode all mines?
Explode all mines?
2001-09-21, 5:17 PM #1
I need a way to run a command to automatically explode or destroy all mines that are currently set (not in inventory). Is anything like this possible?
2001-09-21, 5:24 PM #2
I don't know how to, but you can parse through the entire level, pick out the thing numbers that have the mine templates, store them in an array, then give it lethal damage, causeing it to explode, like when you shoot it with the conc or a raildet.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-09-21, 5:32 PM #3
Couldn't you just modify the mine cog so when it recieves a trigger they blow up?
2001-09-21, 8:24 PM #4
Aglar, I could, but I don't want to have to make a resource mod out of it...
2001-09-22, 11:32 AM #5
You could just modify the mine cog and throw it in the level gob.
2001-09-22, 11:54 AM #6
It doesn't work, the weapon cogs have to be in the resource folder to work.
2001-09-22, 12:17 PM #7
do a loop from 0 to GetThingCount(). For each one, check it's template to see if it's a mine, and if it is, DamageThing() it 1000.
Capitalization
Commas
Periods
Question Marks
Apostrophes
Confusable Words
Plague Words
2001-09-22, 2:01 PM #8
Excatly the way I was thinking lordvadar.

Code:
	for (i=0; i<GetThingCount(); i=i+1)
	{
	 if(GetThingTemplate(i) == mine)
	 {
	  if(GetThingParent(i) == player)  // remove this is you want all mines to explode , not just the players ones
	  {
	  DamageThing(i, 100);
	  }
	 }
	}
2001-09-22, 5:01 PM #9
Thanks guys [http://forums.massassi.net/html/smile.gif]
2001-09-22, 6:54 PM #10
In case if that doesn't work. (from my experience) use this.

Code:
for(x=0; x<GetSectorCount(); x=x+1)
{
   y = FirstThingInSector(x);


   while(y != -1)
   {
      if(GetThingTemplate(y) == mine_tpl) DamageThing(y, plenty);


      y = NextThingInSector(y);
   }
}


------------------
http://millennium.massassi.net/ - Millennium

↑ Up to the top!