Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

It's. Not. Working.

10 years ago

IF %EXP >= %MAXEXP AND %LEVEL <= 4 AND %LEVEL >= 0  THEN
BEGIN
%EXP := %EXP - %MAXEXP
%LEVEL := %LEVEL + 1
%MAXEXP := %MAXEXP + 20
END

IF %EXP >= %MAXEXP AND %LEVEL <= 14 AND %LEVEL >= 5 THEN
BEGIN
%EXP := %EXP - %MAXEXP
%LEVEL := %LEVEL + 1
%MAXEXP := %MAXEXP + 50
END

IF %EXP >= %MAXEXP AND %LEVEL <= 29 AND %LEVEL >= 15 THEN
BEGIN
%EXP := %EXP - %MAXEXP
%LEVEL := %LEVEL + 1
%MAXEXP := %MAXEXP + 200
END

IF %EXP >= %MAXEXP AND %LEVEL <= 39 AND %LEVEL >= 30 THEN
BEGIN
%EXP := %EXP - %MAXEXP
%LEVEL := %LEVEL + 1
%MAXEXP := %MAXEXP + 400
END

IF %EXP >= %MAXEXP AND %LEVEL <= 49 AND %LEVEL >= 40 THEN
BEGIN
%EXP := %EXP - %MAXEXP
%LEVEL := %LEVEL + 1
%MAXEXP := %MAXEXP + 600
END

... >_> Why isn't it working?! The EXP keeps going up, the level stays the same, and the MAXEXP stays the same. The coding is valid, apparently, if the editor isn't screwing with me for funzies, but it's not functioning and I honestly don't know why. =\  

It's. Not. Working.

10 years ago

What does MAXEXP start at?

At a glance I can't see anything wrong with it. If you want you can add me as a coauthor and I can check it out a bit more.

It's. Not. Working.

10 years ago

40, and yeah... k.

It's. Not. Working.

10 years ago
When you have multiple True Statements nested like that, it causes problems. Check the logic of your Script. Does the changes made above, impact what the Script checks for below?

It's. Not. Working.

10 years ago

Berka ... I appreciate the attempt to lead me to the conclusion and make me think, but if I understood what the issue was, I wouldn't be asking. xD I'm on burn out from a full time job, man, if you see the problem clearly, please tell me. 

It's. Not. Working.

10 years ago
Silly question, but one that hits me sometimes -- is the code actually getting executed? In other words, if its in a script, are you sure it is getting to this point?

It's. Not. Working.

10 years ago

Uh... ... what?

It's. Not. Working.

10 years ago

If you want you can try this:

IF %EXP >= %MAXEXP THEN
IF %LEVEL <= 4 THEN
IF %LEVEL >= 0  THEN
BEGIN
%EXP := %EXP - %MAXEXP
%LEVEL := %LEVEL + 1
%MAXEXP := %MAXEXP + 20
END

For the statements instead, to circumvent the AND statements that don't appear to be working.

It's. Not. Working.

10 years ago

The AND and OR statements had always been really buggy, but if Kiel wanted to increase the experience and health with each increase of level, there's actually an easier way of doing it, as oppose to writing 20 different blocks of code for it. 

Instead of using that, you can just use percentage, and do it all in one block of code. There's less probability of mistakes happening that way. 

It's. Not. Working.

10 years ago

Well ... ok, but I don't actually know what you mean by use percentage.

It's. Not. Working.

10 years ago

For example:

Increase health by 2% per level, and %MAXEXP by 20% per level. 

It's. Not. Working.

10 years ago

Son of a... it works! It's actually working now. Thanks, Killa. xD Once again, I owe you.

I guess you guys are right, the "AND" statements are too buggy. =\ Shame.

It's. Not. Working.

10 years ago
Good to hear that you've got it working -- and good to know complex AND statements might not work!