On Hit: Unique Power and Removing Random Loot Drops
nwfan87
Member Posts: 99
It's been a while since I posted!
Two script related questions:
On Hit: Unique Power
How to script it (As an example: a sword that turns the target when hit, into a chicken), where the script needs to go (on item Activate or tag based system). Links to good tutorials welcome.
I've tried it before using the OnItemActivate scripting system, since I've never been able to get the tag based system to work properly, so I'm only using the old system of having one script with tag based checks, therefore some solution that would work with that would be very helpful!
Removing Random Loot Drops
Any good advice on how to remove random loot drops from creatures? What I mean by this, is a script or some measure that will ensure that no loot is dropped when the creatures dies at all.
Thanks everyone and hope you had a good summer
Two script related questions:
On Hit: Unique Power
How to script it (As an example: a sword that turns the target when hit, into a chicken), where the script needs to go (on item Activate or tag based system). Links to good tutorials welcome.
I've tried it before using the OnItemActivate scripting system, since I've never been able to get the tag based system to work properly, so I'm only using the old system of having one script with tag based checks, therefore some solution that would work with that would be very helpful!
Removing Random Loot Drops
Any good advice on how to remove random loot drops from creatures? What I mean by this, is a script or some measure that will ensure that no loot is dropped when the creatures dies at all.
Thanks everyone and hope you had a good summer
0
Comments
I make sure the script name matches the Tag and Blueprint name of the item.
so Script name would be sword1 Tag of the item would be sword1 and blueprint of the item would be sword1. thought I am not 100% sure if it goes off tag or blueprint, I just make them all the same regardless to make it work. Easily testable though.
Not sure why, but zs_nw_c9_default is another variation of the same script I seem to have used.
TR
The nw_c2_default9 script is the OnSpawn script. And the 'Leaves Lootable Corpse' just changes it so that you take the loot out of the dead creature body instead of a remains container.
I'm not sure either, I've tried tag but that does not seem to work, not tried resref yet. I'm quite comfortable using the old tag based checks though, unless there are complex requirements.
Edit: Also found that the On Hit : Cast Spell Unique Power is dealt with via X2_S3_OnHitCast. It can just be edited or I found this thread here for more complex items
@ForSerious
You mean:
?
Did some desperate reading yesterday and thought this might be the cause, so I just that whole line. Also can create a duplicate verison for specific creatures. Never heard of zs_nw_c9_default, and can't find it in the default script resources, but shouldn't be a problem I suppose.
I think you are right about the advanced options. The random loot appears to be more fundamental and is dealt with by scripting.
The end result I'm hoping is that there is no random loot at all and therefore, no remains container.
@TarotRedhand
My thoughts were that Leaves Lootable Corpse just acts in a similar way as
With the exception that the coded version is more powerful, as the corpse will never decay, unless you script something else.
In other words, the 'leaves lootable corpse' checkbox leaves the creature model as a loot object for the set amount of time shown in 'corpse decay time', after which, the corpse fades away, replaced with whatever treasure model you have selected.
None of those options though deal with whether random loot is dropped or not.
There is another script that's put in there on some creatures, but it calls that script.
Immediately after that module switch there should be a chunk that looks like this: If that's all commented out, you shouldn't have to worry about any script prefixes and you can just get to testing a tag based script for an item.
One easy way to do it: Just make a dagger and give it a unique tag, "test_tag_dagger" or whatever. Give it the item properties "On Hit Cast Spell: Unique Power (On Hit)" and "Cast Spell: Unique Power Self Only (set to unlimited uses per day for testing)".
Now make the following script and give it the exact name as the tag you made for the dagger above (ie "test_tag_dagger"):
If all is working as it should, you can pick up the dagger and use the unique power to see if you get the "OnActivate Fired Properly" message. Then go around hitting stuff (stuff has to be able to take damage) with the dagger and on successful hits you should be seeing the "OnHit Fired Properly" message. Hope it helps. Good luck.
That is very helpful thankyou! I'll have to try this at some future date.
An alternative to creating copies would be to edit the default onspawn script to either delete default items or make them undroppable before adding any droppable loot to the monster's inventory. Personally, I prefer to create loot drop items ondeath instead of onspawn, as it prevents the enemy from using a one-shot item like a potion which you intended to give to the player as a reward.
Variable name: X2_L_NOTREASURE
Description: Setting this variable to TRUE on the module will disable the call to the random loot generation in most creatures' OnSpawn script.