Jump to content

wyz123

Premium Member
  • Posts

    4
  • Joined

  • Last visited

Nexus Mods Profile

About wyz123

wyz123's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Ah! I don't even notice that! I tried what you said. Setting to false did improves the stability of the mod a lot. Unfortunately it doesn't prevent the game from freezing (after 21 calls, far better than before). So weird. Maybe it has something to do with the engine or with my PC. Thank you anyway. I'll try to rewrite this script with other functions.
  2. Here are my log traces. With and without Utility.wait(2.5). I removed Game.GetPlayer().EquipItem(Item,False,True) to test Active() only. http://pastebin.com/JDAcwht0 http://pastebin.com/bgujnxa8 Yes. Nothing appears after the freeze. Yes.
  3. Thanks for replying. GotoState("Busy") is more like setting object's current state to "Busy". Next time the function is called the script will check its state and go to corresponding state. I use state to prevent player from spamming . I am pretty sure it is akTargetRef.Activate(PlayerRef,True) that causes the problem cause no freeze after I remove that statement. But player won't pick up the food if it is removed, making this mod useless.
  4. I added a perk to the player that can let the sole survivor pick up food item and eat directly. Here is my code. ScriptName GrabAndEat Extends Quest ; Properties Perk Property GrabAndEatPerk Auto Const Message Property GrabAndEatMSG_Enabled Auto Const Message Property GrabAndEatMSG_Disabled Auto Const ; Keyword Keyword Property ObjectTypeFood Auto const ; variables Form Item = None Actor PlayerRef Event OnQuestInit() On() EndEvent Function On() If (!Game.GetPlayer().HasPerk(GrabAndEatPerk)) Game.GetPlayer().AddPerk(GrabAndEatPerk,False) GrabAndEatMSG_Enabled.Show(0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0) EndIf EndFunction Function Grab(ObjectReference akTargetRef) GotoState("Busy") PlayerRef=Game.GetPlayer() Debug.trace("Grab() oprerating...") Item=akTargetRef.GetBaseObject() Debug.trace("Item is "+Item) Debug.Trace("prepare to pick up",0) ;game freezes after calling Activate() 11 or 12 times akTargetRef.Activate(PlayerRef,True); Debug.Trace("picked up food",0) Game.GetPlayer().EquipItem(Item,False,True) Debug.Trace("Equiped",0) Utility.wait(2.5) GotoState("") EndFunction State Busy Function Grab(ObjectReference akTargetRef) Debug.Notification("You are chewing") Debug.trace("Grab() BUSY state.",0) EndFunction EndState and the perk fragment code that calls GrabController.Grab() ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment Scriptname PRKGrabAndEat Extends Perk Hidden Const GrabAndEat Property GrabController Auto Const Mandatory ;BEGIN FRAGMENT Fragment_Entry_00 Function Fragment_Entry_00(ObjectReference akTargetRef, Actor akActor) ;BEGIN CODE GrabController.Grab(akTargetRef) ;END CODE EndFunction ;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment Everything works fine except that the game always freezes when you pick up 12th or 13th item. After a few trials and errors I found that it has something to do with akTargetRef.Activate(PlayerRef,True) cause freeze always occurs after the game calls that function 11 or 12 times. I can't figure out why Active() causes the problem and why it happens on 12th or 13th call. Is Active() different from pressing active button ? Does anybody know how to solve this problem? I'm not a native speaker and sorry for my poor English. I hope you understand what I say. :smile:
×
×
  • Create New...