Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Accessing an actor's script via dialogue


Mysterious Mr. Bear
 Share

Recommended Posts

Helooo everyone! I try not to spam these forums with questions but this has me stumped and I know this place is teeming with genius...

The situation is this.

I have re-used, generic NPC's in my mod, meaning up to 100 of the same baseactor at a time. The long and short of it is, I want to be able to access the script and change the variables of each individual NPC (all with the same baseactor) via dialogue. This is proving... difficult, to say the least :P

The way I achieved this in a previous (oblivion) mod, was that by crouch-and-activating an NPC it activated a menu from within the npc's OWN script, and I could then change variables that way. However, this had it's own bunch of troubles, and relied on commands that are no longer present in skyrim.

The way I access the script of QUESTS is by creating a property


AAMBcDailySCRIPT Property Dailyscript auto

Which points me to the quest ID of the script. However, since I am using NPCs that all have the same baseID, this will obviously not work. Is there any conceivable way to achieve this or will I have to find some way to sidestep the problem again? I have been considering the following as a papyrus fragment in dialogue:

(getowningquest() as AAMBcBPdialogequestSCRIPT). aambcplayertarget = AKspeaker

(getowningquest() as AAMBcBPdialogequestSCRIPT). aambcplayertarget.scriptname. variableIwanttochange = 1

This would work by having a script named AAMBcBPdialogequestSCRIPT that is owned by the same quest as the dialogue. That script would hold the variable "aambcplayertarget" that would detect who it is the player is talking to- therefore, using

aambcplayertarget.scriptname. variableIwanttochange = 1

would HOPEFULLY change the variable of the actors script.

What does everyone think of this? Does anybody know a way of doing this anyway, that is similar? I hope I have explained everything properly!!!

Thankyou for reading this far,

Mysterious Mr. Bear :D :D

Link to comment
Share on other sites

There is another way. With the advent of Fallout, you can actually implement your own 'activation menu' under certain circumstances.

Its hard to explain, and I have only done it in FO3, which was several years ago, via a perk.

For example, you create a perk, and the 'Perk Entries' includes an 'Entry point' type.

Type is 'Activate', Function is 'Add Activate Choice', you give it a 'button label' which shows that text when you activate the object.

There are several things you can do, even add scripts.

The 'Conditions' section, you can add 'IsSneaking == 1', and perhaps a certain base actor is being activated from the 'Target' tab. Perhaps use the 'GetInFaction' and put all your NPCs you want in that faction.

It may or may not work for you, I really have not looked into it with Skyrim, but it might be worth a try.

Link to comment
Share on other sites

  • 2 weeks later...

There is another way. With the advent of Fallout, you can actually implement your own 'activation menu' under certain circumstances.

Its hard to explain, and I have only done it in FO3, which was several years ago, via a perk.

For example, you create a perk, and the 'Perk Entries' includes an 'Entry point' type.

Type is 'Activate', Function is 'Add Activate Choice', you give it a 'button label' which shows that text when you activate the object.

There are several things you can do, even add scripts.

The 'Conditions' section, you can add 'IsSneaking == 1', and perhaps a certain base actor is being activated from the 'Target' tab. Perhaps use the 'GetInFaction' and put all your NPCs you want in that faction.

It may or may not work for you, I really have not looked into it with Skyrim, but it might be worth a try.

Hi, sorry for the late reply, my internet has been down for quite some time!

I'm really stuck on this one. I have implemented my own solution to the problem, which is this:

My actor, Watchman01, has a list of 15 packages. Each package has a condition for the subject to have a certain spell. This means no package is active at all unless the subject has one of the 15 spells. I then added papyrus fragments to 15 dialogue options, each adding one of the 15 spells to the specific instance of watchman01 (of which there could be as many as 40-50). This means I could control the packages of specific instances of the same baseactor through dialogue!

However, I have a very, very unusual problem.

If the target of the package is in the same cell as the actor, he will happily stop what he is doing, walk to the new location, and begin sandboxing. I can move him around the worldspace with ease. However, if the target of the package is on the other side of a cell boundry, he will simply stand in place, refusing to move. eventually he goes back to his default editor location package. This is a major, major problem, since the centre of my camp happens to be on the centre of a cell devide. I have checked and refinalised the navmeshes but still this problem persists.

Now here is the strangest thing:

If I remove the hasspell condition from one of the packages, all of the watchmen01 instances cross cell boundries with no issue to reach the target!! Litterally, when I add a hasspell condition to the packages, they become incapable of crossing cell boundries. What the devil could be causing this??? (the spells are all set as abilities and have no magic effects if that makes a difference)

I hope I have explained this well enough, and that someone finds it and offers some help... SO stuck on this tiny tiny thing. Very frustrating...

Mysterious Mr. Bear

Link to comment
Share on other sites

Oh my goodness.

Through an entire day of trial and error, litterally the whole day, I have solved this problem. The solution was as inexplicable as the problem itself, and I am currently very confused, but very very happy.

I simply changed the "hasspell" condition on the packages from a "run on subject" to a "run on package data", and then created a single reference in the package that pointed to the package user. So it STILL basicly pointed to the subject, just via package data.

And now, it works across cells.

I challenge anyone on the face of the earth to tell me why :P In the meantime, I am going to have some pie, because I haven't actually took a break from this problem long enough to eat.

Edited by Mysterious Mr. Bear
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...