YanL Posted July 3, 2018 Share Posted July 3, 2018 (edited) Hello guys. Ok, I create a new item, a hotplate. When you drop it, you can cook in it. To do that, I make a copy of the campfire script for this item. But I want to pick up in sneak mod. I add this two lines to the copy of the campfire script 1) If player.IsSneaking == 12) ????3) EndIf So, what do I put on the middle line that allows me to pick up the item in sneak mod? Because the pick and use buttons are the same, so I need something more. Any ideas? :smile: Edited July 3, 2018 by YanL Link to comment Share on other sites More sharing options...
JustChill Posted July 3, 2018 Share Posted July 3, 2018 Where is that "If player.isSneaking" located?GameMode or OnActivate? Because if it would be in "OnActivate" block you can simply add this into it. Begin OnActivate Player if player.isSneaking player.additem <your cooking pot> 1 1 ;--> the second 1 is to not display an "additem" message Disable MarkForDelete else <Everything the pot should do while you are NOT sneaking, but activating it. ;)> endif end Link to comment Share on other sites More sharing options...
YanL Posted July 3, 2018 Author Share Posted July 3, 2018 Sorry. It locate in OnActivate. scn AAACampfireScript ; Launches crafting interface for recipes in the "CampfireRecipes" category.; JES 3.7.10 Ref User Short bAwaitingInputShort iButtonVar BEGIN OnActivate Set User to GetActionRef; If ( GetActionRef != Player ) User.Activate; Elseif ( GetActionRef == Player )If ( Player.IsInCombat == 1 ) ; Added for Bug ID# 58858. (1-3-11) ETBShowMessage NVDLC02CampfireNoActivateMSG ; ; <<<Else ; <<<If ( Player.HasPerk NVDLC02HomeOntheRange ) ; Added for Bug ID# 58251. 1/15/11 ETBIf ( GetIsID CampfireCrafting01 || GetIsID CampfireCrafting02 || GetIsID CampfireCrafting03 || GetIsID CampfireCrafting04 || GetIsID NVDLC02Campfire01 || GetIsID NVDLC02Campfire02 || GetIsID VCG03CampfireCrafting03 ) ; Added for Home On The Range Perk. (11_11_10) -ETB ShowMessage NVDLC02HomeOnTheRangeMessage; ; [NOTE: The above "GetIsID" list is checking for every Campfire created to filter out "NVDLC01CraftingOven" (so the Player can't sleep there and break NVDLC01). Any new Campfires need to be added here.] 1/6/11 ETBSet bAwaitingInput to 1; ; <<< (ID# 58251 cont.)Else ; <<<Player.ShowRecipeMenu CampfireRecipes; ; <<<Endif ; <<<Else ; <<< Player.ShowRecipeMenu CampfireRecipes; ; <<<EndifEndif EndifIf player.IsSneaking == 1?????????????????????????????????????????????????????????????????????????????EndifEND; onactivate I will take away the home of the ranger perk later. Link to comment Share on other sites More sharing options...
JustChill Posted July 3, 2018 Share Posted July 3, 2018 if player.isSneaking player.additem <your cooking pot> 1 1 ;--> the second 1 is to not display an "additem" message Disable MarkForDelete else <Everything the pot should do while you are NOT sneaking, but activating it. ;)> endif end Ah sorry, I've edited my post. ^^ Link to comment Share on other sites More sharing options...
JustChill Posted July 3, 2018 Share Posted July 3, 2018 Sorry. It locate in OnActivate. scn AAACampfireScript ; Launches crafting interface for recipes in the "CampfireRecipes" category. ; JES 3.7.10 Ref User Short bAwaitingInput Short iButtonVar BEGIN OnActivate Set User to GetActionRef; If player.IsSneaking == 0 If ( User != Player ) User.Activate; ==> I don't think anyone else than the player needs to activate it? But I leave it to you. :)' Elseif ( User == Player ) If ( Player.IsInCombat == 1 ) ; Added for Bug ID# 58858. (1-3-11) ETB# ShowMessage NVDLC02CampfireNoActivateMSG ; ; <<< Else ; <<< If ( Player.HasPerk NVDLC02HomeOntheRange ) ; Added for Bug ID# 58251. 1/15/11 ETB# If ( GetIsID CampfireCrafting01 || GetIsID CampfireCrafting02 || GetIsID CampfireCrafting03 || GetIsID CampfireCrafting04 || GetIsID NVDLC02Campfire01 || GetIsID NVDLC02Campfire02 || GetIsID VCG03CampfireCrafting03 ) ; Added for Home On The Range Perk. (11_11_10) -ETB ShowMessage NVDLC02HomeOnTheRangeMessage; ; [NOTE: The above "GetIsID" list is checking for every Campfire created to filter out "NVDLC01CraftingOven" (so the Player can't sleep there and break NVDLC01). Any new Campfires need to be added here.] 1/6/11 ETB' Set bAwaitingInput to 1; ; <<< (ID# 58251 cont.#) Else ;<<< Player.ShowRecipeMenu CampfireRecipes; ; <<< Endif ; <<< Else ; <<< Player.ShowRecipeMenu CampfireRecipes; ; <<< Endif Endif Endif else player.additem <your cooking pot> 1 1 ;--> the second 1 is to not display an "additem" message Disable MarkForDelete Endif END; onactivate I will take away the home of the ranger perk later. May I ask... Why do you use "User.Activate"?Is this some kind of bugfix? Link to comment Share on other sites More sharing options...
EPDGaffney Posted July 3, 2018 Share Posted July 3, 2018 Actually, you can just make the hotplate a regular misc item and make the beginning of the script Begin OnActivate If IsActionRef Player ; 'OnActivate Player' is bugged and will be called when anyone activates it, so use this instead. If Player.IsSneaking Activate EndIf EndIf else Link to comment Share on other sites More sharing options...
EPDGaffney Posted July 3, 2018 Share Posted July 3, 2018 (edited) Oh, hadn't read the Campfire script and kind of forgot what we were doing. My previous comment was amending JustChill's first script example. I was saying, we don't need to add a separate item form. Unless, how do you set the hotplate down to begin with? Do you just drop it? Can you grab it with Z afterwards and fling it about the place? or were you replacing it with a static at some point? And JustChill, that User.Activate line looks like the bug fix I was commenting in my script excerpt above, just another (and for whatever reason more complex) way of doing it. Edited July 3, 2018 by EPDGaffney Link to comment Share on other sites More sharing options...
JustChill Posted July 3, 2018 Share Posted July 3, 2018 'OnActivate Player' is bugged and will be called when anyone activates it, so use this instead. Thanks for confirming.I actually heard that from my trainer too, but as he told also some bad stuff like let string := sv_destructI started to question a few things. Guess I am not gonna use it anymore then. :D Link to comment Share on other sites More sharing options...
EPDGaffney Posted July 3, 2018 Share Posted July 3, 2018 He must have confused Ar_Null and SV_Destruct, would be my guess. And remember I mentioned this: If ( Player.IsInCombat == 1 )can be more efficiently rendered as If Player.IsInCombat ; You can leave the parentheses. They're superfluous here, but some people do it to maintain the habit. Link to comment Share on other sites More sharing options...
JustChill Posted July 3, 2018 Share Posted July 3, 2018 Well... I didn't want to plant more recommendations than necessary onto YanL.Felt a bit bad to do that actually... Don't know. :sad:I am not a teacher just a fan of mindlessly speaking with game engines. ^^ Yet I've to admit... I recently updated my Dynamic Pipboy Light, as I realized that I was way too complicated than I had to. XDI guess it's more accurate to use "Player.IsPlayingAnim Pipboy == 0" than calculating passed time to determine if pipboy animation is over. ^^ So rather take my recommendations just as hint, as I am not that reliable when it comes to be totally clean. XD Link to comment Share on other sites More sharing options...
Recommended Posts