Does anybody have a real *simple* loot_object script? Maybe something that works on a D6 or D8 conditional. (Player breaks object and 1of6 items appears.)
object_smash_loot
Débuté par
Alupinu
, déc. 13 2010 12:46
#1
Posté 13 décembre 2010 - 12:46
#2
Posté 13 décembre 2010 - 11:48
Here's a quick OnDeath script off the top of my head. Replace resref1, resref2, etc with actual item resrefs.
--
void main()
{
int iRandom = Random(6);
string sItem;
switch(iRandom)
{
case 0:
sItem = "resref1";
break;
case 1:
sItem = "resref2";
break;
case 2:
sItem = "resref3";
break;
case 3:
sItem = "resref4";
break;
case 4:
sItem = "resref5";
break;
case 5:
sItem = "resref6";
break;
}
CreateItemOnObject(sItem,OBJECT_SELF,1,"",0);
}
--
void main()
{
int iRandom = Random(6);
string sItem;
switch(iRandom)
{
case 0:
sItem = "resref1";
break;
case 1:
sItem = "resref2";
break;
case 2:
sItem = "resref3";
break;
case 3:
sItem = "resref4";
break;
case 4:
sItem = "resref5";
break;
case 5:
sItem = "resref6";
break;
}
CreateItemOnObject(sItem,OBJECT_SELF,1,"",0);
}
Modifié par DannJ, 13 décembre 2010 - 11:49 .
#3
Posté 14 décembre 2010 - 03:11
Cool... Thank you DannJ I think this is just what I was looking for, nice and simple.
#4
Posté 14 décembre 2010 - 09:51
On second thoughts, that might only work for placeables that have inventories.
Instead of CreateItemOnObject, you might want to replace it with:
location lLoc = GetLocation(OBJECT_SELF);
CreateObject(OBJECT_TYPE_ITEM, sItem, lLoc, FALSE);
That's what happens when you code off the top of your head, and don't test it.
Instead of CreateItemOnObject, you might want to replace it with:
location lLoc = GetLocation(OBJECT_SELF);
CreateObject(OBJECT_TYPE_ITEM, sItem, lLoc, FALSE);
That's what happens when you code off the top of your head, and don't test it.
Modifié par DannJ, 14 décembre 2010 - 09:51 .
#5
Posté 15 décembre 2010 - 01:01
Well if I could vote I would give you a 10, DannJ! After your last update the script works perfectly. Thanks again!





Retour en haut






