Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

I Brought Pizza and Confusion

4 years ago

Hello there, everyone at the site. I am as my name suggests; LGSilvergate, no surprise there. But the main reason I'm not just quietly sitting in the corner with a typewriter hooked up to the Internet writing my stories is because of a bit of an issue. You see, I was inspired by Dungeon Stompage and was looking to try and emulate it's whole RPG-style with one of my own stories (I find that the best way for me to learn is to dive right in and try out all the working parts).

Unfortunately, I have run into a small bit of a wall: whenever I click on a link to spend a Stat point and increase the character's Intellect, it works fine, but a second time actually adds 1 Stat Point. It then seems to do so at random while Intellect increases as normal. Here is how the link is set: it goes through a variable change, so that is adds 1 to INT (Intellect) and subtracts 1 from STAT (Stat Points). I have check both "Count Multiple" boxes, and it seemed to reduce the problem a slight amount. Can anyone help me with this?

Also, a formal hello to everyone once more, and a thank you in advance. I'm terribly sorry, but I'd much rather just keep to myself for now until I get used to the place, haha.

I Brought Pizza and Confusion

4 years ago
Can confirm that this is happening, but I can't figure out why. Try writing out the scripts, we can at least narrow it down to a bug with using the little boxes if that fixes it. %INT := %INT + 1 %STAT := %STAT - 1

I Brought Pizza and Confusion

4 years ago

I attempted the scripts, but unfortunately the same thing happened. The STAT variable reset to 10 upon the second click. I'm beginning to wonder if it's got something to do with the variables themselves, since I set the starting variable for STAT to 10 and the whole stat-selection page is the starting page. I'm not sure, it just came across my head; STARTING value, STARTING page?

EDIT: Upon further examination, I have deduced that is not the problem. This time, it increased to 11.

I Brought Pizza and Confusion

4 years ago
Can you remove that global script related to exp/maxexp and try again? I suspect that may be where the issue lies, like the link is decreasing one point but the global for some reason is adding two.

I Brought Pizza and Confusion

4 years ago

Ah, yes, that seemed to be the problem, as it appears to be working all fine and dandy now. I'll get to work on editing the leveling system so that it doesn't affect stat point assignments. Thank you for all your help, mizal!

I Brought Pizza and Confusion

4 years ago
You might try first moving it to the global link script instead? I don't use page scripts too often so I'm not as familiar with them, but I think they process at a different time and so it might be overriding your link scripts.

I Brought Pizza and Confusion

4 years ago

Apparently not, but I did find the culprit; since I literally just copied and pasted from the leveling tutorial in Help and Info, I made it so that every page, the EXP increased by 25, and since the MAXEXP variable was 50, it ended up just adding 2 every other page. So now we know what to do for others with, er... similar problems.

I Brought Pizza and Confusion

4 years ago
Lol, yep that'll do it. And I guess I could've like, looked at the rest of the script.

I Brought Pizza and Confusion

4 years ago
I don't use page scripts too often so I'm not as familiar with them, but I think they process at a different time and so it might be overriding your link scripts.

This is true; think of it like this - link scripts activate going into a page. Page scripts activate going out of a page.

I Brought Pizza and Confusion

4 years ago
but $PAGETEXT tho

I Brought Pizza and Confusion

4 years ago
That would be the exception haha!

Seriously, changing a Variable in a Page Script won't show in its On Page Scripting until after you leave the page.

Or that's how it used to work...