Jump to content

Recommended Posts

Hey guys i'm new to scripting btw

i'm trying to make a non vanilla Activator appear preferably in front of an actor or the player

but for the love me cannot get it to work

the script compiles fine but when the spells casted nothing appears

can anybody help me

 

 

 

Scriptname zzWallOrientationScript extends activemagiceffect  


Actor Property Ray  Auto  
Actor Property PlayerRef Auto

;-- Variables ---------------------------------------
ObjectReference Property WallReference  Auto  
Form MyBaseObject

Event OnInit()
MyBaseObject = WallReference.GetBaseObject()
Ray.PlaceAtMe(MyBaseObject)

PlayerRef.PlaceAtMe(MyBaseObject)

EndEvent

 

 

Link to comment

yeah updated the same things happening mmm.. i cant even think of an example script to study

 

Scriptname zzWallOrientationScript extends activemagiceffect  

Actor Property Ray Auto  
Actor Property PlayerRef Auto

;-- Variables ---------------------------------------
Actor CasterActor
ObjectReference Property WallReference  Auto  
Form MyBaseObject
Activator Property wall  Auto  

Event OnInit()
MyBaseObject = WallReference.GetBaseObject()
WallReference.MoveTo(Ray)
WallReference.MoveTo(PlayerRef)

EndEvent

 

 

 

Link to comment
11 minutes ago, kenseikenshin said:

yeah updated the same things happening mmm.. i cant even think of an example script to study

 

Scriptname zzWallOrientationScript extends activemagiceffect  

Actor Property Ray Auto  
Actor Property PlayerRef Auto

;-- Variables ---------------------------------------
Actor CasterActor
ObjectReference Property WallReference  Auto  
Form MyBaseObject
Activator Property wall  Auto  

Event OnInit()
MyBaseObject = WallReference.GetBaseObject()
WallReference.MoveTo(Ray)
WallReference.MoveTo(PlayerRef)

EndEvent

 

 

 

 

Got a screenshot of the properties page from the CK?

Link to comment

Also, "Activator property Wall" is not referenced in the script.  Why is it there?

 

GetBaseObject() does different things depending on the type of script it is extending.  It may not work for an ActiveMagicEffect in the way you are using it.

 

Finally, add some debug code to have the system spit out what it is doing to console or notification, so you can see which step is failing.

Link to comment

at the start i tried to spawn the activator in its raw form didnt work so i created the object reference

13 minutes ago, Seijin8 said:

GetBaseObject() does different things depending on the type of script it is extending.  It may not work for an ActiveMagicEffect in the way you are using it.

ok fair enough, thought i needed the objects id form number to spawn it

 

13 minutes ago, Seijin8 said:

Finally, add some debug code to have the system spit out what it is doing to console or notification, so you can see which step is failing.

ok ill give it a try but my scripting is weak :L thanks for the help btw

Edited by kenseikenshin
Link to comment
19 minutes ago, Seijin8 said:

Event OnInit()
MyBaseObject = WallReference.GetBaseObject()
WallReference.MoveTo(Ray)
WallReference.MoveTo(PlayerRef)

EndEvent

 

Okay, so what this is doing right now is defining MyBaseObject, but then never using it.  Why?

 

You are telling WallReference to moveto Ray, then immediately telling it to move to PlayerRef.  Why is it moving to Ray at all?  It isn't doing anything for the millisecond that it is there.

 

Not trying to crap on you as you are learning (been there done that), but asking what precisely you are trying to do?

 

If all you want is to move an object to the player when a spell is cast, then:

 

ObjectReference Property ObjectToMove auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
	ObjectToMove.MoveTo(akCaster)
EndEvent

 

Should be all it takes.

Link to comment

no go ahead man all criticism is helpful, honestly i'm just looking for a simple method to summon an item

wasnt really to trying to move an existing item, i wanted to spawn a fresh item

 

and after i get better at scripting ill be able to manipulate its positioning

 

 

 

Scriptname zzEarthWallOrientationScript extends activemagiceffect  

;-- Variables ---------------------------------------
ObjectReference Property WallReference  Auto  


Event OnEffectStart(Actor akTarget, Actor akCaster)

    WallReference.MoveTo(akCaster)

EndEvent

 

 

the one property is filled in the item still won't spawn :l

Edited by kenseikenshin
Link to comment

Greetings,

 

