Azholin Explorateur
Nombre de messages : 214 Date d'inscription : 10/12/2006
| Sujet: Renommage des objets ? Ven 5 Jan - 13:51 | |
| Je ne sais pas si tu as vu, mais avec NwN2, il est possible de renommer les objets de manière personnalisée, via une UI propre. La fonction s'appelle SetEnchantedItemName, elle est dans la librairie ginc_crafting. Voici son code : - Citation :
- // oPC = creator of the enchanted item.
// oItem = the enchanted item void SetEnchantedItemName(object oPC, object oItem) { int nMessageStrRef = 181743; string sMessage = ""; // "Please rename the item."; string sOkCB = "gui_name_enchanted_item"; string sCancelCB = ""; int bShowCancel = FALSE; string sScreenName = ""; int nOkStrRef = 181744; string sOkString = ""; int nCancelStrRef = 181745; string sCancelString = ""; string sDefaultString = GetFirstName(oItem); string sVariableString = "";
// the gui script will always run on the owned PC, regardless of who the player has possessed. object oObj = GetOwnedCharacter(oPC);
SetLocalObject(oObj, VAR_ENCHANTED_ITEM_OBJECT, oItem); DisplayInputBox( oPC, nMessageStrRef, sMessage, sOkCB, sCancelCB, bShowCancel, sScreenName, nOkStrRef, sOkString, nCancelStrRef, sCancelString, sDefaultString, sVariableString); } Il y a juste besoin de l'appeler de cette manière : SetEnchantedItemName(oPC, oItem); Voilà, c'était pour information . | |
|