ebondream Posted January 27, 2016 Posted January 27, 2016 So I've very hesitantly started wrestling with the Creation kit and Papyrus, and may well be in over my head. My attempts at trying out various small things have failed so far--once my head's cleared, I'm gonna try to study the various tutorials and wikis floating around more attentively. In the meantime, I would be very grateful if someone could show me the script that'd be used if I want to have an object that when activated (OnActivate Event) displays a text box with the player's current bounty in Whiterun Hold. Being shown a working example of that script would help me wrap my head around a few things, I think.
Guest Posted January 27, 2016 Posted January 27, 2016 Faction Property CrimeFactionWinterhold Auto Event OnActivate(ObjectReference activater) Debug.MessageBox("The bounty for the Player in Whiterun for the crimes is " + CrimeFactionWinterhold.GetCrimeGold() + " and the bounty for non criminal activities is " + CrimeFactionWinterhold.GetCrimeGoldNonViolent()) EndEvent
Guffel Posted January 27, 2016 Posted January 27, 2016 Faction Property CrimeFactionWinterhold Auto Event OnActivate(ObjectReference activater) Debug.MessageBox("The bounty for the Player in Whiterun for the crimes is " + CrimeFactionWinterhold.GetCrimeGold() + " and the bounty for non criminal activities is " + CrimeFactionWinterhold.GetCrimeGoldNonViolent()) EndEvent @ CPU: I guess you mean CrimeFactionWitherun don't you?^^ A word for explainations, Skyrim track two values of bounty, one that you get through hurting people (violent) and the other (non-violent) through anything else (trespassing, pickpocketing, stealing). I don't know why it's done this way, but the bounty you see sometimes in the game are both values added together.
ebondream Posted January 27, 2016 Author Posted January 27, 2016 Hmm, trying it out and I keep getting 0 for both values, whether I change it to Whiterun or not. But at least the scripts compile now, so gonna keep trying a few things...
Guffel Posted January 27, 2016 Posted January 27, 2016 Hmm, trying it out and I keep getting 0 for both values, whether I change it to Whiterun or not. But at least the scripts compile now, so gonna keep trying a few things... Where did you put the script? Did you fill the property of the Crimefaction correctly?
ebondream Posted January 27, 2016 Author Posted January 27, 2016 Hmm, trying it out and I keep getting 0 for both values, whether I change it to Whiterun or not. But at least the scripts compile now, so gonna keep trying a few things... Where did you put the script? Did you fill the property of the Crimefaction correctly? I attached it to an activator (WETempActivator, just to test things). And I put in the script basically as CPU posted it, starting with Faction Property CrimeFactionWhiterun Auto Which I thought would take care of everything...
Guffel Posted January 27, 2016 Posted January 27, 2016 Then you need to fill in the property. The line Faction "Property CrimeFactionWhiterun Auto" sets the crime faction a bit like a variable for the script to work with internally, but you still need to set where it is actually pointing at. When you open up the activatery on the right side hit edit properties -> select the crime faction -> hit edit value -> select "CrimeFactionWhiterun" from the list. If you worte everything right hitting auto-fill should also work.
ebondream Posted January 27, 2016 Author Posted January 27, 2016 oooh---yeah, I definitely have to read up on this a bit more That worked, thanks a lot!
ebondream Posted January 27, 2016 Author Posted January 27, 2016 Okay, while I'm at it: I'm now slowly learning how to use the SexLab Hooks to make certain things happen--to create a message whenever a sex animation ends, for example. But I'm a bit confused as to how I'd check, for instance, whether the sex animation that just ended involved a particular type of character, a Whiterun Guard for example. EDIT: Actually, figured it out. Go me
ebondream Posted January 29, 2016 Author Posted January 29, 2016 Alright, another question: If I use the OnEquip event, how can I check which slot the item was just equipped to (specifically, whether it's chest armor/clothing)? Do I have to do it via keywords?
Veladarius Posted January 29, 2016 Posted January 29, 2016 The command you want is GetSlotMask http://www.creationkit.com/GetSlotMask_-_Armor
ebondream Posted January 29, 2016 Author Posted January 29, 2016 Hmm, but do I see correctly that if I want to catch everything that covers the chest/body, I have to check for a lot of different potential values of the SlotMask there? Since there are things like robes that cover various combinations of body, head, hair... I'm guessing the Keyword thing (checking for ArmorCuirass or ClothingBody) would work except for armor added by other mods that didn't put those keywords in?
ebondream Posted January 29, 2016 Author Posted January 29, 2016 And while I'm at it, I may as well pile on my impossible problems... I don't suppose there's a way to essentially add a dialogue choice when a guard is arresting you? (The bit where you have to choose jail, paying bounty, fighting etc... I'd like to have an additional option) At any rate I'm guessing not without changing vanilla files...
Veladarius Posted January 29, 2016 Posted January 29, 2016 Hmm, but do I see correctly that if I want to catch everything that covers the chest/body, I have to check for a lot of different potential values of the SlotMask there? Since there are things like robes that cover various combinations of body, head, hair... I'm guessing the Keyword thing (checking for ArmorCuirass or ClothingBody) would work except for armor added by other mods that didn't put those keywords in? I think you can just look for an individual slot but I am not entirely sure, I have not tried it. And while I'm at it, I may as well pile on my impossible problems... I don't suppose there's a way to essentially add a dialogue choice when a guard is arresting you? (The bit where you have to choose jail, paying bounty, fighting etc... I'd like to have an additional option) At any rate I'm guessing not without changing vanilla files... I think it would need to be added to the arresting dialogue though it may conflict with Prison Overhaul as I think that modifies that as well.
Guffel Posted January 29, 2016 Posted January 29, 2016 The OnEquip event must be on the item itself to trigger. I guess what you want is OnObjectEquip to listen for the player to equip something. This then goes in a script attached to an alias pointing to the player. I'd be enough to check the slot mask of the chest slot for most armors/ robes since they are usually at least equipped in that slot. As you already seen yourself, mod added armor might do it diffrent and use a diffrent slot, but still cover the body. If you see non-vanilla armor/ chlothes a common thing in your mod it wouldn't hurt to check for both. You could do it like this: Keyword Property ClothingBody auto Keyword Property ArmorCuirass auto Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) If akBaseObject.GetSlotMask() == 0x00000004 || akBaseObject.HasKeyword(ArmorCuirass) || akBaseObject.HasKeyword(ClothingBody) ; do stuff endif EndEvent This checks if the equipped objects goes in the chest slot, if not it checks if it has the ArmorCuirass keyword, if not it checks if it has the ClothingBody keyword. That seem rather foolproof to me^^ * * * You can add new dialouge lines to vanilla quests without any problems. Though you can easily mess something up^^ New dialogues don't produce conflicts, since they don't acually override somethinge. Even if two mods add new options to the same dialogue both would be displayed since they simply exist next to each other. To add a new option to the crime dialouge you need to go into the DialogueCrimeGuards quest to the player dialogue tab (the dialogue view tab is way to full here). The next part is a bit difficult so I made some screenshots. Go to the ForceGreet Branch and create your own topic among the others. Then you need to link you new option to the existing dialouge so it show up in game. Got to the HelloBlocking branch and doubleclick the lower two dialogues. On the left side right click and choose add link. Here select your the first level of your new dialogue. Do the same in the wanted branch for the lower three dialogues. Don't thoug the dialogues with the red line, beause these are very important for the Forsworn Consiracy quest in markarth. Now you should better test in game to see if it worked and if the normal options also are still there^^
ebondream Posted January 30, 2016 Author Posted January 30, 2016 The pics don't seem to load for me :/ Will try and see if I can still manage it. But what I meant about the amor. isn't the problem that an item's SlotMask value equals to the sum of all the slots it occupies? So If akBaseObject.GetSlotMask() == 0x00000004 Only catches armors that cover the body and -only- the body. Whereas the Archmage Robe for instance seems (via its ArmorAddons I guess? To cover the head, hair and circlet slot as well. I tried making a chest that sends me a message box with the SlotMask for every item I put inside--I get 4 for most armor and clothes, but the Archmage Robes gets me 4102. But yeah, I guess in combination with the keywords it should catch most things... EDIT: The dialogue bit seems to work, thanks for your help
Guffel Posted January 30, 2016 Posted January 30, 2016 OK, then slotmasks work diffrently then I thought^^ I edited my last post and the pics should appear now.
ebondream Posted January 31, 2016 Author Posted January 31, 2016 Still don't load for me, but that may well be a problem on my end. I'm pretty sure I got things working with the dialogue anyway, your guide was easy enough to follow And the armor thing was actually easier to solve than I thought: Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) Form Cuirass = Game.GetPlayer().GetWornForm(0x00000004) if Cuirass == akBaseObject Debug.Messagebox("That was chest armor") else Debug.Messagebox("That was not") endif endevent I get a few weird additional notifications on testing that but I think that's because of what some other mod is doing and the definition is obviously too broad.
ebondream Posted February 1, 2016 Author Posted February 1, 2016 Hmm. Don't suppose there is a relatively easy way to get a script to fire everytime, say, the PC kills a bandit? Since OnDeath has to be attached to each actor...
Guffel Posted February 1, 2016 Posted February 1, 2016 Hmm. Don't suppose there is a relatively easy way to get a script to fire everytime, say, the PC kills a bandit? Since OnDeath has to be attached to each actor... Yes, I'm afraid there is no easy way. Maybe there is a workaround, but that depends on what you exacty try to do.
ebondream Posted February 1, 2016 Author Posted February 1, 2016 New question: is there any equivalent to the OnSleepStart event that works for the "Wait/Rest" window (T hotkey) instead?
Guest Posted February 1, 2016 Posted February 1, 2016 No, I am not aware of a single way to track these events.
ebondream Posted February 1, 2016 Author Posted February 1, 2016 Ok... What about tracking if/how long the player has been mining/quarrying/woodchopping? Or failing that, can the OnItemAdded event somehow be used to track whether a piece of firewood was acquired via woodchopping, as opposed to picking it up or buying it from a vendor?
Guest Posted February 2, 2016 Posted February 2, 2016 Try an event OnItemAdded, it has the "container" property, do just a simple debug.trace to see what the container is, and try to quarry, wood-chop, and buy. And see what the containers are.
ebondream Posted February 2, 2016 Author Posted February 2, 2016 Gonna try that. And another one: is there some way to 'store' a Location that I got with GetCurrentLocation as a global variable or such, so that another script (or another event in the same script) can use it?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.