Jump to content

Masterofnet

Banned
  • Posts

    402
  • Joined

  • Last visited

Everything posted by Masterofnet

  1. No , your script is the problem here. You do not even end the While for starters. Let me give you a few ideas. Use the while to find an empty Alias to force the actor into. There is no reason to include the "Actor Target" in the While. Quest Property SleepQuest Auto Event OnEffectStart(Actor akTarget, Actor akCaster) int I = -1 ReferenceAlias BigMan Actor Givemeabreak ; This will cycle until Bigman is empty or until you have checked all 6 aliases. They Start at 0. While I < 5 I += 1 BigMan = SleepQuest.GetAlias(I) as ReferenceAlias Givemeabreak = Bigman.GetReference() As Actor If Givemeabreak If Givemeabreak == aktarget Return ;If your target is already an Alias this will end the function. EndIf Else I = 5 EndIf EndWhile ;When the while ends bigman should be empty, then you fill it. BigMan.ForceRefIfEmpty(akTarget) EndEvent
  2. Actually, using keyword in the Fallout 4 Kit does work. That is the reason I asked the question. Before anyone answered I had decided to download the SE kit and tested it. It does not work in the Skyrim SE Kit. The Item would trigger the event and the the function would look for the keyword on the form. http://www.creationkit.com/fallout4/index.php?title=AddInventoryEventFilter_-_ScriptObject Glad to help. I would like to hear more about how to do this. Someone needs to start a thread about xEdit that details all of its functions and how to use them.
  3. You know you would have to be a real moron to come on this thread and post your gibberish after you read the person tested it themselves and it does not work. I do not know about the " Script Below" and you do not have to bother testing this, it does not work - like I stated. However if you would like to, this is how I did. Scriptname KeywordTest extends ReferenceAlias Keyword Property vendoritemweapon Auto EVENT OnInit() AddInventoryEventFilter(vendoritemweapon) Debug.Notification("Filter Added") ENDEVENT Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) Debug.Notification("Filter Test") Endevent Place this script on a reference alias for the player and have them drop anything that is not a weapon. If the notification displays, then the inventory filter using a keyword does not work.
  4. Are you sure? I tested it with VendorItemPotion and it did not work. How did you test it?
  5. If you are ever able to properly install your creation kit, keep in mind if the helmet is part of the NPCs outfit you will not be able to un-equip it or remove it form inventory if I remember correctly.
  6. Really? You are totally clueless about anything. What tutorials could you have watched? This is a good place for you to start. https://www.youtube.com/user/doughamil/videos You need to be a little more well rounded before you attempt to do the things you are trying to do. What about this one???
  7. If you want some help with a script you need to post the script. :wacko:
  8. I wonder what would happen if you started watching and reading some tutorials instead of coming here and expecting people to do your mod for you. :confused:
  9. I was reading up on this and there may some other weapons that can have a problem with drop based on weapon rack reports. So I came up with this and believe it or not it works perfectly. When testing this script I made a very interesting discovery. I can not get a weapon to not be a objectreference when it is dropped from the player. The purpose of this script is to get. 1. When the potion is applied to a Weapon 2. When the target is poisoned and who they are. 3. The exact weapon and type of weapon that was poisoned. 4. If the potion was lost - Not used on a target and not able to be reapplied. For example the potion was put on a bow and the shot missed. Here is the final version of the script. This script goes on a playerAlias This Script goes on the Potion's Magic Effect
  10. Agreed The exact same weapons need to be put back, but when I put the stack back in inventory and dropped the weapons one at a time they all disappeared until only one was left because they all had the same object reference. The new version solved both of these issues. For some reason most of my post was just deleted. So here is the short version. Check out this new script. It uses remove item and a chest. lofgren - Yes and it works well. A couple of updates. The weapon issue with drop has nothing to do with persistence. I was also able to use Silver Swords so it is more that just the script. As far as quest items, which are all persistent while the quest is running, it works fine with all I have attempted other than the Ebony Blade. However, Drop does not work with the Ebony Blade so I have updated the script and it works fine. Just the Weapon Ebony Blade also works fine, but the quest object does not. If anyone knows about weapons other than the Ebony or Bloodskal Blade that do not work with weapon racks please let me know. Scriptname PlayerAliasPotion extends ReferenceAlias Potion Property ThePotion Auto ObjectReference UnpoisonedStackRef ObjectReference PWeaponRef ObjectReference PotionRef ObjectReference Property chest Auto ObjectReference Property DA08EbonyBladeREF Auto ReferenceAlias Property PotionAlias Auto ReferenceAlias Property PoisonedWeaponRef Auto Int Distance Int UnpoisonedCount Weapon Poisoned Actor PlayerRef Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) AddInventoryEventFilter(ThePotion) PlayerRef = Self.GetReference() As Actor PotionRef = PotionAlias.GetReference() If PlayerRef.GetItemCount(ThePotion) Else Distance = PlayerRef.GetDistance(PotionRef) as Int If akDestContainer akDestContainer.RemoveItem(PotionRef, 1 , False, PlayerRef ) Debug.Notification("You can not drop this!") Else If Distance < 4000 PlayerRef.AddItem(PotionRef,1,True) Debug.Notification("You can not drop this!") Else WeaponPoisoned() EndIf EndIf EndIf EndEvent Function WeaponPoisoned() Poisoned = (PlayerRef.GetEquippedWeapon()) If Poisoned == DA08EbonyBladeREF.GetBaseObject() As Weapon PoisonedWeaponRef.ForceRefTo(DA08EbonyBladeREF) Else UnpoisonedCount = PlayerRef.GetItemCount(Poisoned) - 1 PlayerRef.RemoveItem(Poisoned, 1, True, Chest) PoisonedWeaponRef.ForceRefTo(Chest.DropObject(Poisoned)) If UnpoisonedCount > 0 PlayerRef.RemoveItem(Poisoned, UnpoisonedCount, True, Chest) EndIf PWeaponRef = PoisonedWeaponRef.GetReference() PlayerRef.AddItem(PWeaponRef, 1, True) PlayerRef.EquipItem(PWeaponRef.GetBaseObject(), False, True) If UnpoisonedCount > 0 Chest.RemoveItem(Poisoned, UnpoisonedCount, True, PlayerRef) EndIf EndIf EndFunction
  11. I got. I can use get distance to 100% tell if a potion has been placed on a weapon. I will update with the script when I get a chance. I did not think this was going to work. Thanks for your help CdCooley and everyone else. Please feel free to comment on the new script if you feel it can be improved. I can't believe it. This script is flawless. You know I keep my threads up to date so that may change but I beat the S*** out of this script and is just laughed at me. 100% perfect every time. Now I need to run down the couple of weapons that may have an issue with Drop. Scriptname PlayerAliasPotion extends ReferenceAlias Potion Property ThePotion Auto ObjectReference Property UnpoisonedStackRef Auto Hidden ObjectReference Property PWeaponRef Auto Hidden ObjectReference Property PotionRef Auto Hidden ReferenceAlias Property PotionAlias Auto ReferenceAlias Property PoisonedWeaponRef Auto Bool Gate Int Distance Weapon Poisoned Actor PlayerRef EVENT OnInit() self.AddInventoryEventFilter(ThePotion) ; The exact poison you are using on the weapon. Debug.Notification("Fired") ENDEVENT Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) PlayerRef = Self.GetReference() As Actor PotionRef = PotionAlias.GetReference() If PlayerRef.GetItemCount(ThePotion) Return Else Distance = PlayerRef.GetDistance(PotionRef) as Int If akDestContainer akDestContainer.RemoveItem(PotionRef, 1 , False, PlayerRef ) Debug.Notification("You can not drop this!") Else If Distance < 4000 PlayerRef.AddItem(PotionRef,1,True) Debug.Notification("You can not drop this!") Else WeaponPoisoned() EndIf EndIf EndIf EndEvent Function WeaponPoisoned() Poisoned = (PlayerRef.GetEquippedWeapon()) Int UnpoisonedCount = PlayerRef.GetItemCount(Poisoned) - 1 If UnpoisonedCount > 0 UnpoisonedStackRef = PlayerRef.DropObject(Poisoned, UnpoisonedCount).Disable() EndIf PoisonedWeaponRef.ForceRefTo(PlayerRef.DropObject(Poisoned)) PWeaponRef = PoisonedWeaponRef.GetReference() PlayerRef.AddItem(PWeaponRef, 1, True) PlayerRef.EquipItem(PWeaponRef.GetBaseObject(), False, True) PlayerRef.AddItem(Poisoned, UnpoisonedCount, True) EndFunction
  12. One last thing about the Wait at the beginning. You must have it above the PotionCount == 1 because you need to use that to put the potion back in the players inventory if it is dropped. That is the only way to distinguish between it being dropped and being used. By the time the wait is done if the potion was used it will be at 2. If the potion is dropped the wait does not matter because it will always be one. You check the inventory and if it is not there you put it back. I was unable to add the stack back into the players inventory because it gave all of the weapons one objectreference. If the player were to drop them into the environment they would all disappear until only one was left. UPDATE: This was a really good attempt. However it does not function up to my standards. If you drop the potion enough times etc. it can sometimes fail. Thanks for the help. If anyone has any ideas on how this could be "fool prof" I am happy to hear them, but unfortunately I doubt it. Scriptname PlayerAliasPotion extends ReferenceAlias Int PotionCount Int UnpoisonedCount Potion Property ThePotion Auto ObjectReference UnpoisonedStackRef ObjectReference PWeaponRef ObjectReference PotionRef ReferenceAlias Property PotionAlias Auto ReferenceAlias Property PoisonedWeaponRef Auto Bool Gate EVENT OnInit() self.AddInventoryEventFilter(ThePotion) ; The exact poison you are using on the weapon. Debug.Notification("Fired") ENDEVENT Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) Actor PlayerRef = Self.GetReference() As Actor PotionRef = PotionAlias.GetReference() If AkBaseItem == ThePotion PotionCount += 1 EndIf Utility.Wait(0.1) If PotionCount == 2 If Gate == False Gate = True Weapon Poisoned = (PlayerRef.GetEquippedWeapon()) UnpoisonedCount = PlayerRef.GetItemCount(Poisoned) - 1 If UnpoisonedCount > 0 UnpoisonedStackRef = PlayerRef.DropObject(Poisoned, UnpoisonedCount).Disable() EndIf PoisonedWeaponRef.ForceRefTo(PlayerRef.DropObject(Poisoned)) PWeaponRef = PoisonedWeaponRef.GetReference() PlayerRef.AddItem(PWeaponRef, 1, True) PlayerRef.EquipItem(PWeaponRef.GetBaseObject(), False, True) PlayerRef.AddItem(Poisoned, UnpoisonedCount, True) EndIf ElseIf PotionCount == 1 If !PlayerRef.GetItemCount(PotionRef) If akDestContainer akDestContainer.RemoveItem(PotionRef, 1 , False, PlayerRef ) Else PlayerRef.AddItem(PotionRef, Absilent = 1) EndIf Debug.Notification("You can not drop this!") PotionCount = 0 EndIf EndIf EndEvent
  13. Cooley you are a God Send. I just gated it and it works perfectly. I don't see how the functions can fire twice when the Count only reaches 2 in my testing once, but it is the problem. I am going to get some sleep and have a look when I wake up. Ya and thanks again. I can just not get out of my own way on this. For some reason I though you could not drop # of items. That is I why I have been counting them down. That is exactly what I would have done. Get the count -1 and drop them. I did read that they are dropped one at a time so you may not be able to get a stack of them. Also can you disable them?? With your script the player would see the weapons fall and lay on the ground. This script does work very well now. You can not see the dropped items at all and the weapon just looks like it was unequipped and then re- equipped. As far as the Wait(1) I have never had to use a wait at all between adding an item and equipping it. It may have something to do with the gating issue as well. Scriptname PlayerAliasPotion extends ReferenceAlias Bool PropertiesGate Int PotionCount Potion Property ThePotion Auto KeyWord Property VendorItemPoison Auto Int NoPoison ReferenceAlias Property PoisonedWeaponRef Auto EVENT OnInit() self.AddInventoryEventFilter(ThePotion) ; The exact poison you are using on the weapon. Debug.Notification("Fired") ENDEVENT Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) Debug.Notification("Event Fired") Actor PlayerRef = Self.GetReference() As Actor If AkBaseItem == ThePotion PotionCount += 1 EndIf Utility.Wait(0.7) If PotionCount == 1 PotionCount =0 ElseIf PotionCount == 2 If PropertiesGate == False PropertiesGate = True Weapon Poisoned = (PlayerRef.GetEquippedWeapon()) Int WeaponCount = PlayerRef.GetItemCount(Poisoned) While WeaponCount >1 (PlayerRef.DropObject(Poisoned)).Disable() WeaponCount -=1 NoPoison +=1 EndWhile PoisonedWeaponRef.ForceRefTo(PlayerRef.DropObject(Poisoned)) ObjectReference PWeaponRef = PoisonedWeaponRef.GetReference() PlayerRef.AddItem(PWeaponRef, 1, True) Utility.Wait(1) PlayerRef.EquipItem(PWeaponRef.GetBaseObject(), False, True) PlayerRef.AddItem(PWeaponRef.GetBaseObject(),NoPoison,True) EndIf EndIf endEvent
  14. Using form does not work. The game drops the unequipped weapons first. This script is removing all of the weapons of which there are 5 and adding 14 I can not figure out why. I have run some things down but they make no sense. The add items function is adding twice the amount of the INT even if I put in a # PlayerRef.AddItem(Poisoned,2,True) It will add 4 Why???? Scriptname PlayerAliasPotion extends ReferenceAlias Bool PropertiesGate Int PotionCount Potion Property ThePotion Auto Form Property PFM Auto KeyWord Property VendorItemPoison Auto Int NoPoison ReferenceAlias Property PoisonedWeaponRef Auto EVENT OnInit() self.AddInventoryEventFilter(ThePotion) ; The exact poison you are using on the weapon. Debug.Notification("Fired") ENDEVENT Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) Debug.Notification("Event Fired") Actor PlayerRef = Game.GetPlayer() If AkBaseItem == ThePotion PotionCount += 1 EndIf Utility.Wait(0.7) If PotionCount == 1 PotionCount =0 ElseIf PotionCount == 2 Weapon Poisoned = (PlayerRef.GetEquippedWeapon()) Int WeaponCount = PlayerRef.GetItemCount(Poisoned) If WeaponCount == 5 Debug.Notification("Got Five") EndIf While WeaponCount > 1 ;THIS IS NOT WORKING. IT IS NOT PRECISE ENOUGH TO COUNT THEM CORRECTLY EVEYTIME. (PlayerRef.DropObject(Poisoned)).Disable() WeaponCount -=1 NoPoison += 1 EndWhile PoisonedWeaponRef.ForceRefTo(PlayerRef.DropObject(Poisoned)) ObjectReference PWeaponRef = PoisonedWeaponRef.GetReference() PlayerRef.AddItem(PWeaponRef, 1, True) Utility.Wait(1) PlayerRef.EquipItem(PWeaponRef.GetBaseObject(), False, True) PlayerRef.AddItem(Poisoned,NoPoison,True) ; This is adding twice as many times as the Int States, PlayerRef.AddItem(Poisoned,2,True) It adds 4 Why???? EndIf endEvent
  15. Let me explain this script a little better. Scriptname PlayerAliasScript extends ReferenceAlias Int Count Int NoPoison Potion Property ThePotion Auto ReferenceAlias Property PoisonedWeapon Auto Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) AddInventoryEventFilter(ThePotion) ; The exact poison you are using on the weapon. Count += 1 ;------------------------------------------------------------------------------------- ; The Wait must be used here because this is the only way we can determine if the Poison has been applied. The Event OnItemRemoved fires twice when you poison a weapon or take a potion. Utility.Wait(0.7) ;--------------------------------------------------------------------------------- If Count = 2 Weapon Poisoned = (PlayerRef.GetEquippedWeapon()) Int WeaponCount = PlayerRef.GetItemCount(Poisoned) ;---------------------------------------------------------------------------------------------- ; This must be done to clear any other weapons of the same type from the players inventory. The Drop function always drops the unequipped weapon first. If there are no extras it will go right to the next function. If they exist I drop, count, and disable them. While WeaponCount > 1 (PlayerRef.DropObject(Poisoned)).Disable() NoPoison += 1 EndWhile ;-------------------------------------------------------------------------------------------------- ; Now I have the exact weapon that has been poisoned. I drop it and force it to a ReferenceAlias that has a script on it to keep track of it. If it is equipped, Un-eqipped etc. PoisonedWeapon.ForceRefTo(PlayerRef.DropObject(Poisoned)) ObjectReference PWeaponRef = PoisonedWeapon.GetReference() PlayerRef.AddItem(PWeaponRef, 1, True) Utility.Wait(1) ;You must add Wait here or the weapon will not equip. PlayerRef.EquipItem(PWeaponRef.GetBaseObject(), False, True) ;------------------------------------------------------------------------------ After I equip the poisoned weapon the removed weapons are added back into the players inventory. PlayerRef.AddItem(Poisoned,NoPoison,True) EndIf endEvent I see in your script you get the Form of the equipped weapon. Do you think that will work on drop? Do you think it will be able to separate it from the other exact weapons? (If any are in inventory) I have never used that or had a need to. I have always separated items by getting an object reference. So this could be all I may need to do? Scriptname PlayerAliasScript extends ReferenceAlias Bool PropertiesGate Int PotionCount Potion Property ThePotion Auto ReferenceAlias Property PoisonedWeaponRef Auto Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) AddInventoryEventFilter(ThePotion) ; The exact poison you are using on the weapon. Actor PlayerRef = Game.GetPlayer() If AkBaseItem == ThePotion PotionCount += 1 EndIf ;------------------------------------------------------------------------------------- ; The Wait must be used here because this is the only way we can determine if the Utility.Wait(0.7) ;--------------------------------------------------------------------------------- If PotionCount == 2 If PropertiesGate == False Form Poisonedfm = PlayerRef.GetEquippedWeapon() as Form PropertiesGate = True EndIf PoisonedWeaponRef.ForceRefTo(PlayerRef.DropObject(Poisonedfm, 1)) PlayerRef.AddItem(PoisonedWeaponRef.GetReference(),1,True) Utility.Wait(1) PlayerRef.EquipItem(Poisonedfm,False,True) EndIf EndEvent
  16. The item I was working on had no script attached. It was as far as I know persistent, and I was able to get the objectreference. Redragon - Do you have any thoughts on a script to get the exact weapon that a person poisoned, force it to ref and then re - equip it. This is what I have so far. Int Count Int NoPoison ReferenceAlias Property PoisonedWeapon Auto Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) AddInventoryEventFilter(Potion) ; The exact posoin you are using on the weapon. Count += 1 Utility.Wait(0.7) If Count = 2 Weapon Poisoned = (PlayerRef.GetEquippedWeapon()) Int WeaponCount = PlayerRef.GetItemCount(Poisoned) While WeaponCount > 1 NoPoison += 1 (PlayerRef.DropObject(Poisoned)).Disable() EndWhile PoisonedWeapon.ForceRefTo(PlayerRef.DropObject(Poisoned)) ObjectReference PWeaponRef = PoisonedWeapon.GetReference() PlayerRef.AddItem(PWeaponRef, 1, True) Utility.Wait(1) PlayerRef.EquipItem(PWeaponRef.GetBaseObject(), False, True) PlayerRef.AddItem(Poisoned,NoPoison,True) EndIf endEvent There is more to it. You have to use an if count == 1 to make sure the potion was not dropped. If so you must put it back in the players inventory. Also with this information about Persistent Weapons with scripts you will need to detect that. You might be able to force them to Alias without dropping them. Most likely there would only be a limited # in the game.
  17. Does AddInventoryEventFilter() work with keywords in SE. Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) AddInventoryEventFilter(Keyword) endEvent
  18. It works just fine and the weapon should be persistent. Has no one ever tested this with a persistent item? It would be very easy to test. I was thinking about how this idea might actually work. When you poison the weapon and drop the equipped weapon you could do while. While the number of weapons is greater than 1 drop them, count them and disable them. Then when you get to the last weapon drop it and force it to a ref alias, put it back on the player and equip it. Then put the other weapons back in the players inventory. It would not be practical to do every time you poison a weapon but for a couple of quests it might work.
  19. Ya, This was a colossal failure. I am just getting back to the post. All I can get is the potion has been applied to a weapon and that is where I am leaving it. As far as what it says on the Wiki. I don't know, I was able to get the object reference from the item I dropped and it was a quest item so should be persistent. However I am not going to be doing any further testing as I have wasted enough time on this. You would have to do it like this ObjectReference Dagger = PlayerRef.DropObject(PlayerRef.GetEquippedWeapon(), 1)Does this wiki quote actually mean if someone put an object reference where the base object should be the script will not work?? "If akObject is an ObjectReference, even one which was just received by i.e. OnItemAdded(), DropObject() will fail with an error in the script log: "cannot be dropped, it has no 3d." You can instead use itemRef.MoveTo(containerRef) to pull a specific reference out of inventory, but note that if itemRef is a weapon and containerRef is an actor (such as the player), the actor may be wounded unless you give MoveTo() a sufficient offset."
  20. The CK wiki was completely wrong in regards to DropObject. It claimed you can not get the object reference of the item from it. That is totally false. PoisonDagger.ForceRefTo(PlayerRef.DropObject(PlayerRef.GetEquippedWeapon(), 1)) WeaponRef = PoisonDagger.GetReference() PlayerRef.AddItem(WeaponRef) Utility.Wait(1) PlayerRef.EquipItem(WeaponRef.GetBaseObject())
  21. I know this is a long shoot, but does the SE kit happen to have a way way of telling when a Weapon has been Poisoned? I know about the container change firing twice work around but I really don't like it.
  22. What exactly are you attempting to do? Did you put your source scripts in scripts folder and at least have a look at the script?
  23. The lever that you used to make your activator. Do you see multiple copies of it's base object in the kit? No, there is only one and that base object is brought into the cells and it's object reference is used. You should be able to use just one base activator and one activator script to accomplish your goal. Please look over my #11 post on this thread. Glad to hear it.
×
×
  • Create New...