Dawnguard PSC Files [merged]

Post » Sun Nov 18, 2012 5:51 am

Neat has anyone emailed that person with the psc issue? Don't want to spam the poor guy :P
User avatar
Charles Mckinna
 
Posts: 3511
Joined: Mon Nov 12, 2007 6:51 am

Post » Sat Nov 17, 2012 9:27 pm

Just a little update on dlc1_npcmentalmodelscript: I'm about halfway through converting it. I don't think I will be able to finish it today.

BTW I think it has some bugs in it (the original script), so I will leave some comments about this in the code.
User avatar
OnlyDumazzapplyhere
 
Posts: 3445
Joined: Wed Jan 24, 2007 12:43 am

Post » Sat Nov 17, 2012 7:05 pm

Just a little update on dlc1_npcmentalmodelscript: I'm about halfway through converting it. I don't think I will be able to finish it today.

BTW I think it has some bugs in it (the original script), so I will leave some comments about this in the code.

Can you provide any advice on how you're translating that gibberish into usable Papyrus script? I can (mostly) get the Property and Variable stuff converted fine. The fragments are giving me trouble.


Maybe just let me know if these are right. It seems like this:
CallMethod SetAlly ::CreatureFaction_var ::NoneVar ::DLC1HunterBaseIntroBearFaction_var False False  ;@line 229

Should become this:
CreatureFaction.SetAlly(DLC1HunterBaseIntroBearFaction)

That's a simple fragment and I'm still not totally sure that's correct. How about this:
CallMethod IsDisabled ::DLC1HallNormalState_var ::temp4  ;@line 150Cast ::temp5 0										   ;@line 150CompareEQ ::temp5 ::temp4 ::temp5						;@line 150JumpF ::temp5 _label7									;@line 150CallMethod Disable ::DLC1HallNormalState_var ::NoneVar False  ;@line 151Jump _label7											 ;@line 151_label7:CallMethod SetStage self ::temp4 10					  ;@line 156

This looks like a rather convoluted way to write IF logic, so I would guess it's something like this?
if DLC1HallNormalState.IsDisabled() == 0DLC1HallNormalState.Disable()endifSetStage(10)



Am I on the right track here, at least?
User avatar
Amy Cooper
 
Posts: 3400
Joined: Thu Feb 01, 2007 2:38 am

Post » Sun Nov 18, 2012 7:08 am

Yes, that looks right
User avatar
Ludivine Poussineau
 
Posts: 3353
Joined: Fri Mar 30, 2007 2:49 pm

Post » Sun Nov 18, 2012 12:00 am

Good, because I've been pushing forward with that same method, so I'm hoping it's correct. I'd really like to release a mod to let vampires be in Dawnguard. It's something I want personally, plus I've already been seeing http://www.gamefaqs.com/boards/615805-the-elder-scrolls-v-skyrim/63809549. These two scripts are standing in my way.

Seriously, it makes no sense that Dawnguard will work with Serana, but refuses to allow a vampire player to help them. You can prove loyalty and they'll still refuse you.


Oh, and I'll be crediting you two for the help on getting these scripts converted. Do TMPhoenix and Mardoxx work, or do you prefer other names?
User avatar
Lloyd Muldowney
 
Posts: 3497
Joined: Wed May 23, 2007 2:08 pm

Post » Sat Nov 17, 2012 7:54 pm

Your basically on the right track:
Callmethod {name of method} {object to call method on} {return var} ... parameters ...Callstatic {name of script defining function} {name of function} {return var} ... parameters ...Iadd ISub {return var} {arg1} {arg2} integer addition/subtractionFAdd FSub same as above, but for floatsFMul, FDiv multiplication/divisionCast {target var} {source var} : type cast and assign source var to target var; type based on target var, so basically the whole (npc as actor) stuff you see in papyrusnegateF/I negate a float or intnot invert a boolean true <--> falseassign {var} {value} --> {var} = {value}

the trickier bits are the jumps:
jump jump to labeljmpf, jmpt jump to label if condition is false(f)/true(t) I've actually never seen jmpt in any script so far.

for those you also need:
compareeq {target} {expr1} {expr2} compare equality of expression1 and expression2 and assign to target; so basically: target = expr1 == expr2compareLT GT GTE LTE compare less than, greater than, greater than or equal, less than or equal

a while loop will look like:

