Aller au contenu

Photo

Scripting Help (Inventory)


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
Cyansomnia

Cyansomnia
  • Members
  • 2 026 messages
I've been wracking my brain trying to figure this out, but I need some help.

I'm working on a mod where I've made custom ammo, but I don't want the player to have to go to an NPC and buy it everytime they run out.  I'd like to find a way to make it spawn in their inventory without using the MODULE_LOAD event.  In essence, without having to reload their game.

What sort of event would I need to use in order to do this?  How would I set it up?  I'm new to scripting for this and having trouble grasping some things.


Thanks for the help.


EDIT:  Or even better, make the ammo itself unlimited in some way.  No idea how to do that either.

Modifié par Aislinn Trista, 12 avril 2010 - 03:43 .


#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
EVENT_TYPE_OUT_OF_AMMO might work for you with the right approach, or you could make the stack size ridiculously big in an extension to BITM_base.xls and using module load or whatever event you like to keep it capped off.

#3
Cyansomnia

Cyansomnia
  • Members
  • 2 026 messages
Oooo, the stack size idea is a good one. Didn't think about that.

EVENT_TYPE_OUT_OF_AMMO would be good, too.  I was looking at it before, but unsure of how to use it properly.  It fires when you're using ammo and run out, I'm assuming?

I appreciate your help, by the way.  It's always nice to get another perspective on these things.  :)

Modifié par Aislinn Trista, 12 avril 2010 - 07:42 .


#4
Cyansomnia

Cyansomnia
  • Members
  • 2 026 messages
I decided to use the stack size idea, but how do I make it so the number does not display on the item in the inventory screen?

Modifié par Aislinn Trista, 12 avril 2010 - 11:37 .


#5
Craig Graff

Craig Graff
  • Members
  • 608 messages
I don't think there is a way to hide the stack size, unfortunately.

#6
Cyansomnia

Cyansomnia
  • Members
  • 2 026 messages
Doh! Hmm, I'll do some more experimenting then.

#7
shadow5973

shadow5973
  • Members
  • 48 messages
I would try using an item count so that when the item count reachs zero, the next time you that you load your game, the script would see that the item count had reached zero and would run the

UT_AddItemToInventory(R"your_custom_ammo.uti", 99);