Sign in to follow this  
JulieLakaye

Holowan Duplisaber FIX / Script to remove *one* item from a stack?

Recommended Posts

Hello everyone!

 

I've so far have had some (modest) success modding Kotor 1 and correcting some compatibility issues between the mods I used . Editing .uti, .utc, .utm, .dlg,... and some basic scripting.
Now that I'm done with my playthrough, I've started TSL and I would like to try something more ambitious: 

 

I'm trying to create a script that removes one item from a stack in the player's inventory...

 

When using DestroyObject(); it removes the whole stack so that is not what I want to achieve.

 

I've tried something like this : 

int nStack = 0;

nStack = GetItemStackSize(GetItemPossessedBy(GetFirstPC(), item_tag));

SetItemStackSize((GetItemPossessedBy(GetFirstPC(), item_tag), (nStack - 1));



But it doesn't seem to work, it does not decrease said stack size by one.
Is there something I'm missing or is my syntax completely stupid?

 

Any help would be much appreciated!  :thumbup:

 

Thanks!

 

Share this post


Link to post
Share on other sites

Oops nevermind guys, I got it working, I was just missing a set of parentheses in my (complete) script  :blush:

 

BTW, this was about fixing the Holowan Duplisaber mod  (http://deadlystream.com/forum/files/file/424-holowan-duplisaber-beta), and i think I suceeded:

 

  • Now removes a single crystal of the adequate color when creating a new hilt (instead of all of them).
  • Correctly uses a cerulean crystal when choosing that color, instead of a blue one.
  • I've also corrected the "bug" making all Dark Jedi lightsabers green, they're now the classic red.

 

How do I go about sharing the fixed version of this mod? New topic, new upload?

 

 

PS: This place has helped me immensely when it comes to understanding Kotor/TSL modding! Kudos to you all!  :clap:

Share this post


Link to post
Share on other sites

Oops nevermind guys, I got it working, I was just missing a set of parentheses in my (complete) script  :blush:

 

BTW, this was about fixing the Holowan Duplisaber mod  (http://deadlystream.com/forum/files/file/424-holowan-duplisaber-beta), and i think I suceeded:

 

  • Now removes a single crystal of the adequate color when creating a new hilt (instead of all of them).
  • Correctly uses a cerulean crystal when choosing that color, instead of a blue one.
  • I've also corrected the "bug" making all Dark Jedi lightsabers green, they're now the classic red.

 

How do I go about sharing the fixed version of this mod? New topic, new upload?

 

 

PS: This place has helped me immensely when it comes to understanding Kotor/TSL modding! Kudos to you all!  :clap:

Welcome to Deadlystream JulieLakaye!

 

Glad you had success modding k1, best of luck with all your TSL modding endeavors! 

 

However, I would like to let you know about uploading fixes for mods. You'll want to check the permission section of the readme or the mod's description and, or contact the originally mod author to ask him for permission to use his files before uploading any mod that has his/her files. 

 

In this case, I think the author is Varsity Puppet so send him a PM and ask him. 

Share this post


Link to post
Share on other sites

Thank you for your advice, jc2 ;)

 

I've just sent a PM to the author of the mod asking for his/her opinion on this matter.

 

If he/she would rather update it him/herself, I'll just send him/her the files :)

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