label1:comparison {var1} {expr1} {expr2}jmpf {var1} label2: ;break out of the loop... do some stuff///jump label 1 ; go back to the start of the looplabel 2:

an if looks like:
comparison ; do some checkjmpf label1 ; jump over the code if the check fails...do stuff if true...label1:

if (a and b ) looks like (note the re-use of the same ::temp var so that if the first condition check fails you will perform 2 jumps first to label1 then to label2 out of the if statement)
comparisoneq ::temp1 a true ; check first conditionjmpf ::temp1 label1 ; jump over second check if first failscomparisoneq ::temp1 b true ; second checklabel1:jmpf ::temp1 label2 ; jump over code if second (or first) condition is false...do stuff...label2:

also variables with names ending in _var are properties.
be careful with the flags on variables and the script itself as these can have an effect on which variables are available for use in the conditionals in the CK.

Currently I'm doing all this manually, but I believe PLB is looking into a tool that can do this automatically.
As a side project I'm also looking into this, but that might take a while.
User avatar
Wayne W
 
Posts: 3482
Joined: Sun Jun 17, 2007 5:49 am

Post » Sat Nov 17, 2012 8:22 pm

Wow.... This one has me stumped:
.function GotoState.userFlags 0    ; Flags: 0x00000000.docString "Function that switches this object to the specified state".return None.paramTable.param newState String.endParamTable.localTable.local ::NoneVar None.endLocalTable.codeCallMethod onEndState self ::NoneVar					 ;@line ??Assign ::State newState								  ;@line ??CallMethod onBeginState self ::NoneVar				   ;@line ??.endCode.endFunction

That's not even part of a fragment. What even is that?
User avatar
Kristian Perez
 
Posts: 3365
Joined: Thu Aug 23, 2007 3:03 am

Post » Sun Nov 18, 2012 6:02 am

It certainly seems like they're sitting on a number of CK related things since Dawnguard, 1.7, and the retracted CK version. I expect we'll see a small bugfix patch and a CK update to bring it fully in sync with the game before the Hearthfire marketing machine revs up.
User avatar
jessica Villacis
 
Posts: 3385
Joined: Tue Jan 23, 2007 2:03 pm

Post » Sun Nov 18, 2012 12:37 am

I think...

Everything is wrapped in a default state "" (blank) and they're just null functions for onEndState and onBeginState
It'll need it because of the way it searches for functions for each state (someone will explain it properly, I'm sure... http://www.creationkit.com/State_Reference#How_States_Affect_Functions_And_Events)

Pretty sure you can just ignore those if they look like that
User avatar
Rex Help
 
Posts: 3380
Joined: Mon Jun 18, 2007 6:52 pm

Post » Sun Nov 18, 2012 5:12 am

Wow.... This one has me stumped:
Spoiler

.function GotoState.userFlags 0	; Flags: 0x00000000.docString "Function that switches this object to the specified state".return None.paramTable.param newState String.endParamTable.localTable.local ::NoneVar None.endLocalTable.codeCallMethod onEndState self ::NoneVar					 ;@line ??Assign ::State newState								  ;@line ??CallMethod onBeginState self ::NoneVar				   ;@line ??.endCode.endFunction

That's not even part of a fragment. What even is that?

all scripts seem to contain a gotostate and getstate function. you can, as far as I can tell remove them. The compiler seems to generate them automatically. They seem to manage the state shifts.

Oh and as for events; they are just normal functions; as far as I can tell the "event/endEvent" keywords aren't even strictly needed; still if you encoutner a function that starts with On.... you should probably just make it an event.
User avatar
Poetic Vice
 
Posts: 3440
Joined: Wed Oct 31, 2007 8:19 pm

Post » Sun Nov 18, 2012 3:39 am

Thanks. It's always very nice to hear "you can ignore that" when you have other work to do. :biggrin:

Looks confusing? Skip that crap! :down:
User avatar
Darrell Fawcett
 
Posts: 3336
Joined: Tue May 22, 2007 12:16 am

Post » Sat Nov 17, 2012 6:38 pm

Looks confusing? Skip that crap! :down:

In this case yes... in general, sorry, no :tongue:
User avatar
john palmer
 
Posts: 3410
Joined: Fri Jun 22, 2007 8:07 pm

Post » Sun Nov 18, 2012 2:34 am

