Aller au contenu

Photo

Scripting Assistance


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

#1
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
Ok, I'm ready to begin my first test of some of the changes I've made for the Arms and Armor mod. Now I'm getting into the part of this that's well outside my experience: Scripting.

What I need to do is be able to instruct the game to replace ALL of certain instances of weapons: Both in my own inventory and the equipment of each of my party members, as well as for all NPCs, monsters, chests, etc.

I need to tell the game that some of the existing longswords should now belong to the new Arming Sword base item type, while others belong to the Falchion type. I plan to do this by specifically telling it to replace <weapon name> in the character/NPC/etc. inventory with <weapon name>. Anywhere it finds a reference to "Warden Longsword" it replaces it with "Warden Arming Sword" instead, and so forth and so on. It also needs to work both for existing saved games and for games that are started from scratch.

I already have the BITM_Base file modified, and made the appropriate changes to the item types in the toolset. I just need to put together the script to make sure the changes are applied to the game.

I don't necessarily need the script written FOR me, but I definitely need assistance with how to actually do it.

#2
stuntpope

stuntpope
  • Members
  • 112 messages
I'm not sure that a script is going to be the best way to do it. Perhaps there is some file that you can edit at design time that will make this substitution.

The problem with taking the scripting approach is that I imagine you cannot change it until the creature spawns. So you would have to have a script running in every area to check for creatures spawning and then swap the weapons at that point.

I think it would be better to adjust the resources themselves somehow. It may be as simple as overriding the IDs in a 2DA somewhere but I can't say for sure as I have no experience with 2DAs yet.

#3
Ambaryerno

Ambaryerno
  • Members
  • 532 messages
Hmmm... Like maybe checking for a "creature equipment" 2DA and change as appropriate?



That could work for NPCs and such, but there's still the matter of changing the party's inventory and making sure chests/etc. update correctly on pre-existing games.