Jump to content

Need script for Auriels Crossbow Mod (vanilla arrow sun effect)


ghosu

Recommended Posts

Hello

Atm i'm working on Auriel's Crossbow mod...the weapon is finished, I've got 2 types of bolts (sun and blood) - but i need to duplicate/adjust the script of the original arrows (Sunhallowed and Bloodcursed Elven Arrows) to work with my crossbow/bolts.

Afaik the ammo is linked to a script and magic effects...changing the requirements of the effects to my crossbow/bolts is no big deal but i have NO CLUE 'bout scripting and don't want to learn it just for that small mod...so is there anyone around that might help out? Credits will be given of course.

 

http://666kb.com/i/cmiategon8nxqxvmi.jpg

I'm talking 'bout these effects:


I've tried to replicate it now for hours and i'm close to trashing the whole mod.

 

WIP video in the comment section of...

www.nexusmods.com/skyrim/mods/51822/

 

greetings

Edited by ghosu
Link to comment
Share on other sites

I decompiled the .pex script, just to check if someone has an idea 'bout that - if the compiled version in CK doesn't suffice:

 

 

 

.FLAGS
hidden 0
conditional 1
.OBJECTS
OBJECT DLC1AurielsBowPlayerScript : ActiveMagicEffect {0}
VARS
formlist ::SunAffectingWorldspaces_var = null {0}
ammo ::DLC1ElvenArrowBlood_var = null {0}
globalvariable ::DLC1EclipseActive_var = null {0}
globalvariable ::GameHour_var = null {0}
imagespacemodifier MyImageSpace = null {0}
Bool ::BlessedArrowEquipped_var = null {0}
Bool ::BloodArrowEquipped_var = null {0}
ammo ::DLC1ElvenArrowBlessed_var = null {0}
Actor Subject = null {0}
imagespacemodifier ::LightImodFX_var = null {0}
imagespacemodifier ::DarkImodFX_var = null {0}
spell ::DLC1AurielsBowEclipseSpell_var = null {0}
weapon ::DLC1AurielsBow_var = null {0}
Bool bCorrectBowEquipped = false {0}
spell ::DLC1AurielsBowSunAttackSpell_var = null {0}
ENDVARS
PROPS
PROP weapon DLC1AurielsBow rw {0}
AUTOVAR ::DLC1AurielsBow_var
ENDPROP
PROP imagespacemodifier LightImodFX rw {0}
@doc Light spell iMod for spell
AUTOVAR ::LightImodFX_var
ENDPROP
PROP spell DLC1AurielsBowEclipseSpell rw {0}
AUTOVAR ::DLC1AurielsBowEclipseSpell_var
ENDPROP
PROP imagespacemodifier DarkImodFX rw {0}
@doc Dark spell iMod for spell
AUTOVAR ::DarkImodFX_var
ENDPROP
PROP ammo DLC1ElvenArrowBlessed rw {0}
AUTOVAR ::DLC1ElvenArrowBlessed_var
ENDPROP
PROP Bool BloodArrowEquipped rw {0}
AUTOVAR ::BloodArrowEquipped_var
ENDPROP
PROP globalvariable GameHour rw {0}
@doc 0 = Plain Bow any arrow, 1 = Auriel's and SunArrow, 2 = Auriel's and Not SunArrow
AUTOVAR ::GameHour_var
ENDPROP
PROP formlist SunAffectingWorldspaces rw {0}
AUTOVAR ::SunAffectingWorldspaces_var
ENDPROP
PROP spell DLC1AurielsBowSunAttackSpell rw {0}
AUTOVAR ::DLC1AurielsBowSunAttackSpell_var
ENDPROP
PROP Bool BlessedArrowEquipped rw {0}
AUTOVAR ::BlessedArrowEquipped_var
ENDPROP
PROP globalvariable DLC1EclipseActive rw {0}
AUTOVAR ::DLC1EclipseActive_var
ENDPROP
PROP ammo DLC1ElvenArrowBlood rw {0}
AUTOVAR ::DLC1ElvenArrowBlood_var
ENDPROP
ENDPROPS
STATES
STATE DEFAULT
None FUNCTION GotoState(String newState) {0}
@doc Function that switches this object to the specified state
FLAGS 0
VARS
None ::NoneVar
ENDVARS
callmethod onEndState, self, ::NoneVar
assign ::State, newState
callmethod onBeginState, self, ::NoneVar
ENDFUNCTION
imagespacemodifier FUNCTION GetSunGazeImod() {0}
FLAGS 0
VARS
None ::NoneVar
imagespacemodifier ::temp24
ENDVARS
jmpf bCorrectBowEquipped, 10
jmpf ::BloodArrowEquipped_var, 3
assign MyImageSpace, ::DarkImodFX_var
jmp 6
jmpf ::BlessedArrowEquipped_var, 3
assign MyImageSpace, ::LightImodFX_var
jmp 3
cast ::temp24, null
assign MyImageSpace, ::temp24
jmp 3
cast ::temp24, null
assign MyImageSpace, ::temp24
callstatic game, SetSunGazeImageSpaceModifier, ::NoneVar, MyImageSpace
ENDFUNCTION
String FUNCTION GetState() {0}
@doc Function that returns the current state
FLAGS 0
return ::State
ENDFUNCTION
None FUNCTION OnObjectUnequipped(Form akWeapon, ObjectReference akWeaponRef) {0}
FLAGS 0
VARS
Form ::temp19
Bool ::temp20
imagespacemodifier ::temp23
Actor ::temp21
ObjectReference ::temp22
None ::NoneVar
ENDVARS
cast ::temp19, ::DLC1AurielsBow_var
cmp_eq ::temp20, akWeapon, ::temp19
jmpf ::temp20, 6
callstatic game, GetPlayer, ::temp21
cast ::temp22, ::temp21
callmethod UnregisterForAnimationEvent, self, ::NoneVar, ::temp22, "arrowRelease"
assign bCorrectBowEquipped, false
jmp 1
cast ::temp19, ::DLC1ElvenArrowBlood_var
cmp_eq ::temp20, akWeapon, ::temp19
jmpf ::temp20, 3
assign ::BloodArrowEquipped_var, false
jmp 1
cast ::temp19, ::DLC1ElvenArrowBlessed_var
cmp_eq ::temp20, akWeapon, ::temp19
jmpf ::temp20, 3
assign ::BlessedArrowEquipped_var, false
jmp 1
callmethod GetSunGazeImod, self, ::temp23
ENDFUNCTION
None FUNCTION OnUpdateGameTime() {0}
FLAGS 0
VARS
Float ::temp16
Float ::temp17
Bool ::temp18
ENDVARS
cast ::temp17, 0
assign ::temp16, ::temp17
propset value, ::DLC1EclipseActive_var, ::temp16
callmethod DispelSpell, Subject, ::temp18, ::DLC1AurielsBowEclipseSpell_var
ENDFUNCTION
None FUNCTION OnObjectEquipped(Form akWeapon, ObjectReference akWeaponRef) {0}
FLAGS 0
VARS
Form ::temp0
Bool ::temp1
imagespacemodifier ::temp5
Actor ::temp2
ObjectReference ::temp3
Bool ::temp4
ENDVARS
cast ::temp0, ::DLC1AurielsBow_var
cmp_eq ::temp1, akWeapon, ::temp0
jmpf ::temp1, 6
callstatic game, GetPlayer, ::temp2
cast ::temp3, ::temp2
callmethod registerForAnimationEvent, self, ::temp4, ::temp3, "arrowRelease"
assign bCorrectBowEquipped, true
jmp 1
cast ::temp0, ::DLC1ElvenArrowBlood_var
cmp_eq ::temp4, akWeapon, ::temp0
jmpf ::temp4, 3
assign ::BloodArrowEquipped_var, true
jmp 1
cast ::temp0, ::DLC1ElvenArrowBlessed_var
cmp_eq ::temp1, akWeapon, ::temp0
jmpf ::temp1, 3
assign ::BlessedArrowEquipped_var, true
jmp 1
callmethod GetSunGazeImod, self, ::temp5
ENDFUNCTION
None FUNCTION OnPlayerBowShot(weapon akWeapon, ammo akAmmo, Float akBowDraw, Bool abSunGazing) {0}
FLAGS 0
VARS
None ::NoneVar
Bool ::temp6
Float ::temp7
Float ::temp8
Bool ::temp9
Bool ::temp10
String ::temp11
Bool ::temp12
Actor ::temp13
ObjectReference ::temp14
ObjectReference ::temp15
ENDVARS
callstatic debug, Trace, ::NoneVar, "AURIEL'S BOW: OnPlayerBowShot", 0
cmp_eq ::temp6, akWeapon, ::DLC1AurielsBow_var
cast ::temp6, ::temp6
jmpf ::temp6, 5
propget value, ::DLC1EclipseActive_var, ::temp7
cast ::temp8, 0
cmp_eq ::temp9, ::temp7, ::temp8
cast ::temp6, ::temp9
jmpf ::temp6, 38
cmp_eq ::temp9, abSunGazing, true
jmpf ::temp9, 35
callstatic debug, Trace, ::NoneVar, "AURIEL's BOW: Player is sungazing", 0
cmp_ge ::temp10, akBowDraw, 0.949999988079071
jmpf ::temp10, 31
cast ::temp11, akBowDraw
strcat ::temp11, "AURIEL'S BOW: Draw is ", ::temp11
callstatic debug, Trace, ::NoneVar, ::temp11, 0
jmpf ::BloodArrowEquipped_var, 18
callmethod GetValue, ::DLC1EclipseActive_var, ::temp8
cmp_eq ::temp12, ::temp8, 0.00
jmpf ::temp12, 14
callstatic game, AddAchievement, ::NoneVar, 56
callmethod GetTargetActor, self, ::temp13
assign Subject, ::temp13
cast ::temp14, Subject
cast ::temp15, Subject
callmethod Cast, ::DLC1AurielsBowEclipseSpell_var, ::NoneVar, ::temp14, ::temp15
propget value, ::GameHour_var, ::temp7
cast ::temp8, 20
fsub ::temp8, ::temp8, ::temp7
callmethod RegisterForSingleUpdateGameTime, self, ::NoneVar, ::temp8
assign ::temp7, 1.00
propset value, ::DLC1EclipseActive_var, ::temp7
jmp 1
jmp 9
jmpf ::BlessedArrowEquipped_var, 8
callstatic game, AddAchievement, ::NoneVar, 56
callmethod GetTargetActor, self, ::temp13
assign Subject, ::temp13
cast ::temp14, Subject
cast ::temp15, Subject
callmethod Cast, ::DLC1AurielsBowSunAttackSpell_var, ::NoneVar, ::temp14, ::temp15
jmp 1
jmp 1
jmp 1
jmp 1
ENDFUNCTION
ENDSTATE
ENDSTATES
ENDOBJECT

 

