Jump to content

Sandbox activity triggering scenes?


ghastley

Recommended Posts

I'd like to implement a more complex activity than can be handled by a simple furniture or idle marker as part of the sandbox activity. For example, chopping wood, and also carrying it to the pile, or fetching water in a bucket from a stream. All the examples I found in the game have a separate scheduled AI package for those, not a sandbox one, 

I can't see any reason that an empty idle marker could not have a script to start a quest that just has a scene, or maybe just an alias package, that makes the NPC activating the marker go do the whole sequence. I would assume that the sandbox package would get interrupted, and resumed after the mini-quest finishes. But if so, why didn't it get done before?

If anyone knows, stop me before I attempt the impossible.

 

Link to comment
Share on other sites

Interesting question, but I don't see how you would attach a script to an idle marker, since the idle marker can only have idle animations which you can configure to run at random, in sequence or to run once. Maybe turn it around. Start with the mini-quest and force a NPC to use the idle marker or markers. Or, maybe create a new and more complex package template. 

Link to comment
Share on other sites

I did something recently similar-ish to this. I used an empty dialogue with getdistance <100 (or whatever) to an x-marker with a script fragment attached to the dialogue to start the scene. So the NPC goes near the marker, says 'nothing' but the scene is started.

Link to comment
Share on other sites

No need for quests or scenes for that, just create a custom AI package with a mix of multiple locations and sandbox.

Link to comment
Share on other sites

The problem I'm trying to get away from is that Sandbox is a base-level Procedure, That means that it can't be used to select the actor's next activity unless it's using a furniture or idle marker.

Yes, the package stack can be conditioned on a dice-roll, so the same package doesn't get selected every time, but that puts the onus back on the mod-maker to make the choices. My hope was to use the selection logic inside Sandbox to allow compound activities to be triggered from an idle marker.

It's also unclear if the Sandbox procedure completes after each activity, and re-starts the stack, or if the actor gets "captured" by the sandbox until the schedule cuts off. The wiki says a sandbox never completes, so you would have to use a simultaneous Wait to break free and re-evaluate the other packages after a time. Otherwise the other packages have only one chance to be used (per day). CarryandDropItem and CarryandKeepItem packages do complete, at least. But all uses of those two seem to leave the actor repeating them, as they are the first on the stack for the scheduled period, without any random condition to prevent it. Why?

I looked at the SawMill packages and found them conditioned on the state of the mill. That means the Load package only runs if there's no log loaded, and the Saw package runs if one is ready.. But I still can't see how Hod (or any other operator) gets out of their sandbox package once the mill's state puts them into that. Unless dialogue with the player does that part?

Random and sequenced branches inside a package have the same issue of unending Sandbox procedures capturing the actor, it appears.

Link to comment
Share on other sites

The mill operator gets out of their sandbox package by two conditional scripts: ResourceObjectScript (parent) and ResourceObjectMillScript (child). The latter script sets a state variable (ResourceState_var) to -1, 0, 1 or 2. The ResourceObjectMillScript is attached to ResourceObjectSawRiverwood (furniture) for the Riverwood sawmill.

Edited by Altbert
Link to comment
Share on other sites

I came to the conclusion that the wiki is wrong, and the Sandbox procedure completes after each activity, but typically restarts because nothing else qualifies.

The mill workers have packages they can do if that state variable indicates a log can be loaded, or sawn, which take priority over the Sandbox package. The mill furniture is marked as "not for sandbox" so it only gets used in one of those states, but I suspect that also serves to prevent other NPC's from using the mill. The -1 state is "destroyed" which would mean that a Civil War sabotage has made it unusable. I haven't done the CW quests for so long, I've forgotten if that was implemented. The other state is "busy" while the sawing animation is in progress and there's nothing an actor can do. So the mill worker will either load a log, or work the lever, or stand idle at one of the idle markers, assuming there's no other sandbox targets in range.

I gave up on the Carry Bucket packages after I watched them in game. It appears that Hana made an attempt a few years ago to make them usable, but gave up, and the actor still carries the bucket in an unnatural way that would not hold water.

Carry Firewood is viable, and I intend to try hooking a single use of that package to an idle marker. If that fails, there are other ways I could make it not repeat at the top of the package stack.

The main reason I want to hook these "activate a multi-step process" things to idle markers is so that I can replace a furniture or idle marker with one, and have it become part of the sandbox activity without having to edit the actor. If there are multiple NPC's with the same packages, that makes the effort that much worse. The problem of two or more NPCs wanting to use the same one become harder to solve, too, especially if they all get the same packages with the same schedules. Those things are all sorted out inside the Sandbox procedure, and so I want to leverage that if I can.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...