Hi, everyone. What I’m trying to do here is this. I’m trying to have a placeable, say a crystal ball on a pedestal, that will temporarily grant you say +20 to your lore skill when you touch it, but will not do that again until you’ve rested (or else you’re going to be able to raise your lore to ridiculously high levels by touching it again and again). After you’ve rested and your lore skill has gone back to what it originally was, then when you touch the thing again you’ll be granted +20 again – and again this won’t happen a second time until you’ve rested. Does anyone know how all this can be set up?
Here’s how I tried to do it. I set up a placeable with a suitable conversation for it. (You know, something like:
You see a crystal ball.
—> 1. Touch it.
* (Nothing happened.)
* (+20 lore [temp].)
—> 2. Leave.)
I’d then go to Module Properties —> Advanced —> Variables and there I’d declare a variable, ‘touchedball’. Back to the conversation file, at the node that goes ‘+20 lore’ I’d place a suitable script under the ‘Actions Taken’ tab. In the script there would be a line that goes:
SetLocalInt(GetModule(), “touchedball”, 1);
Then at the ‘nothing happened’ node I’d place a suitable conditional script under the ‘Text Appears When’ tab to test if you’ve already touched the ball – thus setting ‘touchedball’ to 1 – whereupon the game would tell you nothing happened. The question now would be how to make ‘touchedball’ reset itself to 0 whenever you rest. (And here’s where the headache begins (sigh)…)
I figured all I had to do was go to Module Properties —> Events —> OnPlayerRest and modify the script there (‘x2_mod_def_rest’) by adding the line
SetLocalInt(GetModule(), “touchedball”, 0);
and then saving the script under some other name. Here’s the strange thing. All this worked beautifully in one module but not at all in another. Why?
I suspect the fact that I used CEP 2.65 in one of the two modules – the one in which it didn’t work out – would have had something to do with it, but I’ve absolutely no idea just how the CEP’s been affecting the thing. (Don’t know if the fact that I used the MBH henchman kit v23 might have got something to do with it all; I used the kit for both modules.) When I tried to save my altered version of ‘x2_mod_def_rest’ in the module that did the job, there were no compile errors. But there were in the module that didn’t do the job; the compiler kept showing another script, ‘x0_inc_HENAI’, and complaining of various errors which I simply had no idea how to rectify.
I tried changing the variable ‘touchedball’ to one that’s attached to the PC rather than the module. Accordingly I was careful to change ‘GetModule()’ to ‘GetPCSpeaker()’ in all the scripts used in the conversation file above, and also change the appropriate line in my altered version of ‘x2_mod_def_rest’ to
SetLocalInt(GetLastPCRested(), “touchedball”, 0);
It worked… not.
What gives? What can I do? Or is there some other strategy I can use to create the crystal ball powerup I described? Any help will be appreciated. Thanks!
(EDIT: Actually, how important is the script ‘x2_mod_def_rest’? Must anything I place in the ‘OnPlayerRest’ slot be only a modification of ‘x2_mod_def_rest’, or can I put a fresh script of my own in the ‘OnPlayerRest’ slot? From what I can tell, ‘x2_mod_def_rest’ only controls whether you can rest when you’re riding a horse and what sorts of encounters you might have when resting etc…)