Link to comment
Share on other sites

As a test, replace the weapon and ammo properties with your crossbow and bolt variants. I would think that that would allow your crossbow to function but cause the Auriel's bow to no longer function. If that turns out to be true, then either the script could be edited directly to include both (bow and crossbow) or perhaps you could try duplicating the effect and calling the duplicate for your crossbow.

 

FYI -- no idea how to read your "decompiled" script. I can understand what the CK shows but not whatever that was. :P

 

 

Oh, DUH!!! Just duplicate the script itself, copy the PSC file and rename it, edit it with notepad++ and change the scriptname to match what you named the PSC file. Compile and save. Then add that script alongside the original in the magic effect. Assign your crossbow and bolts to the weapon and ammo properties on your duplicated script.

 

I think that would work. Only one way to know for sure. :D

Link to comment
Share on other sites

Thanks for ya replies.

 

That is what i wanted to do yesterday but the problem is, that the Dawnguard scripts don't come with source .psc files but compiled .pex only. Therefor i'm f*cking around with these .pex files.

Even with my limited knowledge when it comes to scripting i MIGHT be able to reverse engineer .psc files but i have no clue how to do it with .pex only.

 

But I've just found this tool here...

http://www.nexusmods.com/skyrim/mods/35307

... to covert .pex to .psc so there is light on the end of the tunnel :D

 

 

