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

GetStage with sripting


Dragten
 Share

Recommended Posts

Good day.

I have stumbled on another problem with his wretched papyrus language.

I have decided to update my Colored Dragonscale Armor mod, and the last thing I need to do is to allow players a legitimate way of getting Alduin's scales.

I have decided to do it via an activator, which should check whether the player has or has not completed the main quest, and give the scales accordingly.

By looking at the "Tale of the Tongues" dialog, I found out that having MQ306 quest stage above 0 means that player has killed Alduin in the final fight.

So here is a little script I have put together. Sadly, absolutely nothing happens when I activate the object (tried the "default" lvl1 character you get when doing COC from main menu), and I am confused.


Scriptname Dr_CDS_alduin extends ObjectReference  


miscobject property AlduinsScales auto

quest property MQ306 auto


Event OnActivate(ObjectReference akActionRef)



	if (MQ306.GetStageDone(5))

		Debug.Trace("You should have gotten the scales now.")

		Game.GetPlayer().AddItem(AlduinsScales, 19)


	else

		Debug.Trace("Nothing Happens")


	endIf



EndEvent

Any thoughts on what could possibly be wrong?

-----EDIT-----

I know that I am missing the > in there, but I really have no idea where it should be placed in the syntax...

The test was mostly to see if I can get the message from "ElseIf"

Edited by Dragten
Link to comment
Share on other sites

Try casting an Actor to the akActionRef variable:



      If((akActionRef as Actor) == game.getPlayer())


                if (MQ306.GetStageDone(5))

                        Debug.Trace("You should have gotten the scales now.")

                        Game.GetPlayer().AddItem(AlduinsScales, 19)


               else

                        Debug.Trace("Nothing Happens")


               endIf


       EndIf

Edited by ThomasKaira
Link to comment
Share on other sites

GetStageDone (isStageDone) returns a 'boolean'. So I am not sure where you would want to place the '>' symbol in there.

Are you sure the script is attached to the activator, and that the references are linked in the objects script?

I personally don't like using 'Debug Trace' as I want to see 'in-game' that its working. I use 'Debug messagebox'.

http://www.creationkit.com/MessageBox_-_Debug

Link to comment
Share on other sites

Amazing, thank you very much for the help, the script works now.

Lvl1 Default character gets no scales, while my main character with completed main quest gets the scales.


Scriptname Dr_CDS_alduin extends ObjectReference  


miscobject property AlduinsScales auto

quest property MQ306 auto


Event OnActivate(ObjectReference akActionRef)



	if (MQ306.GetStageDone(5))

		((akActionRef as Actor) == game.getPlayer())

		Debug.MessageBox("You should have gotten the scales now.")

		Game.GetPlayer().AddItem(AlduinsScales, 19)


	else

		Debug.MessageBox("Nothing Happens")


	endIf



EndEvent

Now, another question.

How can I disable the activator after it ran the script 1 time? How would I define the activator itself?

Link to comment
Share on other sites

If the script is on the activator, and you want it to disappear, you do this:

disable()

Or you could set a variable and if the variable is set, don't do anything.

So just like this?


Scriptname Dr_CDS_alduin extends ObjectReference  


miscobject property AlduinsScales auto

quest property MQ306 auto


Event OnActivate(ObjectReference akActionRef)



        if (MQ306.GetStageDone(5))

                ((akActionRef as Actor) == game.getPlayer())

                Debug.MessageBox("You should have gotten the scales now.")

                Game.GetPlayer().AddItem(AlduinsScales, 19)

                disable()


        else

                Debug.MessageBox("Nothing Happens")


        endIf



EndEvent

Will test it tomorrow and see if it works

Edited by Dragten
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...