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...

[SKY] Need for script-1


Leodoidao
 Share

Recommended Posts

Greetings.

 

I am making quests for Sungarde and I´m in need for some simple scripts. I would like to use them in actors and objects, since my first experience with Papyrus was not very pleasant. 

 

1- A script to an object, when I get it quest stage changes to next;

 

2- A script to an object, when I get distance "x" from it quest stages changes to next

 

3- A script for an actor, when he gets killed quest stages changes to next.

 

Anyone could help? :unsure:

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

I already posted a script for 2 on Nexus. In case you didn't see it:

 

Scriptname SetStageOnDistance extends ObjectReference

Quest Property myQuest auto
int Property StageToSet auto
int Property Distance = 140 auto

auto State WaitingForPlayer
	Event OnCellAttach()
		RegisterForSingleUpdate(1.0)
	EndEvent

	Event OnUpdate()
		
		If self.GetDistance(Game.GetPlayer()) <= Distance
			myQuest.SetStage(StageToSet)
			GotoState("done")
		Else
			RegisterForSingleUpdate(1.0)
		Endif
	EndEvent

	Event OnCellDetach()
		UnregisterForUpdate()
	EndEvent
EndState
	
State done
	;do nothing
EndState
Edited by Ghaunadaur
  • Upvote 1
Link to comment
Share on other sites

I will write an in depth article, but for now,  if you understand how to make dialogue, then I will assume

you can follow this:

 

Example how to make stage advance, when actor dies.  NOT USING ALIAS

 

;place this on the ACTOR base edit or the reference.

 I recommend you put the script on the actor that you dropped into the render window.

 

1.  Create your actor that will die and set off the event.

2.  Create your stages that will advance AFTER the actor dies.

3.  Create your Objective Displayed that will advance AFTER actor dies.

4.  Create a new script in your referenced actor, the one that will die.

     A.  It will ask questions like what the name of the script is.

            Format:    OnDeath+name of your quest+name of your actor

           Example:    If the name of your quest is   FlagonFlyer      and your actor's name is "Deep in his Dreams"

                       Your script will be called  OnDeathFlagonFlyerDeepInHisDreams

 

      B.  It will ask what it will EXTEND.  Choose Object reference.

 

      C.  You will now have an empty script window with the starting script command line:

            Scriptname OnDeathFlagonFlyerDeepInHisDreams extends ObjectReference

           

      

 

The following is a script I created for my quest.  It is already play tested and works.

I deleted other commands that are not related to your question.

I renamed the variables so they don't conflict with our mods.

 

Scriptname OnDeathFlagonFlyerDeepInHisDreams extends ObjectReference 


Event OnDeath(actor killer)
       QuestDeath.SetStage(17); this means he was killed
       ;remember to set property for the actor and quest property QuestDeath
EndEvent


Quest Property QuestDeath Auto  

 

  • Upvote 1
Link to comment
Share on other sites

                     Alias Version.  On death actor will trigger a stage advancement.

 

1.  Create your actor that will die and set off the event.

2.  Create your stages that will advance AFTER the actor dies.

3.  Create your Objective Displayed that will advance AFTER actor dies.

4.  Steps for the alias.

     A.  You created the actor and have clicked on the box 'UNIQUE" in the general tab.

           If you have not clicked on 'unique' because the actor isn't unique, then you

           will have to click on 'Specific Reference' and click on the 'Select Force Reference'

           and click on your actor that you dropped into the render window.

           There are arguments that this way slows the game down.  I have no way of knowing.

           I have so far,  made unique characters to drive a story line.

     B.  Double click on the quest you created, the one with yellow and question mark on it.

           Worldspace window - must be using INTERIOR.

            Click on Character.  Click on Quest.  Find your quest and open it.

          Click on the tab labled Alias.

           Right Click  and click on 'NEW'

           In the field called 'Alias Name'   type a shortened version of your npc. 

               Example:  Deeps

           Click on the check box 'UNIQUE ACTOR'.  The original name of your actor will appear.

            This makes your job finding your actor, easier.  It only finds actors that were made unique.

            What this does is assign a nick name to an actor that you had already created.

             The quest would have to start or the nick name and script won't be assigned.

        C.  You can make the alias 'essential' if you want, but for the purpose of this thread it is not necessary.

        D.  With the alias tab still open, you will see a 'SCRIPT' portion on the right.

              Create a new script in this area.

                Right click in the script box.  Click 'add new'

                A list of available scripts will appear.  Click on 'new script'

                  1.  It will ask questions like what the name of the script is.

                       Format:    OnDeath+name of your quest+name of your actor

                       Example:    If the name of your quest is   FlagonFlyer      and your actor's name is "Deep in his Dreams"

                       Your script will be called  OnDeathFlagonFlyerDeepInHisDreams

 

                    2.  It will ask what it will EXTEND.  Choose Reference Alias

 

                    3.  You will now have an empty script window with the starting script command line:

                         Scriptname OnDeathFlagonFlyerDeepInHisDreams extends ReferenceAlias

         

 