EDIT:

Argh, just realized that there are DG .psc files but i was too blind to see the Dawnguard folder in \source\ and just checked the source folder. So a lot of wasted time to understand .pex files. Shame on me!

Edited by ghosu
Link to comment
Share on other sites

Dawnguard and Dragonborn scripts ARE packaged with the others, they're just in subfolders. You have to go to the actual folder: Skyrim\Data\Scripts\Source and you'll see a folder for dawnguard. You can just cut/paste everything from the subfolder into the Source folder and the CK will read them like any other script.

 

EDIT: Beat me to it :)

Edited by Xander9009
Link to comment
Share on other sites

I have a source folder for the scripts, source folder inside the source folder actually and the CK ignores it....

Scriptname DLC1AurielBlessExplosionPlaceScript extends ObjectReference  
{This script decides id the blessed arrows explode.}


Explosion property ExplosionRef auto
{The name of the Explosion we will be placing.}

GlobalVariable Property DLC1AurielLastArrowFiredByPlayer  Auto
{0 = Plain Bow any arrow, 1 = Auriel's and SunArrow, 2 = Auriel's and Not SunArrow}  

Event onInit()
	;debug.Trace("This stupid thing works at all")

	if DLC1AurielLastArrowFiredByPlayer.getvalue() == 1
		ObjectReference MyExplosion = (Self.placeatme(ExplosionRef))
		while MyExplosion.Is3DLoaded() == False
			Utility.wait(0.1)
		endwhile

		MyExplosion = none
		Self.Disable()
		Self.Delete()
	endif

