Jump to content

Help with giving items specific powers?


Recommended Posts

Hey, everyone! Im trying to make a mod adding the character "Father" from Kid's Next Door to the game, and i've already got the character himself almost done, and the scripting for him and such. (I literally had no prior experience to scripting, and most of it is just cut and paste from other files XD)

Well, its all pretty much done as I said, and i'm modding for my own fun after I get home from school. I noticed he seemed pretty overpowered, and I thought maybe to make him first pretty weak "Benedict Uno/Wigglestien" and that you unlock the "Father" form by crafting his pipe.(not to mention, Wigglestien fits with the "W" theme.)

Getting to the point, is there a way to change his appearance, powers and statistics once he equips the pipe at the cost of sanity? How would I go about doing it?

Thanks for listening...reading...um... Thanks!

 

Link to comment
Share on other sites

  • Developer

Hey, everyone! Im trying to make a mod adding the character "Father" from Kid's Next Door to the game, and i've already got the character himself almost done, and the scripting for him and such. (I literally had no prior experience to scripting, and most of it is just cut and paste from other files XD)

Well, its all pretty much done as I said, and i'm modding for my own fun after I get home from school. I noticed he seemed pretty overpowered, and I thought maybe to make him first pretty weak "Benedict Uno/Wigglestien" and that you unlock the "Father" form by crafting his pipe.(not to mention, Wigglestien fits with the "W" theme.)

Getting to the point, is there a way to change his appearance, powers and statistics once he equips the pipe at the cost of sanity? How would I go about doing it?

Thanks for listening...reading...um... Thanks!

Looking at the 'inventory' component found in 'inventory.lua', it looks like it pushed an event called 'equip'.  You should be able to listen for that event using the 'ListenForEvent' function.  At that point you can do whatever you want with the player.

 

As far as changing the appearance, if you look at the 'MakePlayerCharacter' function in 'player_common.lua', it shows how the name of the player is used to set it's build.  A build is basically the set of images and offsets that make up a character so if you loaded a seperate character build and changed the build after equipping the pipe, I think you can achieve what you want.  You might also want to change the transition with some kind of smoke effect :).

Link to comment
Share on other sites

  • Developer

Since you are making the pipe item from scratch, you might as well put the transformation in the equip function for the pipe instead of listening for the equip event (that's just an extra step to take).

That's an  even better suggestion :).

Link to comment
Share on other sites

Actually, check out my Link mod - it swaps anim build on Tunic equip - I didn't think of it before, but you could use the exact same method to swap to a very different model, and change the stats at the same time; changing the model and stats back on unequip.

 

And if you need more help, check out my guide to making characters/items in the pinned 'getting started' thread, assuming you haven't already.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...