Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

The most basic battle script!

18 years ago

#remember "#" is a comment

%PLAYERATCK = 5 # this is players attack, developed throughout game, 5 is eg.
%PLAYERDEF = 6 # this is players defense, same as above, 6 is eg.
%PLYRHEALTH = 10 # this is the players health, same as above, 10 is eg.

%MONSTRATCK = 7 # this is the "monsters" attack value, a set value, 7 is eg.
%MONSTRDEF = 4 # this is the "monsters" defense value, a set value, 4 is eg.
%MONSHEALTH = 10 # this is the "monsters" defense value, a set value, 10 is eg.

#following script is for a link that says "ATTACK MONSTER"

IF %PLAYERATCK > %MONSTRDEF THEN
%DAMAGE = %PLAYERATCK - %MONSTRDEF #find difference between stats and store
%MONSHEALTH = %MONSHEALTH - %DAMAGE #take the damage and substract from health
ELSE IF %PLAYERATCK < %MONSTRDEF THEN
%DAMAGE = %MONSTRDEF - %PLAYERATCK #find difference between stats and store
%PLYRHEALTH = %PLYRHEALTH - %DAMAGE #subtract from health

$DEST = @C #to whatever page you want, or even the current page to reselcet options

# above is very simple, it doesnt incorporate anything else, if you wanted to, you could incorporate health, but i want you to learn basic first...

from the $DEST line, if you were to go to the current page, the current page would contain:

Players health, players attack, players defence, monstershealth (you can include the "monsters" stats, but that would ruin the battle aspect) and then your links would be, Attack Monster, Use Items (eg health increase pills i dunno whatever), Run Away, and then when you attaack the monster, you will be brought to the current page where the players health will be updated and the monsters health will be updated, and then more scriptign can be used to show the "results" of the attack.,

The most basic battle script!

18 years ago
NICE! I was dreaming of scripts as I was drifting off to sleep last night.

The most basic battle script!

18 years ago
What's the "$DEST" and "@" stand for? That's intermediate scripting, right?

The most basic battle script!

18 years ago

haha, i was falling asleep to scripting as well lmao! $DEST and @ is basic scripting, basically, $DEST contains the page ID that the link is going to. So you can "edit" this links destination using $DEST, @ is part of the syntax, so when you want to go to a page with the ID of 21, you can write $DEST = @P21 you must use @P, you think of it like this, Page ID is {number} so $DEST = @P21 in english means:

The destination of this link is the page with the ID of 21.

The most basic battle script!

18 years ago
Oh good, I'm not the only one who thinks of ideas in my sleep for this site.

The most basic battle script!

18 years ago
haha! jjj's got the same thing going for him, i know that!

The most basic battle script!

18 years ago
Did anyone notice that the latest 50 rejected messages, only 5 or 6 are mine, but 60-70% of my points come from accepted ideas...

The most basic battle script!

18 years ago
Ah, cool. I didn't see the $DEST or @ in the basic scripting article.

The most basic battle script!

18 years ago
o wait, $DEST is intermediate, but @ is basic...

The most basic battle script!

18 years ago
you could also write @C2, which would be the chapter with ID of 2...

The most basic battle script!

18 years ago
Or you could screw scripting cuz u dotn udnerstand it ;)

The most basic battle script!

18 years ago

damn you jjj,im trying to teach here :P

The most basic battle script!

18 years ago
Then teach me ;)

The most basic battle script!

18 years ago

My interpretation of scripting:

%HP%14# + @ $DEST - 14%%MANA$%^

Is that interpretable?

The most basic battle script!

18 years ago

sorta.

The most basic battle script!

18 years ago
Nope.  There are so many erros.

First of all, you only need a %sign before variables and all variables have to be caps.  No variable can start with a number.  Not to mention, you can say VARVAR.  You'll get a syntax error there.

How's the # sign used?
+ works.
Your @ goes nowhere.
If you get rid of the @, $DEST would work.
- works.
14% works I think because you are subtracting 14%.
%MANA dosen't work as theres no space, and no opperator.
The $%^ should be thrown out.  The best code for this that I can see is the following:

%HP = (14 + $DEST) [I think, should replace with page ID but I don't know that] - (14% * %MANA).
%HP = (14 + $DEST) - (14% * %MANA)

Havvy

P.S. You have no real code.

The most basic battle script!

18 years ago
that put him in his place.

The most basic battle script!

18 years ago
And I thought I had trouble with the advance editor before, this would kill me,lol.

The most basic battle script!

18 years ago
What is $DEST anyway?

The most basic battle script!

18 years ago
read hte scriptign article.

The most basic battle script!

18 years ago
Destination, I should have guessed. How genius of them.

The most basic battle script!

18 years ago
has anyone found use of this script??? i will be putting it in an article with deeper explanation... soon :P (later than sooner :P)