endEvent
;/ Event OnCellAttach()
		debug.Trace("Attached!")
	if DLC1AurielLastArrowFiredByPlayer.getvalue() == 1
		ObjectReference MyExplosion = (Self.placeatme(ExplosionRef))
		while MyExplosion.Is3DLoaded() == False
			Utility.wait(0.1)
		endwhile

		MyExplosion = none
		Self.Disable()
		Self.Delete()
	endif
	
endEvent /;
Scriptname DLC1AurielsBowActivateTrigSCRIPT extends ObjectReference Hidden 

import debug

Keyword Property LinkCustom01 Auto
{Link to Pedestal/Bow Anim}
Keyword Property LinkCustom02 Auto
{Link to Light}

Quest Property DLC1VQ07 Auto

Int Property StageToSet Auto
{Stage that gets set when this is activated.}

ReferenceAlias Property DLC1AurielsBow Auto

bool AlreadyLoaded = FALSE
bool AlreadyActivated = FALSE



Event OnCellLoad()
	;trace("Running OnCellLoad() with AlreadyLoaded set to " + AlreadyLoaded)
	;if AlreadyLoaded == FALSE
	;	trace("Running OnCellLoad() inside AlreadyLoaded if statement")
	;	GetLinkedRef(LinkCustom01).PlayAnimation("playanim02")
	;	AlreadyLoaded = TRUE
	;	self.DisableNoWait()
	;endif
EndEvent



Event OnActivate(ObjectReference akActionRef)
	if (AlreadyActivated == FALSE)
		if (akActionRef == Game.GetPlayer())
			AlreadyActivated = TRUE
			self.DisableNoWait()
			Game.GetPlayer().AddItem(DLC1AurielsBow.GetRef(), 1, 1)
			GetLinkedRef(LinkCustom02).DisableNoWait()
			GetLinkedRef(LinkCustom01).PlayAnimation("playanim02")
			DLC1VQ07.SetStage(StageToSet)
		endif
	endif
EndEvent


Function EnableBow()
	GetLinkedRef(LinkCustom01).PlayAnimation("playanim01")
	GetLinkedRef(LinkCustom02).EnableNoWait()
	self.EnableNoWait()
EndFunction
Scriptname DLC1AurielsBowPlayerScript extends ActiveMagicEffect  

Spell Property DLC1AurielsBowSunAttackSpell Auto
Spell Property DLC1AurielsBowEclipseSpell Auto

ImageSpaceModifier property LightImodFX auto
{Light spell iMod for spell}
ImageSpaceModifier property DarkImodFX auto
{Dark spell iMod for spell}

Actor Subject
Bool bCorrectBowEquipped = False
ImageSpaceModifier MyImageSpace = None

Event OnObjectEquipped(Form akWeapon, ObjectReference akWeaponRef)
	if akWeapon == DLC1AurielsBow
		registerForAnimationEvent(Game.GetPlayer(), "arrowRelease")
		bCorrectBowEquipped = True
	endIf

	if akWeapon == DLC1ElvenArrowBlood
		BloodArrowEquipped = True
	endif
	if akWeapon == DLC1ElvenArrowBlessed
		BlessedArrowEquipped = True
	endif
	
	GetSunGazeImod()
	;Debug.Trace("If we look at the sun, the Imod will be " + MyImageSpace)
	;Debug.Trace("This is because bCorrectBowEquipped = " + bCorrectBowEquipped + " BloodArrowEquipped = " + BloodArrowEquipped + " and BlessedArrowEquipped = " +BlessedArrowEquipped)
EndEvent

Event OnPlayerBowShot(Weapon akWeapon, Ammo akAmmo, float akBowDraw, bool abSunGazing)
	Debug.Trace("AURIEL'S BOW: OnPlayerBowShot")
	if akWeapon == DLC1AurielsBow && DLC1EclipseActive.Value == 0
		if abSunGazing == True
			Debug.Trace("AURIEL's BOW: Player is sungazing")
			if akBowDraw >= 0.95
				Debug.Trace("AURIEL'S BOW: Draw is " + akBowDraw)
				if BloodArrowEquipped
					if DLC1EclipseActive.GetValue() == 0.0
						Game.AddAchievement(56)
						Subject = self.GetTargetActor()
						DLC1AurielsBowEclipseSpell.Cast(Subject,Subject)
						RegisterForSingleUpdateGameTime(20 - GameHour.Value)
						DLC1EclipseActive.Value = 1.0
					endif
				elseif BlessedArrowEquipped
					Game.AddAchievement(56)
					Subject = self.GetTargetActor()
					DLC1AurielsBowSunAttackSpell.Cast(Subject,Subject)
				endif
			endIf
		endIf
	endIf

