Hey Chris (all),
I've been looking through here but can't find anything relevant to my new problem. I have a custom action I've made that can set or get an Inventory Items property value, the custom action works perfectly as required however there is a very weird issue that I'm struggling with. I've created the custom action by butchering other actions as I'm not very advanced at all when it comes to scripting.
Essentially I have certain evidence items that the player can pick up. At time of pick up I check whether they are wearing gloves or not (or whether they have previously touched the item without gloves on) and then based on that information I can then set the property value of the piece of evidence they have just collected. So if they used their gloves then set property value 0, if they used their gloves this time but touched the item with their hands previously then set property value as 1 and if they never used their gloves at all then property value is 2. So with the custom action I have I can, within the action list editor, select the relevant inventory item via a popup and then in the below pop up I can set which property value to set (either 0, 1 or 2). So I can set these up so that if A happens then set property value to 0, if B then 1 and if C then 2 however when I then click play at runtime all the property value fields reset to 0 in the action list? So I'm left with if A then 0, if B then 0 and if C then 0.
If I change these values in the actionlist at runtime during play mode then they don't change and it works fine however that's obviously not a fix at all. Not sure if it matters but the values stay at 0 then once I exit play mode too. I'm really not sure what is forcing these values to reset back to 0 at runtime, I presume a snippet of my custom action code is required to assess the problem, I'll send this if acceptable however I'll await the ok from Chris, I don't believe this will be an issue however always worth checking first when it comes to AC code, even though it is a custom action.
Thanks in advance,
Mike.
Comments
Doesn't sound like I'll be able to do what I want then? I made sure that I was accessing the runtime inventory in my script so no issues there however even if I followed the tutorial you kindly linked for writing my own global save data to save the new property value I'm stuck with regards to how I actually set the value considering the fact that I'm unable to specify values in the action list editor because of them resetting to 0 at runtime.
It's not to worry, I'll have to look into possibly just setting up a few global variables that can track each items 'property' but I'll remove the actual properties from the Inventory and just use Global variables. It'll mean I'll have a few more variables to create but it's not an issue at all.
So it seems I've just misunderstood the use of Inventory Properties, obviously if I'm the only one requiring the above then just ignore me. Thanks Chris, whilst it wasn't the answer I was hoping for it at least gives me the answer I needed to know what I now need to do to rectify. Thanks again.