Also, for fragment scripts, you should probably add all the
;BEGIN FRAGMENT CODE
stuff around the functions. Look at some examples to get a feel how to place them, and where to place the variables. I suspect the CK uses this to determine where it should edit the scripts when you are editing a quest.
User avatar
Tyrone Haywood
 
Posts: 3472
Joined: Sun Apr 29, 2007 7:10 am

Post » Sat Nov 17, 2012 7:20 pm

Also, for fragment scripts, you should probably add all the
;BEGIN FRAGMENT CODE
stuff around the functions. Look at some examples to get a feel how to place them, and where to place the variables. I suspect the CK uses this to determine where it should edit the scripts when you are editing a quest.

Yeah, I am. I'm note sure if it's needed, but I'm making sure it's there anyway.


Edit:

So... let me get a second opinion on this one.
Spoiler
.info.source "DLC1HunterBaseIntroQuestScript.psc".modifyTime 1337726982 ;Tue May 22 23:49:42 2012 Local.compileTime 1338491609 ;Thu May 31 20:13:29 2012 Local.user "builds".computer "BUILDFARM08".endInfo.userFlagsRef.flag conditional 1	; 0x00000001.flag hidden 0	; 0x00000000.endUserFlagsRef.objectTable.object dlc1hunterbaseintroquestscript Quest.userFlags 2	; Flags: 0x00000002.docString "".autoState.variableTable.variable ::VQ02Progress_var Int.userFlags 2	; Flags: 0x00000002.initialValue None.endVariable.variable ::BearDead_var Int.userFlags 2	; Flags: 0x00000002.initialValue None.endVariable.variable ::StartSceneDone_var Int.userFlags 2	; Flags: 0x00000002.initialValue None.endVariable.variable ::GyroGiven_var Int.userFlags 2	; Flags: 0x00000002.initialValue None.endVariable.variable ::IsranIntroDone_var Int.userFlags 2	; Flags: 0x00000002.initialValue None.endVariable.variable ::DLC1Radiant_var dlc1radiantscript.userFlags 0	; Flags: 0x00000000.initialValue None.endVariable.variable ::AmbushRun_var Int.userFlags 2	; Flags: 0x00000002.initialValue None.endVariable.variable ::SorineInfo_var Int.userFlags 2	; Flags: 0x00000002.initialValue None.endVariable.variable ::IsranEndSceneCure_var Int.userFlags 2	; Flags: 0x00000002.initialValue None.endVariable.variable ::SpeechChalDone_var Int.userFlags 2	; Flags: 0x00000002.initialValue None.endVariable.endVariableTable.propertyTable.property VQ02Progress Int auto.userFlags 0	; Flags: 0x00000000.docString "".autoVar ::VQ02Progress_var.endProperty.property SorineInfo Int auto.userFlags 0	; Flags: 0x00000000.docString "".autoVar ::SorineInfo_var.endProperty.property DLC1Radiant dlc1radiantscript auto.userFlags 0	; Flags: 0x00000000.docString "".autoVar ::DLC1Radiant_var.endProperty.property GyroGiven Int auto.userFlags 0	; Flags: 0x00000000.docString "".autoVar ::GyroGiven_var.endProperty.property AmbushRun Int auto.userFlags 0	; Flags: 0x00000000.docString "".autoVar ::AmbushRun_var.endProperty.property StartSceneDone Int auto.userFlags 0	; Flags: 0x00000000.docString "".autoVar ::StartSceneDone_var.endProperty.property IsranIntroDone Int auto.userFlags 0	; Flags: 0x00000000.docString "".autoVar ::IsranIntroDone_var.endProperty.property IsranEndSceneCure Int auto.userFlags 0	; Flags: 0x00000000.docString "".autoVar ::IsranEndSceneCure_var.property SpeechChalDone Int auto.userFlags 0	; Flags: 0x00000000.docString "".autoVar ::SpeechChalDone_var.endProperty.property BearDead Int auto.userFlags 0	; Flags: 0x00000000.docString "".autoVar ::BearDead_var.endProperty.endPropertyTable.stateTable.state.function GotoState.userFlags 0	; Flags: 0x00000000.docString "Function that switches this object to the specified state".return None.paramTable.param newState String.endParamTable.localTable.local ::NoneVar None.endLocalTable.codeCallMethod onEndState self ::NoneVar					 ;@line ??Assign ::State newState								  ;@line ??CallMethod onBeginState self ::NoneVar				   ;@line ??.endCode.endFunction.function GetState.userFlags 0	; Flags: 0x00000000.docString "Function that returns the current state".return String.paramTable.endParamTable.localTable.endLocalTable.codeReturn ::State										   ;@line ??.endCode.endFunction.endState.endStateTable.endObject.endObjectTable