Scriptname OnDeathDeepInHisDreams extends ReferenceAlias

Quest Property QuestDeath Auto
ReferenceAlias Property Deeps auto

Event OnDeath(actor killer)
        QuestDeath.SetStage(17); this means he was killed
          ;remember to set property for QuestDeath and Deeps.

EndEvent

 

 

 

 

*notice  the number 17 is the NEW stage that will be set.  Replace 17 with the number of the stage YOU

             are setting it to.

             

Compile.

Save.

 

*note:  QuestDeath and Deeps are variables.  You must assign them by single click on your script name.

            Click on 'properties'.   Those 2 variables are there.  Top right corner is where you click on the

            drop down and tell the QuestDeath what stage number it will be.  Then click on Deeps and tell it

            what the name of the reference actor it is referring to..  Example:  DeepInHisDreams

 

Must not have any compile errors.

Quest must already be started for aliases to work.

Edited by Ashenfire
  • Upvote 1
Link to comment
Share on other sites

And of course via dialogue.  Which I have done via Story Manager.  So I believe we can help with it. 

That was exactly the part that caused trouble. The scripts "GetOwningQuest().SetCurrentStageID(10)" and "GetOwningQuest().SetObjectiveDisplayed(10)" at the quest dialogue's end box stopped working by unknown reasons (a big fat bug, I suppose). They worked in the beginning, then I deleted one of the dialogue topics (the one with these scripts  at the "end" box)  and the scripts just stopped working at all!! :sad:

Edited by Leodoidao
Link to comment
Share on other sites

Its up to you, but if you want, I can take a look at it. I can add a Story Manager event to activate the quest.

Instead of rewriting your quest, maybe you should get that part done first.

I have not written a Story Manager event 'How To' yet. It is sort of long and dry. Coming soon! :blink:

It has been known to work then you follow the same exact steps and for some reason it won't work

for the second quest :shock: . I have to write my quest in 'phases' because it can break at any time.

I can easily have 30 .esp files of the SAME quest because I am paranoid my Story Manager portion will break.

What I am saying, is that you might not know when you have done it all right and I want to make sure that you

get a chance to tell your story and not have it 'ruined' because of mechanical issues. This will make you defeated

and will make you go off course trying to fix or change your story which is :offtopic: to your success.

Edited by Ashenfire
  • Upvote 1
Link to comment
Share on other sites

Acquire item and set a stage.

 

Click on 'GamePlay' at the top, in your creation kit.

Click on 'Papyrus Script Manager'

Click on 'Filter' field box.  

Type      'Default SetStage'

Look for the script that is named   'DefaultSetStageOnPlayerAcquire' or its sister 'DefaultSetStageOnPlayerAcquireItem'

Open either one of them.

Verify they meet your quest criteria with variables.

Close

Open Properties and set them to your quest requirements.

If you need to modify it then save as 'new' and name it for your quest purposes.

Place your script on the item that will be picked up in the game that will change stages.

Edited by Ashenfire
  • Upvote 1
Link to comment
Share on other sites

Well, I will try this in the weekend (no time for modding right now), anyway I must thank you again and again for all your patience and help for my project! Of course there will be some special thanks in the readme in case I can accomplish my quest. I will provide you some feedback until monday. Take care! :buddy:

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...