Jump to content

Starting a mod, scripting question.

Guest Suited Prawns

Recommended Posts

Guest Suited Prawns

So im starting a mod which requires for the player to be able to talk to any Npc, Then to choose to be dominated by them. Ive got some script experience so i wanted to share what i was thinking for handling the storing of the owner, so i can pull him if i for example need to add dialogue options. Hope that makes sense. So if you guys know a different way to do this or could suggest the best one.

So these are ways ive seen used before:
Using a token: 
Adding an item to the actors inventory, this works well because you can pull it by script and there's a dialogue condition for it.
Using a faction:
This one has a condition as well which will allow me to to do dialogue easily, but i think   you cant really get to the single people in the fac( Though I wouldn't know )

Then there's from list, but they are pretty much the same as factions.

I guess using an alias would be possible but how that's done sadly beats me... 


This is my sad comprehension of scripting, I'm gonna see if i cant crack open sanguine's debauchery enhanced some time. Hope you can decipher my ramblings. ;P :/

Link to comment

Please explain better what are you trying to accomplish.


My understanding:


You have a dialogue that the Player can start (always?) and will bring to some actions.

You want to condition this dialogue based on something.


You can condition on the player (if the player has this item, or if the player is in this faction, ...) or you can condition on the NPC the player is talking to, or you can condition on aVMQuestVariable


If you want to condition on an item in the player inventory be aware that if the player will remove the item your dialogue will not work. (May be exactly what do you want)

If you want to condition on an item in the NPC inventory then you ave to add this item to the NPC in some way.

Factions work pretty much the same, but the player cannot add or remove itself automatically by a faction. So you may have more control. For the NPCs is the same as the item. You need to assign the NPCs to the faction in some way.


Link to comment
Guest Suited Prawns

Basically im looking for the best way to store any npcs information, so that I can later use it any time I need the player to interact with them. For example adding special dialouge. I know theres many ways to do this and I wanted to ask which way gives me the most options. I really hope that explains it. :/

Link to comment

The best method would depend on some things:


If you want to have a large number of npc's adding them to a faction or list will let you identify them easily but not much more.

If you intend to use scenes or add custom AI packages to them then an alias is the best option.


You can do a combination of these by using the faction to start things then set the alias to the npc currently in use and everything can be directed towards the alias after that. When you are done with the npc the alias can be cleared and it would effectively disable any dialogue directed towards it.

Link to comment
Guest Suited Prawns

Id just like to say thanks for the help so far, even small input is valuable :D.

Since I don't have allot of experience with aliases(I dont think we even had em in the geck) I read the CkWiki entries about them, but the articles are kindoff specific. Does anyone know of any good tutorials on aliases? I could probably manage to figure it out, but doing it right from the get go would be nice.


Link to comment

There are two type of aliases: Reference Alias for Actors and Location Alias. In the other post Veladarius was referring to Reference Alias.


A reference alias is something defined inside a quest to point to an actor.

The actor can be specific, can be a unique actor base, or can be randomly selected through conditions.


When an actor is placed inside a ReferenceAlias (e.g. myRefAls.forceRefTo(myAcotr)) then factions, script, and packages that are associated to the alias will be forced to the actor. With high priority.


Aliases can then follow what you specified. Aliases are also used inside the Quest' Scenes to play a role (execute packages, say something, wait some time, etc.) in this case, for complex scenes it is important to defined if an alias is optional or not. If an alias is NOT optional and you use it in a scene, then the scene will NOT start if the alias is empty.


Link to comment
Guest Suited Prawns

So it basically allows me to create a form for an actor, and then shove any actor into it and he/she will then follow the directions that alias was given.

  If I wanted to create a scene between the player and an npc, id fill one alias with the players info, and the other with the the actors. 

I guess that really is the smartest way to go about it, in previous attempts of making this mod it was all very messy Papyrus fragments of which I'm not proud of.

Link to comment

More or less you are right.


Keep in mind that if an alias has the player and the player (through the alias) is involved in a scene, it will NOT say anything or execute any package. Unless the player is AI driven. Game.setPlayerAIDriven(true). If you do this the human player cannot control the player. So don't forget to give back the control when the scene is played.


Second point, you cannot really have a conversation during a scene. The player will not have the branches to select what he/she want to say.


If you need this then you have to use dialogues. Dialogues do not require aliases.



Papyrus fragments are not bad. My only recommendation is to have a separate script that is your main controller (probably inside you main quest), and then invoke the functions of your main script inside the fragments.

Too much code in a fragment is hard to improve.

Link to comment
Guest Suited Prawns

I have to thank both of you very much for the help, and if I have any more problems I know where to turn :P For now its sleep time.

Link to comment


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...