Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Class #1 - Start here for Basics


WillieSea
 Share

Recommended Posts

I solved it - or at least loading a save without the mod loaded and then using the button fixes it. Sorry, I know you said only to use a clean save, but I thought I was avoiding the potential issue there by writing the script again with a new name. I didn't delete the old scripts though, so it seems that the game ran both the old and the new at the same time - even though the button only had one attached. So thanks, and apologies again :(

Link to comment
Share on other sites

Sure did! It's something else to see that behaviour in action - I'd wondered about it ever since I read about it.

So, for the sake of argument, if I were releasing a mod with a feature like this, how would I update it? Would I have to disable the original button with the first script and replace it with a new button and script? Or would it be enough in this case to update the content of the original script? My understanding was that you couldn't update the content of a script because the game would always remember the first version, but that's different to the game assuming that script X is still attached to an object even if that object now only has script Y attached.

Link to comment
Share on other sites

For the most part, just updating the script is all you need to do.

A dirty save game would be created if you delete a script and add another one. As you saw, it now has both scripts on it, one from the save game and one from the changed mod.

Most script changes will not be a problem, but sometimes based on the change you make, the player would need to clean his save game of your mod and then re-enable the mod again.

Cleaning a save game would be disabling your mod and deleting the scripts from the scripts folder. Load up their save game and save it again. It would now be a clean save game of your mod.

Then they can reinstall the new version of the mod and re-enable it.

Link to comment
Share on other sites

  • 2 weeks later...
Or what-ever you named it in the message objects list.

Yep, that's what tripped me up. :)

Speaking of which, the indentation is always what kills me. Is there any way you could include the number of indents for each line in the script?

Edited by Tigersong
Link to comment
Share on other sites

  • 1 month later...

Wow, this has helped me a great deal. Now I can begin to understand Skyrim script. However what I am attempting to do is a bit different.

I wish to create an activator/trigger like such used on mannequins except on a custom made soul gem garden so then the player may be able to

"cultivate" the garden placing several soul gems in his inventory and removing the displayed soul gems within the garden. Hopefully it is clear,

what I am trying to do and I could really use some clear instructions from someone who knows there way around Skyrim scripts. Thanks in advance!

Also! I have figured out from hours of experimentation, how to use a trigger/activator to display carpets throughout my home. However I wish to be

able to then remove them and switch back and forth. Also again I want to have it so that triggering the carpets to display removes a pile of rolled static

carpets from the room and vise-versa for removing the rugs from the room.

Link to comment
Share on other sites

I don't know what you mean by the soul gem garden. :shrug:

The rugs are easy. You might benefit from taking the general CK tutorials as well, by DarkRider.

The 'Holiday decorations' in the Levelers Tower use this formula.

1. Place an Xmarker. All the objects you want to 'enable' or 'disable' all at once, you click on the 'Enable parent' tab for that object, and point to the Xmarker you placed.

2. The script would then 'enable' or 'disable' just that Xmarker, and it will enable and disable all the children you setup to the xmarker.

3. If you wish objects to be the opposite enable state of the xmarker, just click the check box on the enable parent tab.

This would be used to 'enable' the rugs on the floor, and 'disable' the rug rolls all at the same time.

All vanilla player home upgrades are done this way too.

Link to comment
Share on other sites

Well you see this is what I did, I used your leveler's tower broom which sweeps the tower of cobwebs as a model to get myself started. However the only way I was able to have it work

was with the script directly linked to each object, once I tried using the xmarker just as you described, It would not work particularly the items would spawn as enabled when I wanted them

to spawn disabled. I tried for hours experimenting and attempting to get it to work with the xmarker before I finally gave up. I am getting ready to leave my home currently and wont be back

to my computer until later in the day, when I return I will try again and leave more details for you here. Thank you for your help thus far.

As far as the soul gem garden; I have created using vanilla creation kit static objects (blackreach crystals, grand soul gem static) a garden or rock and soul gems.

What I wish to be able to do is activate the garden and "harvest" it as the player would a chicken's nest. So a soul gem would be added to the players inventory

and the displayed static soul gems within the garden would disappear. All as if the player had reached down, picked the soul gems from the garden, reached around

and placed them in his pack. Hopefully this description is easier to understand. Again Thank you!

Edit: It works! I found my mistake was checking the "initially disabled" field on each individual static object, instead I only checked "initially disabled" on the parent xMarker. And It works just as

I had hoped, thanks to you! You cannot imagine how grateful I am. I am now on way to having a fully functional and unique player home that actually requires the players maintenance as

a real home requires cleaning and etc.

Edited by HaileySkyrim
Link to comment
Share on other sites

If your going to continue this discussion, please open a new thread so we don't bloat this training thread with non-tutorial posts.

The garden would be similar to the rugs. But the script would be more complex because your giving the player something.

The script would have to decide 'when' to populate the gem patch. Now there are two ways I can think of to do the rest.

