Need help for Papyrus script. (little similar to blood extra

Post » Tue Jun 19, 2012 1:02 pm

Hey.
I have been working with modding ever since Morrowind. Mostly some few private projects.
I have not been doing much scripting, since I had no need for it, but I did try it once in Oblivion and thought it was not THAT hard, if one was to sit down and try to understand it.

Although, with a new mod in the works, I now need to create a few scripts in Skyrim. And it is a pain. The Papyrus language is much harder than I expected and there are way too many things that I yet cannot understand.
I have created a few scripts for the mod already, but I really need some help for the big (and very important) one.

Here is what it should do:


[1]* When the player has an armor item equipped, he will get a message, when clicking on some dead bodies (men, mer and creatures).


[2]* If the RACE of the dead creature = RACE1 property, go to STAGE1

[2.5]* If the RACE of the dead create = RACE2 property, go to STAGE2

etc with races


STAGE1,2,etc

[3]* If the state of the body is NOT "STATE1" (property), then a message box should come up

[3.5]* If the state of the body IS "STATE1" (property), go to [5]

[4]* The message box will ask, if player wants to preform "Action lalala" on the corpse.

[5]* If no - open loot

[6]* If yes - check if player has ITEM1 and ITEM2.

[7]* ^ If player does NOT have both or any of ITEM1 or ITEM2, go to [5]

[8]* ^ If player has both ITEM1 and ITEM2, remove the ITEM1 x1 and ITEM2 x1, set corpse state to "STATE1", add ITEM3 x1 to player


EndSTAGE


It must look rather complicated, and it is... Sadly, I cannot create it with my own skills and therefore ask for your help. Also, I am not too sure of how good the order is in that.

The script has a little similarity to the blood extractor (DA04) script. Although, looking at these scripts did not help me at all.

Also, I do not know if the first park of the script should be added to armor or perk.
If perk, then the armor item will just give the perk to the player when equipped and remove it, when unequipped. (I know how to do that)

So far, the only things I know how to do to these scripts is the beginning. Like this template:

Scriptname TESTSCRIPT1 extends ObjectReferenceMiscObject Property ITEM2 autoMiscObject Property ITEM3 autoMiscObject Property ITEM1 autoRace Property RACE1 autoRace Property RACE2 autoRace Property RACE3 auto;etc with races


And yeah, that is kinda all I can for that script :/
Will greatly appreciate any help you can provide.
User avatar
Brandi Norton
 
Posts: 3334
Joined: Fri Feb 09, 2007 9:24 pm

Post » Tue Jun 19, 2012 2:04 pm

seeing as you haev no replies (i know how frstrating that can be) ill throw some ideas in the mix, could very well be wrong though.
best way to do this would be to ahve the armour piece provide an enchantment which calls an effect script. THis script would extendactivemagiceffect.

I ahve no idea what event would be the best to use, but with regards to the race, it may be more efficient to search the target (dead) actor for a keyword. A lot of different races are conviniently grouped by keywords, (undead, actortypeNPC ActorTypeAnimal..beast etc).

keyword property beastauto

on whateverEVENT (returns the target actor)
if actor.haskeyword("beast") && \
(actor.isdead())
do your message box stuff
endif
endevent
User avatar
lucile
 
Posts: 3371
Joined: Thu Mar 22, 2007 4:37 pm

Post » Tue Jun 19, 2012 5:49 pm

Thanks, every bit helps, I will try it out to see what miracles I can make out of it :)
User avatar
jodie
 
Posts: 3494
Joined: Wed Jun 14, 2006 8:42 pm

Post » Tue Jun 19, 2012 7:35 am

Tried several ways of what you posted, sadly, no positive results.
User avatar
Brandon Wilson
 
Posts: 3487
Joined: Sat Oct 13, 2007 1:31 am

Post » Tue Jun 19, 2012 12:23 pm

Again, tried to do some things on my own.
Copied and edited a part of da04bloodharvestvictimscript.psc . It is the script, used in the DA04 quest, for blood harvesting off elves.

Even though:
Scriptname aaDr_SCR_Ana_toolsPER extends ReferenceAlias

Is set on ReferenceAlias, just like the original (also tried ObjectReference), I keep getting following errors when complying:

Starting 1 compile threads for 1 files...
Compiling "aaDr_SCR_Ana_toolsPER"...
c:\steam\steamapps\common\skyrim\Data\Scripts\Source\aaDr_SCR_Ana_toolsPER.psc(10,0): mismatched input 'Event' expecting FUNCTION
c:\steam\steamapps\common\skyrim\Data\Scripts\Source\aaDr_SCR_Ana_toolsPER.psc(0,0): error while attempting to read script aaDr_SCR_Ana_toolsPER: Object reference not set to an instance of an object.
No output generated for aaDr_SCR_Ana_toolsPER, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on aaDr_SCR_Ana_toolsPER

