Modifié par mikeloeven, 10 décembre 2010 - 04:26 .
how to make items immune to removal scripts
#1
Posté 10 décembre 2010 - 04:25
#2
Posté 10 décembre 2010 - 07:24
#3
Posté 10 décembre 2010 - 08:31
Actually that isn't entirely true, the Witch's Wake premium mod was originally released as a regular mod that could be opened in the toolset.ShaDoOoW wrote...
We can't open neither premium modules or some uber pvp arena ones so it cannot be said.
I looked at the OnClientEnter code and it looks like the standard item destruction script. I can't see anything that would prevent your item from being destroyed unless, perhaps, it somehow isn't considered a valid object?
Here is the relevent piece of code:
// Removing PC's equipment.
object oGear = GetItemInSlot(INVENTORY_SLOT_ARMS, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_BELT, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_BOLTS, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_BOOTS, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_CLOAK, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_HEAD, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_LEFTRING, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_NECK, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_RIGHTRING, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_ARROWS, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_BOLTS, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
oGear = GetItemInSlot(INVENTORY_SLOT_BULLETS, oPC);
if(GetIsObjectValid(oGear))
DestroyObject(oGear);
}
// Removing PC's inventory.
object oStuff = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oStuff))
{
DestroyObject(oStuff);
oStuff = GetNextItemInInventory(oPC);
}
-420
#4
Posté 10 décembre 2010 - 11:07
No, you cannot make an item immune to removal scripts. There is no way to prevent a well made script from removing any particular item your PC possesses.mikeloeven wrote...
so i was wondering is this a bug or is it possible to build an item in the toolset that cannot be removed by startup scripts of a module.
In the specific case you mentioned, the item removal script just wasn't very good. They probably neglected to check the equipped arrow slot or something like that.
Modifié par Invisig0th, 10 décembre 2010 - 11:10 .
#5
Posté 11 décembre 2010 - 12:06
Well that doesnt mean that other premium modules use the same script. If they would I dont think the OP could not keep his arrows. Anyway there are few ways to fool script like this, but sorry I won't say.420 wrote...
I looked at the OnClientEnter code and it looks like the standard item destruction script. I can't see anything that would prevent your item from being destroyed unless, perhaps, it somehow isn't considered a valid object?
#6
Posté 11 décembre 2010 - 12:11
#7
Posté 11 décembre 2010 - 02:15
Actually, if SetIsDestroyable() does work on items (which I haven't tested) it means that the DestroyObject() function will not work on the item.Lightfoot8 wrote...
It sounds to me like your "arrow" was an "unlimited arrow" made that way by use of the SetIsDestroyable(FALSE); scripting function. This is a method of making unlimited amunintion. This is not to say that the use of this function will allow you to bypass the cleaning on all modules. Like Shadow said "Depends on the script". If you really do not like your character being cleaned in a Single Player Game, your best bet is to just open the module in the toolset a disable the cleaning script.
If this is the case it means a few things:
1. Alternate Method of Unlimited Ammunition = cool
2. The "Not Destroyable" state on items gets saved out with the character export.
3. There is an easy fix, simply add a SetIsDestroyable(TRUE) line before destroying the item like so:
// Removing PC's equipment.
object oGear = GetItemInSlot(INVENTORY_SLOT_ARMS, oPC);
if(GetIsObjectValid(oGear))
{
AssignCommand([code]oGear[/code], SetIsDestroyable(TRUE));
DestroyObject(oGear);
}
// Removing PC's inventory.
object oStuff = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oStuff))
{
AssignCommand(oStuff, SetIsDestroyable(TRUE));
DestroyObject(oStuff);
oStuff = GetNextItemInInventory(oPC);
}
-420
EDIT: BioWare get a real forum. One that doesn't add random "code" tags to my post that I can't edit out and one that can incorporate the spell checker used by browsers made in this millennium!
Modifié par 420, 11 décembre 2010 - 02:24 .
#8
Posté 11 décembre 2010 - 02:35
This is not to say that the use of this function will allow you to bypass the cleaning on all modules. Like Shadow said "Depends on the script".
As far as the unlimited amo. It works I have used it in a few cases. The Idea came from a post in the Builders Project.
The first link below will only be good as long as the old gilds are still there. The second link should be good even after the legacy forums are archived. At least i hope.
Shortcut to Returning Thrown Weapons and Ammunition
http://nwn.bioware.c...&forum=47&sp=10
#9
Posté 11 décembre 2010 - 09:33
420 wrote...
Actually that isn't entirely true, the Witch's Wake premium mod was originally released as a regular mod that could be opened in the toolset.
Just to clarify, wasn't it vice versa? I thought Witch's Wake was premium at first, then after the sequel was cancelled, it was released as regular. Which way it was?
#10
Posté 11 décembre 2010 - 08:16
Witch's Wake was originally released before the Premium Module program existed. Since I downloaded everything related to NWN on the day of release I can safely rely on my file's dates.CheeseshireCat wrote...
420 wrote...
Actually that isn't entirely true, the Witch's Wake premium mod was originally released as a regular mod that could be opened in the toolset.
Just to clarify, wasn't it vice versa? I thought Witch's Wake was premium at first, then after the sequel was cancelled, it was released as regular. Which way it was?
The date I have on my Witch's Wake files are 12/11/2002 for WW1 and 12/18/2002 for the WW1 "template" which is essentially a blank mod with all the WW1 systems implemented.
The dates I have for Premium Mod Shadowguard + Witch's Wake is 11/10/2004 (v1.1 patch 2/23/2005)
Technically the Witch's Wake released as a Premium Mod was the "remastered" edition, whatever that means.
-420





Retour en haut







