Jump to content

Need Help From An Expert Scripter


JetSteele

Recommended Posts

Compiling "AdamantiumScript_MeditateMarker"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\AdamantiumScript_MeditateMarker.psc(20,19): cannot compare a objectreference to a furniture (cast missing or types unrelated)
No output generated for AdamantiumScript_MeditateMarker, compilation failed.

Same issue, here is the code

Link to comment
Share on other sites

Ok, I've tweeked the scripts and this is where I am at...

 

Furniture Script

Scriptname AdamantiumScript_MeditateMarker extends ObjectReference  

Spell Property Meditate Auto

Event OnActivate(ObjectReference akActionRef)
	Debug.MessageBox("Hello, world!")
	if ((akActionRef as Actor).GetSitState () >= 3)
		if ((akActionRef as Actor) == Game.GetPlayer())
		endIf
	endIf
	Disable()
	Game.GetPlayer().DispelSpell(Meditate)
endEvent

Magic Effect Script

Scriptname AdamantiumScript_MeditationEnter extends activemagiceffect Conditional 

Furniture Property MeditateMarker Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
	if (akTarget == Game.GetPlayer())
	((akTarget as Actor).PlaceAtMe(MeditateMarker, 1, true, false) as ObjectReference).Activate((akTarget as Actor), false)
	endIf

endEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
	if ((akTarget) == Game.GetPlayer())
		Cleanup()
	endIf

EndEvent


Function Cleanup()
	Debug.Messagebox("TopOfTHeWorld")

endFunction

A lot cleaner and a lot smaller than what they used to be. They work better though, I made the furniture script disable the item so then the NPC's cannot use it however I would like to put the delete() inside the cleanup function which is now inside the magiceffect script. When I do put it there it gives me an error that delete isn't a function even when I write it like this:

 

MeditateMarker.Delete()

 

is there a way to do it? or do I have to do the delete from the furniture script?

Link to comment
Share on other sites

To who may read this:

 

Ok, after breaking my head on this I finally got the spell to work the way I wanted it to. I have one last issue, the animation for the meditation doesn't play at all. Fix one issue and gain another (takes a deep breath), if someone can help me to get the animation of meditating to play let me know. Sorry for the wall of text I still didn't figure out how to use the spoiler tags. Here are the new scripts:

 

Magic Effect

Scriptname AdamantiumScript_MeditationEnter extends ActiveMagicEffect

ObjectReference Property MeditateMarker Auto
ObjectReference Property MeditateTeleportLocation Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
	if (akTarget == Game.GetPlayer())
		((akTarget as Actor).PlaceAtMe(MeditateMarker, 1, true, false))
		MeditateMarker.Is3DLoaded()
		MeditateMarker.Activate((akTarget as Actor), false)
	endIf

endEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
		CleanUp()
EndEvent


Function CleanUp()
	MeditateMarker.Disable(True)
	Utility.Wait(1.0)
	MeditateMarker.MoveTo(MeditateTeleportLocation)
	MeditateMarker.Enable()
endFunction

Furniture

Scriptname AdamantiumScript_MeditateMarker extends ObjectReference  

Spell Property Meditate Auto

ReferenceAlias [] Property PlayerMeditate Auto	

Actor Property Meditator Auto Hidden

Bool Property Busy = false Auto Hidden Conditional
Bool Property MeditatePlayer = true Auto Hidden Conditional

Int	Counter	 = 0

Event OnActivate(ObjectReference akActionRef)
	if ((akActionRef as Actor).GetSitState () >= 3)
		if ((akActionRef as Actor) == Game.GetPlayer())
			GetUp()
		endIf
	endIf
endEvent


Function GetUp()
	if !Busy
		Busy = true
		Counter = PlayerMeditate.Length

		While Counter > 0 
			Counter -= 1

			if PlayerMeditate[Counter].GetActorRef()
				Meditator = PlayerMeditate[Counter].GetActorRef()
				PlayerMeditate[Counter].Clear()
				Meditator.EvaluatePackage()
				Meditator = None
			endif
		endWhile

		Busy = false
	endif

EndFunction
Link to comment
Share on other sites

  • 1 year later...
I'm having a bit of a problem with this script not wanting to compile because it won't recognize the "Input" @ Input.GetMappedKey("Sneak")
now I have read this directly off the creation kit wiki and everything in this line is the same as the wiki so why is the creation kit kicking it out??? as a error
These are The error's it's creating::
psc(18,13): variable Input is undefined
psc(18,19): none is not a known user-defined type
psc(18,1): type mismatch while assigning to a int (cast missing or types unrelated)
psc(19,1): RegisterForKey is not a function or does not exist
psc(23,1): UnregisterForAllKeys is not a function or does not exist
ReferenceAlias Property Alias_Rusheeda Auto
ReferenceAlias Property Alias_RusheedaRef Auto
Actor Property playerRef Auto
Int iSneakKey
Function FillAlias()
Alias_Rusheeda.Clear()
Alias_Rusheeda.ForceRefTo(Alias_RusheedaRef.GetReference())
EndFunction
Function ClearAlias()
Alias_Rusheeda.Clear()
EndFunction
Function RegisterForSneak()
iSneakKey = Input.GetMappedKey("Sneak")
RegisterForKey(iSneakKey)
EndFunction
Function UnregisterForSneak()
UnregisterForAllKeys()
EndFunction
Event OnKeyUp(Int KeyCode, Float HoldTime)
If KeyCode == iSneakKey
If playerRef.IsSneaking()
FillAlias()
Else
ClearAlias()
EndIf
EndIf
EndEvent

 

Can Someone Please Help Me!!!
Link to comment
Share on other sites

  • Recently Browsing   0 members

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