Jump to content

Working on a script.


wilwhitt56

Recommended Posts

Working on a script for my mod. For now it's suppose to be attached to an activator that removes rubble when you touch it. I'm also wanting to make to so its give some of that rubble as quarried stone. The script saved, but it's not activating when I touch the shovel ( the activator model).

 

Here's what I got so far:

Scriptname 00RockRemoveScript extends ObjectReference
ObjectReference Property 00RubbleXMarker Auto
Event OnActivate(ObjectReference akActivator)
If akActivator == Game.GetPlayer() ; did player activate
00RubbleXMarker.Disable()
EndIf
EndEvent
I'm not sure what went wrong, maybe someone with more experience can see the problem? Also, how would I add the bit for putting quarried stone in the player's inventory?
Link to comment
Share on other sites

Did you assign the rubble to the property in the properties window?

 

In the Creation Kit, open the record with the script attached (should be the activator or the pre-placed activator reference), highlight the script and press the properties button. A new window appears, if your 00RubbleXMarker property variable name is the same as the Editor ID name of the desired object, select auto-fill. Otherwise, select the property and use the input fields that appear to the right to assign the correct object.

 

If you did assign the correct data to the property and it is still not working, test on a new game. Using COC from the main menu to jump to a nearby area is sufficient unless you have specific requirements that need to be met first.

 

Also, make sure that you compile / build the script. Saving the PSC file is not enough. The PEX needs to be created for the game to see it.

Link to comment
Share on other sites

I should have noticed that. Do not name your scripts, variables or editor objects with leading numerals. It does not work out well. You can use numerals at the end or in the middle but not the beginning.

So if I did it, it would look more like this?:

 

Scriptname RockRemoveScript extends ObjectReference
{ObjectReference Property RubbleXMarker Auto
Event OnActivate(ObjectReference akActivator)
If akActivator == Game.GetPlayer() ; did player activate
RubbleXMarker.Disable()
EndIf
EndEvent}
Link to comment
Share on other sites

 

I should have noticed that. Do not name your scripts, variables or editor objects with leading numerals. It does not work out well. You can use numerals at the end or in the middle but not the beginning.

So if I did it, it would look more like this?:

 

Scriptname RockRemoveScript extends ObjectReference
{ObjectReference Property RubbleXMarker Auto
Event OnActivate(ObjectReference akActivator)
If akActivator == Game.GetPlayer() ; did player activate
RubbleXMarker.Disable()
EndIf
EndEvent}

 

It's still not showing the ObjectReference property. I'm not sure why it isn't? Should I try to make a new Property?

Link to comment
Share on other sites

Are you creating the script from scratch in the Creation Kit? If yes, you are doing something wrong.

 

When you create a script and a small window appears that asks for a name and a description, just put in the desired name. The code does not go into the description field. Once you okay out of that window a new one should appear that will have the script name line. That is the window to put the code into. If your code is wrapped in { } then it will be commented out and not be able to do anything.

 

EDIT:

Take a look at the following:

https://www.creationkit.com/index.php?title=Bethesda_Tutorial_Papyrus_Hello_World

part way down you will find a picture of a window labeled "Add new script". The note underneath gives further explanation.

Edited by IsharaMeradin
Link to comment
Share on other sites

 

 

I should have noticed that. Do not name your scripts, variables or editor objects with leading numerals. It does not work out well. You can use numerals at the end or in the middle but not the beginning.

So if I did it, it would look more like this?:

 

Scriptname RockRemoveScript extends ObjectReference
{ObjectReference Property RubbleXMarker Auto
Event OnActivate(ObjectReference akActivator)
If akActivator == Game.GetPlayer() ; did player activate
RubbleXMarker.Disable()
EndIf
EndEvent}

 

It's still not showing the ObjectReference property. I'm not sure why it isn't? Should I try to make a new Property?

 

Got it working. Here's the new one:

Scriptname RockRemoveScript extends ObjectReference
ObjectReference Property RubbleXMarker Auto
Event OnActivate(ObjectReference akActivator)
If akActivator == Game.GetPlayer() ; did player activate
RubbleXMarker.Disable()
EndIf
EndEvent
Apparently I needed to make a new property for it.
Link to comment
Share on other sites

Got it working. Here's the new one:

Scriptname RockRemoveScript extends ObjectReference
ObjectReference Property RubbleXMarker Auto
Event OnActivate(ObjectReference akActivator)
If akActivator == Game.GetPlayer() ; did player activate
RubbleXMarker.Disable()
EndIf
EndEvent
Apparently I needed to make a new property for it.
EDIT: Whoops, sorry for a double post.
Edited by wilwhitt56
Link to comment
Share on other sites

So if I did it, it would look more like this?:

 

Scriptname RockRemoveScript extends ObjectReference

 

{ObjectReference Property RubbleXMarker Auto

 

Event OnActivate(ObjectReference akActivator)

If akActivator == Game.GetPlayer() ; did player activate

RubbleXMarker.Disable()

EndIf

EndEvent}

In this version, you pasted your code into the "description comment box". See the extra accolades {}.

 

The compiler only saw a blank script... with a comment.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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