Jump to content

How to create a PLACEABLE Static?


aviform

Recommended Posts

For example, in camping mods where you buy the models, then go into sneak to place/take tents, furniture, etc. I'd like to add something like this. I know I have to make a model to be the "grab-able" model, since the static will stay static, but aside from that, is there a coding template to work off of?

Link to comment
Share on other sites

There is no CK book, however Youtube and the web are full of examples ... Also you can load up mods and break them down. Most mod makers will leave their scripts. Off the top of my head I can think of one mod maker that created a mod similar to what you're asking. Have a look at [ Kagrenacs Instant Fortress ] mod ... download [ C ] I think. Edited by Jason2112
Link to comment
Share on other sites

You probably won't be working with statics, but with furniture. Depending on what you want to set down, you may need to make your own custom furniture item, too.

 

The mod you want to crack open and use to learn from is Frostfall. It uses the "drop and place" method and Chesko is a very experienced modder, plus all his scripts are included.

 

There's a much simpler model you can use if you need to get the hang of Papyrus first (this is going to be a lot harder if you're learning Papyrus at the same time!), which is to "swap out" instead of "drop and place." In this method you have a Misc item in your inventory, drop it, and then it immediately becomes furniture or you sneak-activate it and it becomes furniture. This is really easy to set up, actually. I added a bedroll item in my own mod with this method and it took all of 15 minutes. :)

 

Send me a PM if you need help with the second method. I haven't looked into the first method myself, haven't needed it yet.

Link to comment
Share on other sites

  • 10 months later...

Well.. I've been trying to figure this out for a week now and finally worked it out. And since I rely on you all out there to share your knowledge, it's only fair I add to this collective "Dovahkiin's Creation Kit Encyclopedia"...

 

  1. Find the object the player should have in their inventory to place, and notate the CK object ID. You will need it later to select from a CK drop down list.
  2. Click EDIT and copy the NIF file path (click inline edit to be able to copy), and close editor (no changes)
  3. In Object window, navigate to static/clutter
  4. Right click and select NEW, set an ID and paste NIF path, then save.
  5. Select newly created object and and place it where you want it in the room. That's the placeholder (it won't initially appear in the list, so go to "All" and filter for it)
  6. Edit and set this object to
    1. initially disabled
    2. do not havok settle
    3. do not respawn
  7. With the placeholder active in render window, click "T in the box icon" in toolbar to make a trigger, choose NEW from list, name it and save
  8. In Render window, edit trigger:
    1. In 3D make sure z-rotation is not 0. This is important due to a bug in game that disables triggers that are exactly 0 on grid.
    2. In Primitive, set to player activate. Otherwise you won't see a prompt in game.
    3. In Linked Reference, create new and select the placeholder. This is when you realize naming your custom stuff well is important. You can't use "select in render window" because your trigger is covering the object.
    4. In Scripts, add this script:
      Scriptname myCoolPlaceableObjectScript extends ObjectReference  
      
      MiscObject Property ItemToPlace  Auto  
      
      Bool Property isPlaced = false Auto Hidden
      Message Property FailMessage auto
      
      Event OnActivate(ObjectReference akActivator)
      	if(isPlaced == FALSE) 
      		if akActivator.getItemCount(ItemToPlace) >= 1
      			isPlaced = TRUE
      			self.getLinkedRef().enable()
      			(akActivator as actor).removeItem(ItemToPlace, 1)
      		else
      			FailMessage.show()
      		endif
      	else
      		isPlaced = FALSE  
      		self.getLinkedRef().disable()
      		(akActivator as actor).addItem(ItemToPlace, 1)
      	endif
      endEvent
    5. Save the script, wait for compiler to finish and close script editor.
    6. Right click the new script and EDIT PROPERTIES:
      1. ItemToPlace: select your CK object ID from step 1. This is the required item that has to be in player inventory to place it.
      2. FailMSG: select defaultLackTheItemMSG
  9. Done!
This will create a totally static object that only uses the existing model and textures from CK, and nothing else. That way you never have issues with weird behavior. The script checks if your item is in the inventory and changes the visibility of the placeholder.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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