If I'm understanding this correctly, that script does nothing at all. It just stores data in its properties and variables so the other script can access them, but it doesn't do a damn thing itself, right?
That seems very strange. Why not stick those extra non-alias properties into the other script? :blink:
User avatar
Melanie
 
Posts: 3448
Joined: Tue Dec 26, 2006 4:54 pm

Post » Sun Nov 18, 2012 6:08 am

the trickier bits are the jumps:
...
Currently I'm doing all this manually, but I believe PLB is looking into a tool that can do this automatically.
As a side project I'm also looking into this, but that might take a while.
Yeah, the jumps are a real pain, there are some odd quirks when it comes to loops. jmpf and jmpt represent && and || in a condition statement, you rarely see jmpt because sometimes it will cast and do the inverse operation using a Not. From what I've seen in the jmps usually work like this:

jmpf - jump if false (values: Instruction index)
jmpt - jump if true (values: Instruction index)
jmp - end/endwhile (values: Instruction index, negative indicates reverse jump, or in other words a loop)

Where things get strange is when you have multiple conditions chained together like...
If/While a && b == 3 && d == 5 || l == 6
;
EndIf/While

or

If a && b && d
;
Elseif a && b && e
;
Endif

The quirks come in when you try to follow the jumps, multi conditioned jumps usually are represented when your first jump (jmpt/f) points to another jump (jmpt/f), and the last jump points to the end jump (jmp) when you exceed two conditions on a statement, one of the jumps does not follow this pattern and points to an instruction index one short of the next jump. I'll probably need to investigate the flow further, currently my decompiler just outputs straight instruction conversion and temp variable evaluation, but it seems I may need additional processing, or actually following the instruction flow to produce re-compilable code.
User avatar
kennedy
 
Posts: 3299
Joined: Mon Oct 16, 2006 1:53 am

Post » Sun Nov 18, 2012 12:59 am

Yeah, I am. I'm note sure if it's needed, but I'm making sure it's there anyway.


Edit:

So... let me get a second opinion on this one.
If I'm understanding this correctly, that script does nothing at all. It just stores data in its properties and variables so the other script can access them, but it doesn't do a damn thing itself, right?
That seems very strange. Why not stick those extra non-alias properties into the other script? :blink:

You are right. The script does nothing by itself. It simply serves as a central location for other scripts to access data.
There are several reasons why this is a better idea. If you spread the data out over several scripts, you would have to include all those scripts in eachother (I don't even know if this is possible, since this could introduce circular dependencies), instead of just the one script.
Another reason is probably that the CK seems to allow only one conditional script per quest according to the wiki. So if you have several scripts as part of a quest and you want to check some variables in a condition, you would have to make sure they are all in a single script.

@PLB:
hmmm I would have to create some test scripts to see the effect of 3+ conditions, although one of the scripts I converted had one with 4 and if I recall correctly it behaved in the same way; if a test failed it jumped to the next jump where the condition would still be false and it would thus jump on to the end.
User avatar
Anna S
 
Posts: 3408
Joined: Thu Apr 19, 2007 2:13 am

Post » Sat Nov 17, 2012 9:50 pm

Oh, this is hilarious. All this work and we need to have a Creation Kit update before I can continue anyway. Apparently the new type dlc1radiantscript is not accepted in the current version of the CK. So even though my rebuilt DLC1HunterBaseIntroQuestScript uses that type, and by extension my rebuilt DLC1_QF_DLC1HunterBaseIntro_01004E24 uses it too through a kmyquest, I cannot actually compile these new scripts.


Well, here's a gift for anyone who needs it. The blood potion effect script was extremely simple, so I converted that. You could of course just attach the existing blood potion magic effect to something, but I had wanted to make Synthetic Blood potions keep the player fed for 2 days instead of the normal 1, so I needed to edit it. If anyone else needs to edit the script, this is all it is:
Spoiler
Scriptname DLC1BloodPotionEffectScript Extends ActiveMagicEffect Conditionalplayervampirequestscript Property PlayerVampireQuest AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)	PlayerVampireQuest.VampireFeed()EndEvent


