Author Topic: Setting cursed flag on multiple stackable items  (Read 355 times)

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Setting cursed flag on multiple stackable items
« on: January 09, 2014, 09:14:02 pm »


                Hello,
I'm working on a random henchman system right now and I've run into a problem when I tried to generate some potions on a newly created henchman.
Basically, I generated three potions of the same type (meaning they stacked) and then tried to set cursed flag on each of them, so that they couldn't be taken away by the PC.

However, the flag of only one potion was set, which is probably related to the fact that two others stacked with the first one upon creation.

Thus, if the PC tries to take away a whole stack from the henchman, he can't, but if he separates the potions, then he can take two of them.

Anyone knows if it is a bug?
               
               

               


                     Modifié par Grani, 09 janvier 2014 - 09:15 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Setting cursed flag on multiple stackable items
« Reply #1 on: January 09, 2014, 09:18:09 pm »


               Of course its a bug. I think that nwnx_fixes is correcting this but its only for server.
               
               

               


                     Modifié par ShaDoOoW, 09 janvier 2014 - 09:18 .
                     
                  


            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Setting cursed flag on multiple stackable items
« Reply #2 on: January 09, 2014, 09:21:30 pm »


               In this case, I guess I'll have to make a copy of the potion blueprints and mark them as cursed on a blueprint level.
               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Setting cursed flag on multiple stackable items
« Reply #3 on: January 09, 2014, 10:02:23 pm »


               I don't get why, but it still doesn't work, even with the cursed flag turned on in the blueprints.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Setting cursed flag on multiple stackable items
« Reply #4 on: January 09, 2014, 10:32:13 pm »


               

Grani wrote...

I don't get why, but it still doesn't work, even with the cursed flag turned on in the blueprints.

I thought so... Maybe you can workaround it via OnAcquire event which fires for player when he transfer that potion from henchman to his inventory?
               
               

               
            

Legacy_Grani

  • Hero Member
  • *****
  • Posts: 1040
  • Karma: +0/-0
Setting cursed flag on multiple stackable items
« Reply #5 on: January 09, 2014, 10:47:18 pm »


               I've made them unstackable by copying these blueprints. Altogether that gives me 15 of them - 5 types of healing potions, each multiplied by 3. Not a very convenient solution, nor flexible, but it accomplishes the job.
               
               

               


                     Modifié par Grani, 09 janvier 2014 - 10:50 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Setting cursed flag on multiple stackable items
« Reply #6 on: January 09, 2014, 10:52:35 pm »


               

Grani wrote...

I've made them unstackable by copying these blueprints. Altogether that gives me 15 of them - 5 types of healing potions, each multiplied by 3. Not a very convenient solution, nor flexible, but it accomplishes the job.


Yup, that's the appropriate fix if you're not using NWNX. We had convoluted workarounds for variable and status-setting issues of stackables pre-fix, but none of them worked in all cases. You could get some really nasty infinite-use exp(lo^its as a result.

Funky