Jump to content

[LE] How to send an object elsewhere in Papyrus?


Recommended Posts

Hello!

 

So, while in the proccess of creating my first quest mod ever, I stumbled across this, basically:

 

The character will find a certain item in the dungeon(that object being a static mesh), after interacting with this object(which is an activator), the player gets an item, ok, till this part, I scripted it without problems, after this I want to get rid of this activator/object, otherwise the player will infinitely get the item, but I dont know how to do it, the Papyrus wiki is confusing me in this part.

 

and also, that said, can I move mutiple objects to the same place using this same script?

 

Thank you!

Edited by FunkyGandalfCat
Link to comment
Share on other sites

try Disable()

 

Link Multiple Object to an X Marker & apply script to that.

 

Also 'If' Statements can used, like.

actor PlayerREF = game.GetPlayer()
If(PlayerREF.GetItemCount(YourObject) != 0 && Quest.GetStage() == 25)
    PlayerREF.AddItem(YourObject)
EndIf

Also I 'think' there is a Default Disable Activator Script after use too, using States. Don't quote me on that, I not gonna check it. Anywho type Default and have a look at what's available.

Link to comment
Share on other sites

try Disable()

 

Link Multiple Object to an X Marker & apply script to that.

 

Also 'If' Statements can used, like.

actor PlayerREF = game.GetPlayer()
If(PlayerREF.GetItemCount(YourObject) != 0 && Quest.GetStage() == 25)
    PlayerREF.AddItem(YourObject)
EndIf

Also I 'think' there is a Default Disable Activator Script after use too, using States. Don't quote me on that, I not gonna check it. Anywho type Default and have a look at what's available.

Thanks for your reply.

That is very helpful.

But how do I actually move the object? I would like the object to completely disappear after interacting with it.

Link to comment
Share on other sites

 

try Disable()

 

Link Multiple Object to an X Marker & apply script to that.

 

Also 'If' Statements can used, like.

actor PlayerREF = game.GetPlayer()
If(PlayerREF.GetItemCount(YourObject) != 0 && Quest.GetStage() == 25)
    PlayerREF.AddItem(YourObject)
EndIf

Also I 'think' there is a Default Disable Activator Script after use too, using States. Don't quote me on that, I not gonna check it. Anywho type Default and have a look at what's available.

Thanks for your reply.

That is very helpful.

But how do I actually move the object? I would like the object to completely disappear after interacting with it.

 

 

Disable() should do the trick.

Link to comment
Share on other sites

 

 

try Disable()

 

Link Multiple Object to an X Marker & apply script to that.

 

Also 'If' Statements can used, like.

actor PlayerREF = game.GetPlayer()
If(PlayerREF.GetItemCount(YourObject) != 0 && Quest.GetStage() == 25)
    PlayerREF.AddItem(YourObject)
EndIf

Also I 'think' there is a Default Disable Activator Script after use too, using States. Don't quote me on that, I not gonna check it. Anywho type Default and have a look at what's available.

Thanks for your reply.

That is very helpful.

But how do I actually move the object? I would like the object to completely disappear after interacting with it.

 

 

Disable() should do the trick.

 

I am trying to disable it, but does not work, I guess because its a Activator Property and not a ObjectReference.

But how to make my activator work if its not set a Activator Property? I guess this will no work sadly.

But well, thanks for your help, I actually learned a few things here.

 

This is the Script btw.

Basically, the script was supposed to make the object being used as activator AND another object to dissapear,

____________________________________________________

 

Scriptname GiveGlassMaceScript extends ObjectReference

Activator Property GlassMaceLightActivator Auto
WEAPON Property GlassMace Auto
ObjectReference Property GlassMaceLightON Auto
EVENT onActivate(ObjectReference akActionRef)
Game.GetPlayer().AddItem(GlassMace, 1, false)
GlassMaceLightON.Disable()
EndEvent
____________________________________________________
When I compile like this it works.
But if I add the line:
GlassMaceLightActivator.Disable()
The compile fails.
Take a look:
____________________________________________________
Scriptname GiveGlassMaceScript extends ObjectReference
Activator Property GlassMaceLightActivator Auto
WEAPON Property GlassMace Auto
ObjectReference Property GlassMaceLightON Auto
EVENT onActivate(ObjectReference akActionRef)
Game.GetPlayer().AddItem(GlassMace, 1, false)
GlassMaceLightON.Disable()
GlassMaceLightActivator.Disable()
EndEvent
_______________________________________________
It fails while compiling this.
Edited by FunkyGandalfCat
Link to comment
Share on other sites

 

What are you attaching the script to in the CK? The activator, correct?

correct.

 

 

You don't need the activator property then. Your script extends object references, and is on the activator object, which means it has access to all the usual ObjectReference functions as run on the object it is attached to.

 

Explicitly, you can call self.Disable(), but Papyrus will also understand just Disable().

Link to comment
Share on other sites

 

 

What are you attaching the script to in the CK? The activator, correct?

correct.

 

 

You don't need the activator property then. Your script extends object references, and is on the activator object, which means it has access to all the usual ObjectReference functions as run on the object it is attached to.

 

Explicitly, you can call self.Disable(), but Papyrus will also understand just Disable().

 

Thank you sir, It worked!

Sorry about my lack of knowledge, scripting is quite hard to me, I go more for the 3d modelling side.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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