Jump to content

tnt90

Supporter
  • Posts

    19
  • Joined

  • Last visited

Nexus Mods Profile

About tnt90

Profile Fields

  • Country
    United States
  • Favourite Game
    FNV & Skyrim & FO4

tnt90's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator Rare
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. I haven't tested these and they likely could be greatly improved but its a decent starting point I think.
  2. Alright this pretty much picks up where the previous topic died off. I'm currently stuck on how to make each armor instance keep a record of it's current HP value when its not in the players inventory. If I deal with individual pieces then I can make it work just fine with OnContainerChange, but I run into serious problems when the player has multiple of an item. I've read through this already, http://forums.bethsoft.com/topic/1349382-event-in-script-attached-to-misc-item-only-firing-once/ . Which is exactly the issue I'm having, only it's with all the armors instead of one item. I'm thinking of using OnLoad to deal with anything the player drops, but that leaves out the case of the player putting it in something else's inventory. This may be unattainable at the moment but i want to see if anyone else has an idea. I don't want to but may have to concede that keeping track of the armor's HP out of the player's inventory will be full of holes.
  3. So far as I've been reading, it seems the cloak spell method described in here: http://www.creationkit.com/Dynamically_Attaching_Scripts will work for any weapon durability actions just fine. But unless I was to create an alias for every possible armor, I don't think I could achieve what I'm after with armors. Sure it'd prevent incompatibilities, but require even more work than manually attaching each one I think. Does anyone know a better way?
  4. Well there are only three times that it needs to run, when you change container, when you equip it and when you unequip it. Object References have those events built in so as long as we can still call those events we should be fine. And it seems we can, if I understand it right. I'd actually really like to see if it will stick or not or if there is a way to do that with papyrus. If we can get it to dynamically add the script to the armors then we can also add a script to actors the player has targeted/is near/is fighting to make weapon durability possible as well. But that's a whole other ball game there.
  5. Oh I'd love to be able to dynamically attach these, but I haven't really looked into it too much. I'll have to take a look at how that function is used. If I say call that when I add in an armor and change to alias to work on that added armor (lets say a hide cuirass), if I then add in another armor (hide boots), will the alias be removed from the cuirass? The whole reason I'm putting a script on each armor is so that they can store their independent durability HP. Otherwise you could just drop it and pick it back up to reset the HP or something along that line.
  6. I do believe I've solved it. My test cases have all worked as intended. Here's what I did: I added on a OnItemAdded event to my player reference alias script and an array of forms onto my quest updater script along with some of Chesko's array functions. That new event adds the added form to the form array if it has one of the 5 armor type keywords. The OnContainerChange event now has a wait added in to make sure the new event runs and adds the form to the array then the OCC event takes the first form from the array and removes it as well as sorting everything down. This should hopefully make adding armors in quick succession still work. If anyone wants to see the new modified code, let me know, I'll stick in another spoiler tag. Thanks to everyone.
  7. Yeah I figured that's what's happening. ... which would be why GetBaseObject isn't working when its in an inventory. Cipscis, am I understanding correctly then that self should return the armor the script is attached to without any other calling needed to be made? And if so, since no other callings need to be made then it should return the armor if it is in or out of an inventory. Hmmm, let me try this real quick before I head to work.. Strange, it now works when dropping or picking it up from the ground but not when taking it from an actor or adding via console/forge. But we're closer! I think I understand what is going on now, self gets set when its out of an inventory so then it'll work, but until then it doesn't know what itself even is. So for it to work you'd need to drop every armor before using it. I think the next step is to see the processing order of OnContainerChange and OnItemAdded. If OnItemAdded runs first I can just take the object that returns and use that for the OnContainerChange event, if not, then is there perhaps a command to have a script wait a bit then finish processing?
  8. Conclusions so far: If I call the self.GetBaeObject() in the OnContainerChange(...) event then it will return the armor successfully when I drop the armor but not when I pick it up. If I call the self.GetBaeObject() in an OnInit() event then adding it via console doesn't return armor correctly. And it doesn't appear to work on preexisting armors. (Note checking condition calls in the OnContainerChange(...) event.)
  9. I would say either a volume trigger like jshepler mentioned or a GetDistance(Game.GetPlayer()) function on an object in the center of where you want the 'radiation' to be. Could also be used to make the 'radiation' counter increase faster nearer the center if you want it completely like fallout.
  10. Alright, sounds like that does it then. I'll post back here later on when I implement that into the code and report if it all works. Thank you both. Edit: I saw it work twice. Returned the correct keywords. But after trying to get it to work with the rest of the script, nothing. Going to try for another 10 min or so. I think I've had enough coding for one day.
  11. Yeah, if you'd rather not download it, I can test it in a few hours here once I finish this code for class.
  12. Sweet, if you have a moment could you modify that to: ScriptName armorTest Extends ObjectReference Armor thisArmor Event OnInit() thisArmor = self.GetBaseObject() as Armor If thisArmor.haskeywordstring("ArmorBoots") Debug.MessageBox("these are boots") EndIf EndEvent Event OnEquipped(Actor akActor) Debug.MessageBox("equipped") EndEvent If that displays the boot message correctly for the boots you were testing, then the issue is solved.
  13. All three scripts are in the spoiler tag in the 3rd post. The primary script we're dealing with here extends an object reference. Specifically an armor, it is designed such that the same script should be able to go on any armor. Currently you have to tell it via an armor property what the armor is the script is attached to, then from that it uses the keywords to determine the values for the armor. The goal here is to save time and not have to tell each script which armor it is on. I suppose I haven't tried casting the GetBaseObject() command but it would seem that if the raw command returns None then casting that wouldn't do me any better. self.GetBaseObject() very well could have returned None, its been a while since I tested that and I can't remember exactly. Don't really have time at the moment to go back and do it again, have a Java lab to finish up for Tuesday.
  14. Tried that, didn't work though. GetBaseObject() just returns a None. So far I've tried: GetBaseObject() - returned None self - returned the script self.GetBaseObject() - can't remember what it returned but it wasn't the armor GetFormID() - returned 0 probably some others I can't remember as well The only thing I can think of is checking which block OnContainerChange of the incoming object or OnItemAdded() on the player triggers first and if it is consistent.
  15. I've tried that, self apparently refers to the script itself and not the object it is attached to.
×
×
  • Create New...