Aller au contenu

Photo

Help with custom items


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
Stigandr Ogaefa

Stigandr Ogaefa
  • Members
  • 75 messages
I have been screwing around in the toolset and decided to make some custom armour. I made the items but have been unable to put 'em in my game. I have have tried using the PRCSCR script templates from the wiki to add 'em but I have not been able to figure it out. Could anyone give me a hand in understanding exactly what to do?

#2
alschemid

alschemid
  • Members
  • 477 messages
Change the custom_armour.uti with the name of your item and add this script in the module manager->module->script:


#include "utility_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
switch (nEventType)
{
case EVENT_TYPE_MODULE_LOAD:
{
// The UT_AddItemToInventory function adds various resources to
// creature's inventory.
UT_AddItemToInventory(R"custom_armour.uti",1);
break;
}
default:
break;
}
}

It loads the item everytime you load the module, you can add a few plot flags and plot checks to avoid that.

Modifié par alschemid, 27 août 2010 - 08:20 .