Sign in to follow this  
Kolya Medz

(TSL) Help scripting make all enemies drop stuff

Recommended Posts

How do you make all or at least most enemies drop loot every time they die.  Is this even possible?  I figured out how to edit and compile the scripts but I'm not sure what to change or add

k_def_spawn01

PlaceCritterTreasure(OBJECT_SELF, Random(4)-2); 

not sure if this is the right line.. i want all the critters to have treasure

Thanks!

 

 

 

 

Share this post


Link to post
Share on other sites
4 hours ago, Kolya Medz said:

k_def_spawn01

PlaceCritterTreasure(OBJECT_SELF, Random(4)-2);

I believe that is correct. Random(4) can return any value from 0-4. If it returns 0, 1, or 2, the value passed to PlaceCritterTreasure() would be 0 or less after subtracting 2. This will prevent treasure drops since that is the quantity to be dropped (e.g. -2, -1, 0, 1 or 2 items).

So, whatever value is passed as a second argument (i.e. replacing the expression Random(4)-2) needs to evaluate to 1 or greater.

Note that drops are extremely random, and are partially based on your level. You may be better off with the cheat console.

Share this post


Link to post
Share on other sites

I love you.  Thank you for explaining that line. 

So random(1)+1 should "always" give loot since it only returns 1 or 2. 

Share this post


Link to post
Share on other sites

Correct. For enemies that have that script, you have a 100% chance of getting loot. I've never tested this, but this is what I read from the script code. You have a 50% chance of getting one or more items of a single type (returns 1, e.g. 1 or more med packs), and a 50% chance of getting one or more items of two (potentially different) types (returns 2, e.g. 1 or more med packs, and 1 or more blaster pistols).

To test this properly, you'll either:

1) Want to be on Telos or later. As far as I know, most of the enemies on Peragus and the Harbinger have the no-treasure script attached.

2) Modify the early enemies. But, that requires modifying every enemy's UTC file.

3) Modify the no-treasure script itself. But, that can be confusing if you aren't good at keeping track of your files.

Whichever option you choose is up to you.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this