I think the issue might be the state of persistence of your placed WallReference. From what I understand, the property WallReference references a placed object in the 000HoldingCell. In order to be able to call the object via script and move it to your position, the object needs to be either a) set to persistent (dunno how this works in the CK, tho, I only use xEdit) or b) at the time of casting the spell must be in the same cell as you are, which is usually not the case.

 

Alternatively, PlaceAtMe is indeed also a script function (tho I had to look it up to be certain, ngl). In order to use it, you need the have your Activator record (NOT the placed ObjectReference in the cell) as a property. So bascially your property "wall" as seen earlier.

Then it could look like this:

 

Scriptname zzEarthWallOrientationScript extends activemagiceffect  

;-- Variables ---------------------------------------
Form Property Wall Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
	ObjectReference tmp = akCaster.PlaceAtMe(akFormToPlace = Wall, aiCount = 1, abForcePersist = false, abInitiallyDisabled = false)
EndEvent 

 

In this case, however, you need to think about cleaning up afterwards, so the object does not stay in the save or something (tho I have to admit I don't know much about this).

Depending on what you are trying to do, it might still be the better solution to have one persistent object, like I described earlier, which you move around. You could do something like this:

 

Scriptname zzEarthWallOrientationScript extends activemagiceffect  
;-- Variables ---------------------------------------
ObjectReference Property WallReference  Auto  

Event OnEffectStart(Actor akTarget, Actor akCaster)
	;move the wall to me
    WallReference.MoveTo(akCaster)
EndEvent 

event OnEffectFinish(Actor akTarget, Actor akCaster)
	;move the wall back home
	WallReference.MoveToMyEditorLocation()
endevent

 

MoveToMyEditorLocation does exactly what it says, it moves the object back to its position as designated in the CK.

So in our example, you would have a spell with a duration, and once the duration wears of, the wall disappears again.

 

Sorry for the long post, but I hope this may be of help to you.

 

Regards, s3ngine

 

Link to comment

Hi s3ngine

 

1 hour ago, s3ngine said:

I think the issue might be the state of persistence of your placed WallReference. From what I understand, the property WallReference references a placed object in the 000HoldingCell. In order to be able to call the object via script and move it to your position, the object needs to be either a) set to persistent (dunno how this works in the CK, tho, I only use xEdit) or b) at the time of casting the spell must be in the same cell as you are, which is usually not the case.

ok that makes sense

 

1 hour ago, s3ngine said:

Alternatively, PlaceAtMe is indeed also a script function (tho I had to look it up to be certain, ngl). In order to use it, you need the have your Activator record (NOT the placed ObjectReference in the cell) as a property. So bascially your property "wall" as seen earlier.

Then it could look like this:

 

Scriptname zzEarthWallOrientationScript extends activemagiceffect  

;-- Variables ---------------------------------------
Form Property Wall Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
	ObjectReference tmp = akCaster.PlaceAtMe(akFormToPlace = Wall, aiCount = 1, abForcePersist = false, abInitiallyDisabled = false)
EndEvent 

Thank you ideally thats what i was looking for

 

1 hour ago, s3ngine said:

In this case, however, you need to think about cleaning up afterwards, so the object does not stay in the save or something (tho I have to admit I don't know much about this).

It will be ok the activator is destructable

1 hour ago, s3ngine said:
Scriptname zzEarthWallOrientationScript extends activemagiceffect  
;-- Variables ---------------------------------------
ObjectReference Property WallReference  Auto  

Event OnEffectStart(Actor akTarget, Actor akCaster)
	;move the wall to me
    WallReference.MoveTo(akCaster)
EndEvent 

event OnEffectFinish(Actor akTarget, Actor akCaster)
	;move the wall back home
	WallReference.MoveToMyEditorLocation()
endevent

Honestly i have uses for both the scripts so Thank you

 

 

Link to comment

s3ngine

You legend works like a charm

i can see why my original attempts failed

 

Thank you to both of you for your time and expetise

 

11 hours ago, s3ngine said:
Scriptname zzEarthWallOrientationScript extends activemagiceffect  

;-- Variables ---------------------------------------
Form Property Wall Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
	ObjectReference tmp = akCaster.PlaceAtMe(akFormToPlace = Wall, aiCount = 1, abForcePersist = false, abInitiallyDisabled = false)
EndEvent 

 

 

 

Edited by kenseikenshin
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use