-
Posts
9 -
Joined
-
Last visited
minekip's Achievements
-
really need help in my code, still cannot notice a mistake, so bumping...
-
Hi guys, I wonder what's wrong with my script... It seems that something's wrong with me so I'm doing stupid things the whole day! Problem is: I have the function that runs OnPlayerLoadGame. Function SetCarryWeight() Actor ak = Game.GetPlayer() float icw = ak.GetAV("CarryWeight") CarryWeight_Storage.SetValue(icw) float cw = icw - CarryWeight_Delta.GetValueInt() float cwMax = CarryWeight_Limit.GetValueInt() if cw > cwMax cw = cwMax endIf ak.SetAV("CarryWeight", cw) endFunction And somehow ingame I have CarryWeight set not to cw (if it supposed to be, for example, 125, when Limit is 150), but to cwMax! What's wrong??
-
Maybe I should use OnStoryScript event, but again, we'll need to extend an ObjectReference of every item to use OnContainerChange...
-
I've tried to make a discover dead body quest with and without Actor and Dead Actor event refs. Still can't get it to work. Can someone show me how to use that OnStoryDiscoverDeadBody?
-
Thank you for tips. I thought about using OnStoryDiscoverDeadBody() event to block activation of items when looting, but not really understood how can I work with this. As far as I'm concerned, I need to make a quest with a script extending it and use OnStoryDiscoverDeadBody event there. But this just not works for me, likely because I don't know how to set a quest in CK properly. Here's the approximate code of the script: Scriptname QuestScript extends Quest Hidden ;some properties Event OnStoryDiscoverDeadBody(ObjectReference akActor, ObjectReference akDeadActor, Location akLocation) Debug.MessageBox("Dead body discovered") Actor ak = Game.GetPlayer() if (akActor as Actor) == ak int iFormIndex = akDeadActor.GetNumItems() while iFormIndex > 0 iFormIndex -= 1 Form kForm = akDeadActor.GetNthForm(iFormIndex) if (SomeCondition) (kForm as ObjectReference).BlockActivation(true) else (kForm as ObjectReference).BlockActivation(false) endIf endWhile endIf endEvent So Debug.MessageBox not appears ingame. I really think that I just haven't set proper quest parameters in the CK. Can anyone help me with this? What parameters should I set for a quest? Well, that's just the first part. Next thing is containers which are not dead bodies and no container (World). It's a shame that we haven't got an event like OnContainerOpen(ObjectReference akContainer) because with that event we could simply work with any container (not World) and its items. And I also thought about an event which may allow us to work with any item in the currently loaded world cell (where player is). I was searching for that event, but haven't found it. Imagine how convenient it would be if we could simply Pre-Hook any event :)
-
The basic idea is that this script is attached to player (NOT to the item) and filters EVERY item that player tries to pick up/loot/etc. For example, if player is looting a dead body and takes a cuirass (when he already had one), the script should prevent him from taking that cuirass.
-
Thank you, but this event haven't got a "Form akBaseItem" parameter, which is essential for me since I extend ReferenceAlias script, not ObjectReference one.
-
For example, at the very beginning of the game, in Helgen, the game prevents you from picking items up saying "Your hands are bound." There must be a script for this, but I can't find it.
-
Hi guys! I wonder if we can make "pre-hooks" in Papyrus. Certain programming languages have something like "EventHookMode_Pre" parameter when hooking an event, which is very convenient. Anyway, how can I prevent player from adding a certain item to the inventory BEFORE he tries to add it? At the moment, my script has something like that: Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) Actor ak = Game.GetPlayer() if akBaseItem as Armor ;not exactly this, but some condition int Count = ak.GetItemCount(Keyword.GetKeyword("ArmorHelmet")) + ak.GetItemCount(Keyword.GetKeyword("ClothingHead")) int nCount = Count - 1 if Count > 1 ak.RemoveItem(akBaseItem, nCount, true) akSourceContainer.AddItem(akBaseItem, nCount, true) endIf endIf endEvent So the item goes to the player's inventory and THEN if goes back to the source container (and if the container is a dead body that was equipping a cuirass, cuirass won't equip back on that body), but I want to make the script check if the item suits a condition and only THEN allow or disallow player to take it. Sorry for bad english if it's bad :)