wilwhitt56 Posted May 28, 2023 Share Posted May 28, 2023 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() EndIfEndEvent 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 More sharing options...
IsharaMeradin Posted May 28, 2023 Share Posted May 28, 2023 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 More sharing options...
Oblivionaddicted Posted May 29, 2023 Share Posted May 29, 2023 The editor ID's and references that start by a letter contribute to the game's stability. The other ones are a cause of instability. I don't know anything about Papyrus scripting by the way. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 29, 2023 Share Posted May 29, 2023 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. Link to comment Share on other sites More sharing options...
wilwhitt56 Posted May 29, 2023 Author Share Posted May 29, 2023 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() EndIfEndEvent} Link to comment Share on other sites More sharing options...
wilwhitt56 Posted May 29, 2023 Author Share Posted May 29, 2023 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() EndIfEndEvent} 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 More sharing options...
IsharaMeradin Posted May 29, 2023 Share Posted May 29, 2023 (edited) 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_Worldpart way down you will find a picture of a window labeled "Add new script". The note underneath gives further explanation. Edited May 29, 2023 by IsharaMeradin Link to comment Share on other sites More sharing options...
wilwhitt56 Posted May 29, 2023 Author Share Posted May 29, 2023 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() EndIfEndEvent} 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() EndIfEndEvent Apparently I needed to make a new property for it. Link to comment Share on other sites More sharing options...
wilwhitt56 Posted May 29, 2023 Author Share Posted May 29, 2023 (edited) 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() EndIfEndEvent Apparently I needed to make a new property for it. EDIT: Whoops, sorry for a double post. Edited May 29, 2023 by wilwhitt56 Link to comment Share on other sites More sharing options...
xkkmEl Posted May 30, 2023 Share Posted May 30, 2023 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() EndIfEndEvent}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 More sharing options...
Recommended Posts