Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Several Scripting Questions

7 years ago

Hey all! I have a future plan to make a Labyrinth with enemies in it, but I need some help figuring out the coding aspect. 

The Starting Class

  • Basically there will be a starting class with specific stats. I imagine it goes something like

If (uservariable) (clickvariable) (startingclassvariable1)

then (startingclassvariable1) == (startingstatsvariable)

(enemies are stat locked so those are easier)

The item equipping 

  • Basically equipping a potion, weapon, armor. I imagine it'd go something like:

if (uservariable) (clickvariable) (armor9)

then (messagevariable)

        if (uservariable) (clickvariable) == "yes"

        then (equipvariable)

       else if (uservariable) (clickvariable) == "no"

       then (exitmessagevariable)

(the stats would be effected of course whenever you replache a piece of equipment)

The Fighting

  • This goes into RNG category. Let's say user has 6-8 damage. RNG choose whether it hits 6,7, or 8 damage. Defense, dodge, luck, etc. are also taken into consideration when attacked. Like, if dodge is either less then or equal to, or more then etc. then it goes into defense if dodge fails. If dodging fails, you take 1.5x more damage etc.

 

Labyrinth-wise I'm pretty good. But these above variables I could REALLY use help with. Thanks to anyone who can help :v

 

Several Scripting Questions

7 years ago
You might want to check out the articles on scripting because this looks more like programming to me (not that I know much about programming). I don't actually know if you can use programming code, but this is all doable in the standard code for the Advanced Editor. Still, this is the best way I know to do these things:

The Starting Class: Set variables for however many stats you want. For example, let's use %STRENGTH and %SPEED. On the page where you want the player to choose their class, set up links to each class they can choose. You then want to change the link scripts for each of these to the starting stats you want. E.g: if you want a rogue class to have low strength and high speed, it might be something like:
%STRENGTH:= 10
%SPEED:= 25
And you can just set different starting values for different classes this way. Then, if you want the values to change, do something like:
%STRENGTH:= %STRENGTH + 5

The item equipping : Eh, I'm not a fan of the item system, except Zikara's variable item system (which is explained in an article and gets rid of a lot of limitations of the normal item system). I can't actually remember if this works, but I think you can equip items from the link script. You'd have to make an item, remember it's ID number, then put something like this in the link script of a link you want to lead to equipping the item:
$ITEMSTATEX:= 1
Where X is the item ID number. Pretty sure that works, but if you're going to use Zikara's method then you can just use:
%HASITEM:=1
Where ITEM is the item name. Or, you can just set the location found thing in the item settings to a particular page if you're using the normal item system. You can affect the stats in the item script if you want in the same way I described above.

The Fighting: To set the damage equal to 6, 7, or 8, then I'd do something like:
%DAMAGE:= 1D3
IF %DAMAGE = 1 THEN %DAMAGE:= 6
ELSE IF %DAMAGE = 2 THEN %DAMAGE:= 7
ELSE %DAMAGE:= 8
Pretty sure there's a good article on combat systems though so I won't go into full detail.
TL;DR: Read the articles.

Several Scripting Questions

7 years ago
The articles explain most of this stuff, I'd really recommend giving those a read and at least getting a handle on the basics first, then come back with any specific questions.

Once you know how to work with a variable you know how to work with any variable pretty much, it's not an especially complex system.

Several Scripting Questions

7 years ago
Run away! Run away while you still can!

Mizal is correct, it's actually a very simple system to use, but it's simplicity makes for very arduous scripting, because all you have to use are simple tools.

Coding something complex will be like building a ship in a bottle, but are you really willing to take the time and patience to actually do it? Granted, you can make a thing of beauty by the time you're done, but no one but you and a select few will ever know how much actually went into each swing of the sword.

Good luck and may you have the patience of Job.

Several Scripting Questions

7 years ago
As others have warned you: this is quite adventurous. The scripting system CAN hold lots of variables, but they're just not all that easy to use. They do nice for things like counting, but there's no feature to write functions, so you're likely to end up with a LOT of copy and pasting for something like this, and that means different code in different places, which is always a nightmare.

The are random numbers that you can generate, so you might want to try something much simpler, at least at first. Heck, just creating a character generator with 6 stats and options into that stats can take a pile of work, never mind using them.!