Here is my code:
Spoiler

Scriptname aaDr_SCR_Ana_toolsPER extends ObjectReference{The actual script for the tools work}Race Property Race_wolf autoRace Property Race_bear autoMessage Property MSG_Message1 autoMiscObject Property Notes_wolfEvent OnActivate(ObjectReference akActivator)int response = MSG_Message1.Show()if (response == 0)ActorBase me = GetActorReference().GetLeveledActorBase()if (me.GetRace() == Race_wolf)Debug.Notification("Yeps, that is a wolf")Game.GetPlayer().AddItem(Notes_wolf, 1)elseif (me.GetRace() == Race_Bear)Debug.Notification("Yeps, that is a bear"); elseif (me.GetRace() == da04script.Dunmer);; elseif (me.GetRace() == da04script.Falmer);; elseif (me.GetRace() == da04script.Orsimer);endifendifEndEvent

And here is the original part of the code:


Spoiler

Scriptname DA04BloodHarvestVictimScript extends ReferenceAliasQuest Property ParentQuest autoMessage Property HarvestMessage auto(...)Event OnActivate(ObjectReference akActivator)int response = HarvestMessage.Show()if (response == 0)ActorBase me = GetActorReference().GetLeveledActorBase()MiscObject bloodType = Noneif (me.GetRace() == da04script.Altmer)bloodType = da04script.AltmerBloodelseif (me.GetRace() == da04script.Bosmer)bloodType = da04script.BosmerBloodelseif (me.GetRace() == da04script.Dunmer)bloodType = da04script.DunmerBloodelseif (me.GetRace() == da04script.Falmer)bloodType = da04script.FalmerBloodelseif (me.GetRace() == da04script.Orsimer)bloodType = da04script.OrsimerBloodendif; Game.GetPlayer().AddItem(bloodType, 1)da04script.GotBlood(bloodType)GetOwningQuest().SetStage(100)endif /;EndEvent

What may be causing the error?
User avatar
K J S
 
Posts: 3326
Joined: Thu Apr 05, 2007 11:50 am

Post » Tue Jun 19, 2012 2:22 am

On other note, is there any other forum except for this and Nexus, where there is a possibility to get help with Papyrus?
User avatar
Luis Longoria
 
Posts: 3323
Joined: Fri Sep 07, 2007 1:21 am

Post » Tue Jun 19, 2012 4:13 am

You may want to check tesalliance.org
They have part of the forums named The Enclave - it's kind of modding school.


besides... you have this in your code:
Event OnActivate(ObjectReference akActivator)

while the proper declaration of original function is this:

Event OnActivate(ObjectReference akActionRef)

User avatar
Isaiah Burdeau
 
Posts: 3431
Joined: Mon Nov 26, 2007 9:58 am

Post » Tue Jun 19, 2012 6:43 am

Thank you for your answer, I will have a look at tesalliance.

About the script:
I have tried to do what you said, but ended up getting the same error.
It keeps whining about not wanting an EVENT but FUNCTION.

I just do not understand it, since it is a part-copy of Beth's script that does work.
User avatar
Melissa De Thomasis
 
Posts: 3412
Joined: Tue Feb 27, 2007 6:52 pm

Post » Tue Jun 19, 2012 9:21 am

Still seeking help.


I have been trying over and over again, without any luck.
This time, I have tried to borrow fragments from DA11 Cannibalism quest scripts, but it was useless once again.

Scriptname aaDr_SCR_Ana_toolsPER extends ObjectReference{The actual script for the tools work}Message Property MSG_Message1 autoFunction Fragment_0(ObjectReference akTargetRef, Actor akActor)Debug.Notification("So far so good")Int iButton = MSG_Message1.Show()EndFunction 

Nothing happens when clicking a dead actor. Creature or Humanoid.
I am completely "blind" when working on the starts of the scripts.
User avatar
Bambi
 
Posts: 3380
Joined: Tue Jan 30, 2007 1:20 pm

Post » Tue Jun 19, 2012 4:47 pm

After a lot of work and great help from TESalliance, I was able to solve my problem.

Everything was done mostly via the perks and not the scripts
User avatar
kitten maciver
 
Posts: 3472
Joined: Fri Jun 30, 2006 2:36 pm


Return to V - Skyrim