xsixkillerx Posted April 9 Share Posted April 9 Okay fellas, I need help. I'm makin this npc and noticed there was a SleepOutfit tab and checkbox thingy inside the sandbox whatchamacallit, after throwin' the fella in a random inn and watching her sleep, xim didn't put on its sleep outfit!... Which I think is BONKERS! So here is the deal, I don't know how to script, but in the Begin/End/Change tab there are little boxes to type in/compile scripts, so I dug around the CK wiki and pulled up a script which I think is the most relevant to my current plight at hand the script being; "Function SetOutfit(Outfit akOutfit, bool abSleepOutfit = false) native" do I just copy paste this into the boxes? My other question is, would placing the script into each box of the Begin/End/Change with abSleepOutfit being changed to abDefaultOutfit for "End," and "Change" respectively be the correct way to go about this? I'll upload screenshots of what I'm lookin at. Link to comment Share on other sites More sharing options...
scorrp10 Posted April 10 Share Posted April 10 You can edit the NPC's Actor record, in the Inventory tab, there is a place you can set their sleep outfit. If sleep outfit is not set, they sleep in their regular outfit. Note, however, that this changes this NPC's base record, which is only used when NPC is initially spawned in the game. After which, the game just uses info from that spawned instance of the NPC. In other words, you usually need to start a whole new game in order for the changes to NPC's base record to take effect. So, to change either outfit mid-game, you can use a script. You found the correct function, but you are using it wrong. Function SetOutfit( Outfit akOutfit, bool abSleepOutfit = false ) native Is what is called a function declaration, which describes function to the compiler. What you need is a function CALL. First, SetOutfit needs to be called on the affected actor, which is passed as parameter to the fragment (akActor) - so you have that. Second, you need an Outfit property. Below those begin/change/end fragments you should have 'attached scripts'. The script starting with PF_ is the one containing those fragments. Select it and click 'Properties'. There, click Add Property, for type, select Outfit, give it a nice name (I.e. ActorSleepOutfit). Click the property you just added, click 'Edit Value', and in Pick Object dropdown, choose the outfit you want the actor to use as sleep outfit. Now, you want this call only in the Begin secton: akActor.SetOutfit(ActorSleepOutfit, true) Link to comment Share on other sites More sharing options...
Recommended Posts