For now I'll just work on getting Synthetic Blood potions and Tranq Darts to work. At least those will be simple, which should be a welcome break.

Edit:
:ermm: Are you serious? You can't stick scripts on ammo? I can get around the lack of enchantment, but no scripts? Maybe Tranq Darts won't be so simple. I need a script to throw a perk on the player on equip and remove it on unequip. Everything else can be handled by that perk.

Ugh... I guess I could make a quest that throws a perk on the player when you start the mod, then disables itself. That perk would just shut off all functions unless Tranq Darts and a crossbow are equipped, thus it would never need to be removed. This is a really stupid method, but I think it's all I've got.

Yeah, that method is working totally fine. It's stupid, but it'll have to do. Having the option to fire non-fatal knock-out darts from your crossbow is too cool to not make it. I think I'll add silver bolts too so crossbows can truly be undead killers.
User avatar
K J S
 
Posts: 3326
Joined: Thu Apr 05, 2007 11:50 am

Post » Sun Nov 18, 2012 5:28 am

I'll ask again (for the fourth time):

Has anyone tried asking GStaff for information on the official Dawnguard PSCs?

If it's coming already, then we can just wait a bit and get the real deal instead of trying to decompile the PEXes. If not, then GStaff can pass it along that it'd really really help modding Dawnguard if we had the PSCs.

Of course, none of this happens unless you Ask Him In The First Place.
User avatar
Multi Multi
 
Posts: 3382
Joined: Mon Sep 18, 2006 4:07 pm

Post » Sun Nov 18, 2012 12:23 am

@MadCat221:
1. A Dev has already PMed me about the psc, like I posted a few pages back. They are aware of the issue, but no official word about when they will be released.
2. Cipscis already posted a reply to your previous post, so yes someone did try, but you could try it yourself as well.

@SushiSquid:
What errors are you getting while trying to recompile the scripts; so far I haven't eno[censored]ered any problems recompiling.
User avatar
Brian Newman
 
Posts: 3466
Joined: Tue Oct 16, 2007 3:36 pm

Post » Sat Nov 17, 2012 10:37 pm

2. Cipscis already posted a reply to your previous post, so yes someone did try, but you could try it yourself as well..
Like I said in that post, that was with regard to something else. I haven't contacted him about this.

Reading it again, though, I notice that the date he specified to be back was in July, so the out-of-office thing might not actually be current like I'd assumed.

Cipscis
User avatar
Brandon Wilson
 
Posts: 3487
Joined: Sat Oct 13, 2007 1:31 am

Post » Sat Nov 17, 2012 4:42 pm

Has anyone tried asking GStaff for information on the official Dawnguard PSCs?
And just for the record over here, I've sent GStaff a PM to ask about this. I know I'd much rather work with the real thing that have to ask to have one decoded if need be. I've looked at the decompiler. My brain gave me the weirdest look and walked away at the results it spit out. I'll stick to the higher level script language :P
User avatar
Mimi BC
 
Posts: 3282
Joined: Sat Oct 07, 2006 10:30 pm

Post » Sun Nov 18, 2012 4:25 am

Hello everybody!

I have a question to those who decompiles scripts. After using PapyrusAssembler I have .disassemble.pas. Should I rename it to .psc?
User avatar
Prisca Lacour
 
Posts: 3375
Joined: Thu Mar 15, 2007 9:25 am

Post » Sat Nov 17, 2012 9:55 pm

No, the code outputted by the decompilation process isn't the same as source code. It's more of an intermediate step between source and compiled code.

Cipscis
User avatar
stacy hamilton
 
Posts: 3354
Joined: Fri Aug 25, 2006 10:03 am

Post » Sun Nov 18, 2012 4:53 am

@Cipscis

I know, but only a psc file can be compiled to a pex file, so after I edit a pas file to look like psc one, should I rename it?
User avatar
Victoria Vasileva
 
Posts: 3340
Joined: Sat Jul 29, 2006 5:42 pm

Post » Sat Nov 17, 2012 5:13 pm

By the way, how to convert this one:

.variable ::WerewolfFaction_var faction.userFlags 0 ; Flags: 0x00000000.initialValue None.endVariable

to this one:

Faction Property WerewolfFaction auto

?

Can I delete these flags?
User avatar
Ana
 
Posts: 3445
Joined: Sat Jul 01, 2006 4:29 am

PreviousNext

Return to V - Skyrim