Jump to content

mjw

Members
  • Posts

    14
  • Joined

  • Last visited

Nexus Mods Profile

About mjw

mjw's Achievements

Apprentice

Apprentice (3/14)

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

Recent Badges

0

Reputation

  1. Ah, thank you very much! That solves this problem! Now I just need to figure out how to make an actor randomly pick one from a set of NPCs and travel there. I hope the solution there is just as easy.
  2. Since my latest attempt to delve into Skyrim modding yielded less than satisfying results, I decided to go back to basics. For some reason, certain AI packages don't work for me. And I don't get why. I have been trying for days now and finally decided to wipe my entire Skyrim installation and reinstall from scratch. Here is my test case: I tried to break it down to the most simple case possible: No other mods installed, no script extenders, nothing. Just vanilla Skyrim with the official DLCs. And Alternate Start so I don't have to play through the opening every time. Nothing else. One single cell, an empty square room with nothing in it. The navmesh is also just one big square. Just type 'coc testcell' to go there. The cell contains two examples of stuff that should work but don't. There is a scene where the player should be forced to walk to a certain spot. I put an XMarkerHeader to the location, set up a scene and gave him a package that just says: Travel there. But when I start it, nothing happens. I added another NPC to the scene that also gets this very same package. And for him, it works. While the player stands around, the NPC walks towards the marker! And I have no idea why. Type 'startquest testquest' to get it running. The second example is also in that cell. There are three more NPCs. Two of them have the keyword "TestTarget" on them. The third has an AI package that says: "Travel to linked reference, keyword TestTarget". But he doesn't. Like the player, he just stands there. Maybe I'm doing something wrong, but I can't figure out what. I read everything I could find, I watched tutorial videos that did the same things and it worked for them, I took a look at other mods and could not see anything that they did differently. Could maybe someone please take a look and tell me what's wrong? Or at the very least if the mod works on other machines (then I would know it's something local).
  3. Ok, a little update. After further research, I decided to build my own AI package. It's structure currently looks like this: - Sequence +-- Procedure: Find +-- Procedure: Travel In the Find procedure, if I set the target selector to a specific marker in the cell and then say in the Travel procedure that the NPC should go there, it works. The NPC actually walk towards that marker! Now if I leave everything else just like it is and only change the target selector to "Linked Reference" and set the keyword to "Patron", then the package is broken again and the NPC does nothing. Naturally, there are other NPCs in that very cell with the keyword "Patron" on them. So what am I doing wrong here?
  4. I want to make a waitress in a tavern who isn't just sweeping the floor but actually doing her job. Stuff like this was rather easy with simple scripts and an API that actually allowed access to stuff, like back with NWN. But now I'm at a loss. This is want I want her to do: Find a random actor in the cell who has the keyword "Patron" Go to that actor Stay there a moment (giving the impression that she's taking his order) Go to the cook or a marker near the cook Wait a bit (make it seem like she's telling him what she needs) Go back to the actor selected in 2 Wait a bit (handing over the meal) RepeatThis is only a first approximation, of course. One possible enhancement would be to assume that not all patrons always order something, so she would travel from patron to patron until someone places an order. What I tried so far: I can do it with scenes. That seems to work. Problem there: An actor can only be in one scene, so if I ever wanted to make another scene in that cell, I'd always have to stop the "busy waitress" scene first. And start it again afterwards. But that's just more work. More important: Actors in a scene are "busy", so you cannot talk to the waitress while she's going about her business. I tried scripts attached to the character. But I found no API function to get a list of all actors in a cell (let alone those with a specific keyword). There is a way with SKSE where I iterate through all references. Maybe I could do that in the OnInit event and put the ones I need into an array for later use. But there still is no API function to just tell an actor: "Go to that actor!" I know know you're supposed to use that package crap for it but again, no API function to alter packages. At least none that I could find. I can give her a travel package that I somehow make conditional on her being in the "seeking a patron" phase. But I cannot set the target of that travel package dynamically from within a script. I tried to use only packages. The plan was to have two alternating packages ("SeekPatron" and "SeekCook") and use conditions to determine in which state the waitress is currently in. Like an actor value or something that I could use to keep track of her state. To start slowly, I gave her one single package that just says she should travel to the reference with the keyword "Cook". No conditions, no schedule (always active), no interrupts allowed. And guess what happens in the game? Nothing. She just stands there staring holes in the air. I tried placing an XMarker near the cook and have her travel to that specific reference. But also to no avail. And yes, the walk mesh is fine (like I wrote above, when I start the scene, she moves just fine) I'm a little frustrated right now. With a documented API that had actually useful functions, I could've done this via script in half an hour. Now it's the second day I'm trying to do this and it still doesn't work. Anything else I could try? I think I have a cat around here somewhere I could sacrifice if it'll help.
  5. I see. That sounds interesting. If I understand it correctly, on the plus side, we would actually fix that very instance of the item to the player. The down side would be that I cannot give a customised message to the player (the CursedItemMsg from my first post). He'll just see a generic error message when he tries to remove the item. There is no event for a failed removal attempt, is there? I think I'll try both and then see what fits my idea better. If nothing else, I'll learn something from it.
  6. Probably a stupid question but how would I do that? The OnUnequipped event belongs to the item. I looked at the Event section in the wiki but I cannot find an event attached to the player or to a magic effect that fires when items are unequipped. Or should I just use OnUpdateGameTime to passively keep polling the player? I would need a high frequency for that (it would not help the atmosphere if the item got re-equipped 5 minutes later) and that would probably cause a lot of load on the CPU. Plus the wiki warns about crashes when the interval is too low. And I don't see any function in the Actor class that would get me a reference to equipped item. My current "solution" btw is to use a property in the script attached to each form pointing to the form itself. However, that probably only equips one of any number of items from that base form. No chance to define which one. Not sure if this can become a problem later.
  7. Hello! I am taking my first steps in Skyrim modding with scripts. I wanted to create a type of item that the player cannot remove once it is put on. Unless of course certain conditions are met, but those shall be a concern for later. Let's first just make the item stick to the player. Like the bomb collars in Fallout New Vegas (Dead Money DLC), if you know it. In theory, it should be fairly simple: We just put the item right back on if the player removes it in the inventory. Like this: Event OnUnequipped(Actor akActor) ItemCursedMsg.Show() akActor.EquipItem(self) EndEvent But unfortunately, it does not work. I can remove the item in the inventory. The message is shown but the item is not re-equipped. I assumed that the 'self' was the correct reference. After all, the script is attached to that object and I needed a reference. After frantically searching the CK wiki and coming up empty, I finally decided to try 'self' and it compiled. It just did not work. So how else do I get a reference to the item that was just unequipped? I read about a method where you use a quest to hold a reference to a specific item. But I don't think it's what I want - I don't want one specific instance to get re-equipped. I want all instances to be unremovable. So that they can be spawned randomly, have individual states and still be cursed (or not). Or is 'self' correct and I'm doing something else wrong? Any hints?
×
×
  • Create New...