EndEvent

Event OnUpdateGameTime()
	DLC1EclipseActive.Value = 0
	Subject.DispelSpell(DLC1AurielsBowEclipseSpell)
EndEvent

Event OnObjectUnequipped(Form akWeapon, ObjectReference akWeaponRef)
	if akWeapon == DLC1AurielsBow
		UnregisterForAnimationEvent(Game.GetPlayer(), "arrowRelease")
		bCorrectBowEquipped = False
	endIf
	if akWeapon == DLC1ElvenArrowBlood
		BloodArrowEquipped = False
	endif
	if akWeapon == DLC1ElvenArrowBlessed
		BlessedArrowEquipped = False
	endif
	
	GetSunGazeImod()
EndEvent


;Function for setting the correct Imod
ImageSpaceModifier Function GetSunGazeImod()

	If bCorrectBowEquipped
		if BloodArrowEquipped
			;Debug.Trace("Imod is Dark!")
			MyImageSpace = DarkImodFX
		ElseIf BlessedArrowEquipped
			;Debug.Trace("Imod is Light!")
			MyImageSpace = LightImodFX
		Else
			;Debug.Trace("Imod is None!")
			MyImageSpace = None
		EndIf
	Else
		MyImageSpace = None
	endif
	Game.SetSunGazeImageSpaceModifier(MyImageSpace)
	
EndFunction

WEAPON Property DLC1AurielsBow  Auto  

Ammo Property DLC1ElvenArrowBlood  Auto  
Ammo Property DLC1ElvenArrowBlessed  Auto  

Bool Property BloodArrowEquipped  Auto  
Bool Property BlessedArrowEquipped  Auto  



GlobalVariable Property DLC1EclipseActive  Auto  

GlobalVariable Property GameHour  Auto  

;GlobalVariable Property DLC1AurielLastArrowFiredByPlayer Auto
{0 = Plain Bow any arrow, 1 = Auriel's and SunArrow, 2 = Auriel's and Not SunArrow}  

FormList Property SunAffectingWorldspaces  Auto 
Scriptname DLC1AurielsShieldScript extends ObjectReference Hidden 

GlobalVariable Property TimesHit Auto
GlobalVariable Property CurrentStage Auto

Event OnLoad()
	debug.trace("Checking shield state")
	if CurrentStage.GetValue() == 1
		;debug.Notification("Shield at LEVEL 1")
		self.SetAnimationVariableFloat("fDampRate", 1)
		self.SetAnimationVariableFloat("fToggleBlend", 0.75)
	elseif CurrentStage.GetValue() == 2
		;debug.Notification("Shield at LEVEL 2")
		self.SetAnimationVariableFloat("fDampRate", 1)
		self.SetAnimationVariableFloat("fToggleBlend", 0.85)
	elseif CurrentStage.GetValue() == 3
		;debug.Notification("Shield at LEVEL 3")
		self.SetAnimationVariableFloat("fDampRate", 1)
		self.SetAnimationVariableFloat("fToggleBlend", 1)
	endif
EndEvent
Link to comment
Share on other sites

  • 4 weeks later...

I'm using your mod, but rather than use the actual mod, I modified Auriel's bow as a replacer. I replaced all the arrows with bolts, and the bow with a crossbow. This way I don't have to have any new scripts as they will use the items that already exist in the game. I managed to defeat Harkon using the crossbow, so I know it works at least, but I'm encountering a snag. When I hover the crossbow over the sun, I get a visual effect letting me know I'm pointed at the sun like a normal Auriel's bow; however, when I fire a bolt into the sun, none of the effects are playing. I'm not quite sure why this is.

 

EDIT: Hm, I think I see why. The script attached to the magic effect is specific to bows. I'll use the one you created as part of your mod and attach it to the original. That should fix it. Will test.

 

EDIT 2: Hm. That doesn't seem to work, either.

Edited by Miles Tails Prower
Link to comment
Share on other sites

  • Recently Browsing   0 members

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