Author Topic: Placing item on quick bar  (Read 255 times)

Legacy_BookerDewitt

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Placing item on quick bar
« on: September 30, 2014, 06:27:55 pm »


               Hi guys,


I would like to know if there is a way to place an item that's in the inventory in the quick bar automatically when the player enter in an area. Also if there is way to increase the number of times the player can use a spell like fireball.


Thanks.
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Placing item on quick bar
« Reply #1 on: October 01, 2014, 05:13:33 pm »


               

There's no way to auto add an inventory item to a quick slot, which is likely good as I think it would frustrate players who usually take great pains to personalize their own slots.


 


As for being able to increase the number of times a PC can cast a certain spell, we'd need more details as to the -why- of it.


 


If this is for just your own use when playing in SP mode, you could just make an override of the relevant spells gained 2da(s) and up the number of spells available at each level as desired.


 


You could also create custom feats for specific spells that you incriment/decriment accordingly based on whatever parameters you decide on.


 


Lastly, you could create custom rods, wands or widgets that either cast specific spells using available item properties with charges or uses per day, or even create an item that stores spells cast into it and even multiplies the uses when you do so.


 


Anyhow, more details would be required before options can be narrowed and roughed out for you.



               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Placing item on quick bar
« Reply #2 on: October 01, 2014, 08:45:15 pm »


               

NWNX provides the ability to manage quickbar slots using nwnx_funcs's Set/GetRawQuickBarSlot().



               
               

               
            

Legacy_Cursed Eclipse

  • Full Member
  • ***
  • Posts: 132
  • Karma: +0/-0
Placing item on quick bar
« Reply #3 on: October 01, 2014, 09:35:39 pm »


               Let's suppose that i want to put the player_tool_1, into the first quickbar slots
SetRawQuickBarSlot(oPC , sSlot??? );



What should I write in the second field (sSlot) ?
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Placing item on quick bar
« Reply #4 on: October 01, 2014, 09:55:34 pm »


               

GetRawQuickBarSlot() returns a string parameter which can be passed as sSlot. I'm not sure about the format (currently at work so can't check), but you can examine GetRawQuickBarSlot()'s output to see.


 


There's a QuickBarSlot struct shown in nwnx_funcs.nss, but none of the functions seem to be set up to use it. Many of the other functions (for example, the SpecialAbility ones) parse the string into a usable struct for the Get method and accept a struct for the Set method, so it'd be nice to do something similar with the quickbar functions



               
               

               
            

Legacy_BookerDewitt

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Placing item on quick bar
« Reply #5 on: October 02, 2014, 01:08:21 am »


               

Thanks guys for the reply! kalbaern, what I'm trying to do is initiate the module with a power, like fireball, that I could use for example 30 times. If I do an specific action, kinda like rest, I could restore this number slowly or I could take items in the level that would restore, for example five times each. I guess would be like a mana system. And yes, it's for single player use. What I could do so far was create like 20 spell scrolls in the inventory but I couldn't manage well how many scrolls the pc has and the player has to put again the scrolls in the quick bar and also the animation of using the scroll takes too long for me. I will try what you guys suggested. Thanks again!