Jump to content

Creation kit, help needed with papyrus...


Recommended Posts

Hello, I am currently in the process of adding new features to my mod which revolves around poisoning npcs /actors with foods, Someone had requested on the mod page that I could add the ability to poison an npc through dialogue e.g "Hello, have a (poison) apple" . I have played about with papyrus before with quest scripting but I am unaware of how to go about the following...

 

1. Making the dialogue global (applies to every npc, hopefully every non-essential npc.)

2. Getting the game to check if the player has the poison apple in the first case so they can initiate the dialogue.

3. If the player has the poison apple, the apple is then removed from the players inventory.

4. I was hoping that I could make the npc play an eating animation when the apple is removed.

I have already found topics on the internet to kill the actor/npc. (By setting their health to 0.)

 

 

For relevance here is my mod - http://www.nexusmods.com/skyrim/mods/51135/?

 

I would be most grateful if someone can help me :)

 

Link to comment
Share on other sites

If you have Hearthfires, look into the gift options for giving things to the kids. That would show you how to setup the dialog and get the gift inventory displayed so that the player can give them the poisoned apple. A condition on the dialogue could be used to only allow it if the player has one or more of the poisoned apple.

 

After that, the poisoned apple itself could have a small script that detects container changes and if the new container is an NPC and the source container was the player, start a quest which fills an alias with the new container data as an actor. A script or package on the alias might get them to "eat" the poisoned apple. After the NPCs death, stop the quest so it can be reused on the next NPC.

Link to comment
Share on other sites

Little more detail since you may be at a loss lol

 

 

There are two conditions to add to the dialogue

 

ISessential and I believe set this to 0

getitemcount youritem > 1 Run on player

 

 

Then in the alias part create a new alias, name it whatever, I think you dont even have to fill in anything for how I am going to explain this

Go to the scene tab, create a new scene with that alias, add a package and the package would be "Do Nothing" under the beginendchange tab on begin there is a box to select idle, one of the idles is eat standing etc, add that

back to the scene tab add a timer then add a basic function utility.wait(0.1) to gen a script, add a property, make the property a aliasreference make it point to your alias

then add a new line in the script utility.wait(3.0) *Give them time to eat* then MyAlias.GetActorReference().kill()

 

Now you have the scene and firing and filling it are easy

 

 

 

Now back to that dialogue, you need to add a basic pap frag so ""Utility.wait(0.1)'' will trigger a script to be made

Then add 3 propertys, one being a reference alias, pointing to your alias in the quest, one being the scene you created, and lastly one being a misc item pointing to the poison apple property

 

Add these lines to the end fragment

 

Youralias.ForceRefTo(akspeaker)

game.getplayer().removeitem(appleproperty, 1)

utility.wait(0.5) ; Gives time for the alias to fill etc

Scene1.forcestart()

 

 

 

That should actually work for ya :P

A scene with a do nothing package will never end on its own but default is if the alias dies the scene ends and well you should kill them with that :P

Make sure the dialogue is a goodbye to trigger the scene correctly

Also the alias might need to be optional

 

GL

 

And if that is all gibberish well then.. I give up :P

Link to comment
Share on other sites

 

Then in the alias part create a new alias, name it whatever, I think you dont even have to fill in anything for how I am going to explain this

Go to the scene tab, create a new scene with that alias, add a package and the package would be "Do Nothing" under the beginendchange tab on begin there is a box to select idle, one of the idles is eat standing etc, add that

back to the scene tab add a timer then add a basic function utility.wait(0.1) to gen a script, add a property, make the property a aliasreference make it point to your alias

 

I have followed your tutorial you provided me up until this point, im having difficulty understanding the basic function part, where do i add it? I don't know which menu in the scene creator to add it to?

 

Edit* I added the "utility.wait(0.1)" to the timer papyrus fragment but when I go to the properties menu everything is greyed out and it wont let me create a new property. Im really confused?

http://i1286.photobucket.com/albums/a618/Markaqaduckaduquengai/Untitled-1_zps9ed6d483.jpg

 

I managed to add a property, im not sure if i did it right because im getting an error when i go to compile the script saying there is no output for my scene -

http://i1286.photobucket.com/albums/a618/Markaqaduckaduquengai/Untitled-1_zpsbcf1d4a3.jpg

 

here is my property, in case i did it wrong... -

http://i1286.photobucket.com/albums/a618/Markaqaduckaduquengai/Untitled-1_zpsb867f142.jpg

 

and here is the error message i get when i compile -

C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SF_AAApplepoisontestSc_02002861.psc(10,0): variable AAAPosionappleAlias is undefined

C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SF_AAApplepoisontestSc_02002861.psc(10,20): none is not a known user-defined type
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SF_AAApplepoisontestSc_02002861.psc(10,40): none is not a known user-defined type
No output generated for SF_AAApplepoisontestSc_02002861, compilation failed.
Edited by markyboy444
Link to comment
Share on other sites

Alright once again I am going to point someone at mah videos :P

 

http://forums.nexusmods.com/index.php?/topic/1912704-easy-tutorials-for-the-ck-it-aint-that-complicated/

 

And no I'm not joking, they will probably help you a lot though not specifically tell you what to do in this situation though I do cover scripting and scenes and packages and scripting in scenes in the quest one

 

After you watch I would have no problems walking you through whats lef tto figure out via skype etc quickly after, but if you don't have a decent foundation knowledge I would just be all "bugger off" So please watch them and then hit me up if you still need help at darren.d23 on skype :)

 

And I could help you more from here but I kind of skimmed because I assumed a broader knowledge start. The vids I posted in that thread will easily give you that (I hope :P)

 

I just spent the last 9 hours testing and creating my Alpha trailer for discworld so I'm a wee bit burnt atm lol

Link to comment
Share on other sites

I would say all of them, I cover a lot of random s#*! but ya the quest one covers the scenes more and the scripting was just to get people more familiar.

I try to cover a lot of information as well as pointing over and over again to the papyrus reference page on the wiki, hell I used it like 27 times today at least lol

Also you untopped my discworld update so HA I'M GONNA POST MY ALPHA TRAILER HERE TO!! Time for me to pass the F out

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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