Aller au contenu

Photo

Spring Cleaning


  • Veuillez vous connecter pour répondre
9 réponses à ce sujet

#1
One Thousand Talons Mao Ra

One Thousand Talons Mao Ra
  • Members
  • 40 messages
My mod is in need of a little clean up. What is the default tag for the loot bags dropped when something is killed? This is suprisingly difficult for a bad scripter like myself to find. :whistle:

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
I think it is "bodybag"

#3
kalbaern

kalbaern
  • Members
  • 824 messages
It's "BodyBag", not sure if case sensitive will matter, but that is the actual tag.

#4
One Thousand Talons Mao Ra

One Thousand Talons Mao Ra
  • Members
  • 40 messages
Yep, cases matter. Thank you!

#5
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Trick:

When not knowing how to find some of this stuff. Like the Tag or even ResRef for the body bag.

Try saving your game. Renaming your saved game to xxx.mod instead of xxx.sav and open it in the toolset to look for your answers.



This is even a good way to find local vars that are on an NPC.

#6
One Thousand Talons Mao Ra

One Thousand Talons Mao Ra
  • Members
  • 40 messages
Wow! That could be ridiculously handy!

#7
One Thousand Talons Mao Ra

One Thousand Talons Mao Ra
  • Members
  • 40 messages
:whistle: Uhm, so I have no problem with making a loop for destroying all BodyBags but that leaves the contents still laying there. How would you guys/gals destroy the bag AND everything in it? Because the items change.

#8
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
You would need to have a loop within the loop. The "outer" loop goes through and finds the bags (like you have). The "inner" loop would then go through and destroy the contents of the bag before destroying the bag itself and moving on to the next bag (in the outer loop).

Example (part pseudo-code):

object oBag = Your First BodyBag;
while(GetIsObjectValid(oBag)) // Outer Loop - Find a Bag
   {
   object oInv = GetFirstItemInInventory(oBag);
   while(GetIsObjectValid(oInv)) // Inner Loop - Destroy Bag's Inventory
      {
      DestroyObject(oInv, 0.0, FALSE);
      oInv = GetNextItemInInventory(oBag);
      } // End Inner Loop

   if(oInv == OBJECT_INVALID) // If all inventory has been destroyed destroy Bag itself
      {
      DestroyObject(oBag, 0.0, FALSE);
      }

   oBag = Your Next BodyBag;
   } // End Outer Loop

Modifié par _Knightmare_, 21 novembre 2010 - 02:03 .


#9
One Thousand Talons Mao Ra

One Thousand Talons Mao Ra
  • Members
  • 40 messages
Sweeeeet. :D I used.....
---
object oCenter = GetObjectByTag("ArenaCenter");
object oLoot;
int iLootbags = 1;
while (iLootbags <= 15)
   {
   oLoot = GetNearestObjectByTag("BodyBag", oCenter, iLootbags);
   object oInv = GetFirstItemInInventory(oLoot);
   while(GetIsObjectValid(oInv))
      {
      DestroyObject(oInv);
      oInv = GetNextItemInInventory(oLoot);
      }
   DestroyObject(oLoot);
        iLootbags++;
   }
---
Works great. So can you use switches inside of switches, too?

#10
_Knightmare_

_Knightmare_
  • Members
  • 643 messages

One Thousand Talons Mao Ra wrote...

So can you use switches inside of switches, too?


Yes you can. Image IPB

You can keep "stacking/layering" them as long as you can keep what you are doing straight and not confuse your self lol. You can have a switch inside a switch inside a loop inside a loop inside a switch, etc. In theory this can be unlimited layers, but if you get too complicated, the game may throw a TMI error.

Modifié par _Knightmare_, 26 novembre 2010 - 12:54 .