Mikero Posted May 8, 2011 Share Posted May 8, 2011 I'm working on a harvesting mod that allows players to harvest resources by hitting an object with a certain weapon. While I got these basics working now, and I'm rather stuck. To keep all the different types of sources and their variables a little manageable I decided to create a script for each type for sources to gather from and gave them the variables experienceGain, quantity and requiredLevel these are then used in the weapon to check requiredLevel, add experience and quantity. While the reading works by using the getCrosshairRef and then getVariable. The reason I'm using the getVariable function is because I can not directly just by doing "crosshairRef.quantity" because TESCS then tells me no such variable exists. So the problem I have at the moment is that I can not lower the quantity variable of a resource object. So wondered if anyone can tell me why it's not working this way? Maybe because it's not a direct EditorID reference? And perhaps alternative ways of accomplishing what I'm aiming for. Link to comment Share on other sites More sharing options...
HeyYou Posted May 9, 2011 Share Posted May 9, 2011 assign the crosshair ref to a variable. then use something like getobjectcount on that reference. Link to comment Share on other sites More sharing options...
Mikero Posted May 9, 2011 Author Share Posted May 9, 2011 I did actually put the result of getCrosshairRef into a ref variable which allows to read thesevariabels with the getVariable function. But is not allowed me to change variables. What I'm actually trying to do is to decrease the quantity of available ores in each individualrock by decreasing the quantity variable on that rock script. This way I hope to get a moremanageable environment because I just have to read and write to standard variables, so changingand adding new sources would just be adding a new script having these variables. But since this is not really working at the moment, I might rethink the whole structure and tryto think of another way to provide the same or even more flexibility. But first I think I'll tryreplacing my rocks(sources) to containers, fill them dynamically and use getItemCount, removeItem and addItem to manage the quantity. This may solve this problem. Still, does anyone have any idea why I can't access those reference variables? I might bump into this problem again later. Thanks Link to comment Share on other sites More sharing options...
fg109 Posted May 9, 2011 Share Posted May 9, 2011 I don't know, but I suspect it might be the same thing as you do. Have you tried changing your script to using the EditorID reference? I know that wouldn't help your mod at all, but just do it as a test to figure out if that's the problem. Another possibility might be that you can only do it that way for persistent objects. Link to comment Share on other sites More sharing options...
Recommended Posts