1. It would then enable the static display of a gem that you placed for a visual. Then when the trigger is activated, it disables the soul gem and gives the player a soul gem.

2. It would spawn a soul gem at a placed XMarker in the garden, so the player could just go pick it up.

Edited by WillieSea
Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...

Sorry for gravebumping (does it count as gravebumping when it's a sticky thread?), but I'm having some trouble with a script I wrote based on this, and if it's a syntax problem, it's evaded me.

 

I only have one computer available right now, and I'm running 40-something ESM/ESP files on it between various mods and High Res. This has made the player.additem console command tricky to utilize given load order and all, so I've been looking around for a while now for a better way to get a copy of a given mod object in my inventory on command. Surprisingly enough, after some days spent looking, the simplest way I could find to do that was in this tutorial.

 

I imagine I could attach the script to an inventory item (once I got one in my inventory...) and do the same thing like I see in some mods, but for now I just tried the button.

 

The script is supposed to give me one copy of the book corresponding to the menu button I press. The messages seem to be set up correctly, and the menu displays on button press, but when I hit a button (menu item) in the menu, it brings up an empty message box, just a horizontal line and an OK button, and doesn't add the chosen book. If I comment out the .show() lines in the if/elsif options, it will just close. I've checked my inventory after trying, and it doesn't silently add them, they just don't show up at all. I'm sure I have the variable names right. I tried MiscObject first for the object declares, and it does the same thing. I got to using Book instead through experimentation. I also tried appending .GetReference() to each of the book objects in the Additems lines, but that failed to compile too.

 

I'm guessing there's some extra function I have to call to get non-gold items or for books specifically, but I haven't found any answers from forums or the creation kit wiki.

 

Any idea what I might need to change?

Code is below.

 

Edit - I'm not sure why it has the odd background stripes or how to get rid of them, so if your eyes are bleeding, here it is on pastebin:

http://pastebin.com/rWkc61E4

Scriptname mskd_itemMenu extends ObjectReference  
{Menu for custom items}

Message Property Question  Auto  
{Menu description}
Message Property SacDef  Auto  
Message Property MTel01  Auto  
Message Property MTel02  Auto  
Message Property MTel03  Auto  
Message Property GHToil  Auto  
Message Property BosGam  Auto  
;Various buttons, like menu, message items I made in Creation Kit.

Book Property mskd_SacredDefiance  Auto
Book Property mskd_ManyTell01  Auto
Book Property mskd_ManyTell02  Auto
Book Property mskd_ManyTell03  Auto
Book Property mskd_GoodHonestToil  Auto
Book Property mskd_BosmerianGambit  Auto
;The script doesn't know about game objects unless I name each one specifically, so Book does that.
;I also tried MiscObject, it ran but didn't add to inventory. BookItem and BookObject fail to compile.

int Button
;Keeps track of the button index, that is, which of the question messagebox options is chosen


EVENT onActivate(objectReference akActionRef)
;" akActionRef is a variable name you will be using in the script below. It holds the reference of the actor that activated the object this script is attached to. For clarity, you should leave it named as is."

	If akActionRef == Game.GetPlayer()
	;Checking if the variable 'akActionRef ' is the player.
	
		Button = question.show()
		;Display the 'question' text, get the index number of the item ('button') chosen.
		
		if button == 0
			SacDef.show()
			;Keep this option showing while the rest disappear and the action happens, like in conversations.
			Game.GetPlayer().AddItem(mskd_SacredDefiance,1,true)
			;Place item in player inventory.
			
		elseif button == 1
			MTel01.show()
			Game.GetPlayer().AddItem(mskd_ManyTell01,1,true)
			
		elseif button == 2
			MTel02.show()
			Game.GetPlayer().AddItem(mskd_ManyTell02,1,true)
			
		elseif button == 3
			;MTel03.show()
			Game.GetPlayer().AddItem(mskd_ManyTell03,1,true)
			
		elseif button == 4
			GHToil.show()
			Game.GetPlayer().AddItem(mskd_GoodHonestToil,1,true)
			
		elseif button == 5
			BosGam.show()
			Game.GetPlayer().AddItem(mskd_BosmerianGambit,1,true)
		endif
		;No more if/elsif/else statements on this level.
	Endif
endEVENT
Edited by maskedbucklander
Link to comment
Share on other sites

The 'bars' are probably coming from what-ever program you use to write your code. I suggest you copy your code to notepad, select it all again and copy it. Then paste it on web-sites. A lot of programs out there 'add' formatting which gets copied to the website as well.

 

Some causes to the problem your having:

 

1. Are you using a clean save game?

 

2. Have you verified that you set the properties pointing to actual objects that can be put in the players inventory?

 

3. Put the secondary 'show' commands AFTER you do the 'addItem' command. Since this second message is 'blank' I will assume you have not pointed the properties in the script to these messages.

 

For your testing, remove all parameters from the 'addItem' command. You can put them back once you verified everything is working.

example: Game.GetPlayer().AddItem(mskd_SacredDefiance)

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...