newbiemodder Posted January 26, 2010 Share Posted January 26, 2010 I have multiple placeables in one room all with the same generic tag. How can I destroy all of them at the same time w/o going back and making new individual tags and changing the .git file? For TSL Link to comment Share on other sites More sharing options...
VarsityPuppet Posted January 26, 2010 Share Posted January 26, 2010 My scripting syntax isn't great, but the general framework of the while function should do some good. void main(){ int int1 = 0; object DestroyMe = GetObjectByTag("itemtag", int1); while ( DestroyMe != OBJECT_INVALID){ DestroyObject(DestroyMe); (int1++); DestroyMe = GetObjectByTag("itemtag", in1); }} Link to comment Share on other sites More sharing options...
newbiemodder Posted January 26, 2010 Author Share Posted January 26, 2010 thanks vp, i'll give it a try Link to comment Share on other sites More sharing options...
DarthStoney Posted January 26, 2010 Share Posted January 26, 2010 Here's another way plus you add more npc's to destroy if you like Just add a new sub1 line with a differant tag. void sub1(string stringParam1) { int int1 = 0; object object1 = GetObjectByTag(stringParam1, int1); while (GetIsObjectValid(object1)) { DestroyObject(object1, 0.0, 0, 0.0, 0); object1 = GetObjectByTag(stringParam1, (int1++)); } } void main() { sub1("[color="Red"]itemtag[/color]"); } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.