Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Player Development(Think Fable){my first tut}


shadowwulf
 Share

Recommended Posts

This is my first attempt at making a tut.
I made this for another member and he only had some very basic questions.
If you are interested in learning this may help you with some fun starter scripting.

After you do this you shouldn't have trouble wrapping your head around some basic ideas for scripts.

I hope you learn much and pass on the knowledge.

***No credit is needed if you use/modify what you end up with after going through this***

Make your own player development system
by Shadowwulf

This script should make it so that when players attack, they work towards gaining strength.

First thing is we are going to want to do some stuff when the player is created.
You should be able to locate this section easily. No hints this time.
We are going to want to put(hint hint) some information into a location for later use.
-Little trick. The command used to put the information in a file, will create the file if it doesnt exist.
I suggest you point to a folder named something like player_development or char_data, something that makes sense to you.
The filename could be something generic(this would make one really large file, possibly some lag if you get alot of people)
or…
You could be a little creative and use a command as the variable *cough* playername *cough cough*

You may want to establish information such as:
```
[Playername]
str=0

```If you are curious on how to get that into a file, pay close attention to the command that puts the info into the file.
Later you can add other information but for now lets focus on STR

Recap: So far you should have code to enter information into a file and a folder for that file to be put in.
You should be able to make a new character and without logging in, go to the folder and see your file with the info in it.

Now lets make this number change with action.
I suggest the attacking(hint) sub for this.
But we have a small problem.
We could just enter all of the information here, but what if we want to do the same for magi, def, or speed?
Lets plan ahead and create a sub for all of the basic work.

Create a sub with two perameters, index and stat1.
First thing we do is declare some variables.
Put the following two lines in.
```
Dim counter1
Dim x

```There is one more you should make and its regarding their points.
Make some variable equal the players points.
Next we want to increase a stat based on the stat counter we raised.
Lets make counter1 equal to our str(you have to get[hint] this from your file) plus 1.

Lets make a select statement where we choose based on our variable stat1.
So for our first case we would want to find str.
Since its tricky for a newbie I will explain that you want to put
```
case "str"
```as we are looking for exactly was was being carried through the perameter and not a value of a variable.
In this case we will make a check if counter1 is greater than something.
You can really pick anything, you may have to test many times to find a good balance.
If the counter was less than your value then we just put(hint) our stat back and equal it to counter1
otherwise(hint) we know we passed our limit and add a stat.
Just call the sub that handles increasing stats.
Extra hint=> PointType is 0.
It would be nice at this point to give a little message to the player.
Close any if/select statement you may have open.
Now reset the players points back to what they were. That being our variable at the top.
This may just be redundant if we didnt add any stats, but in the event that we added a stat, we dont want to remove a stat point.

Recap:You should now have a sub completed that will handle the work of your stat changes.
         Now we just need to understand how to use it.

Now the sub that handles melee attacking just needs one line added to it.
This line will be similar to how you referenced the player stat gain.
Only this time you will be referencing your sub you just created.
Call your sub and its second perameter must be your stat in your file exactly, also you must use quotes around it as we are not looking for a numeric value.

Recap:Everything should work now.
         You should be able to see the counter raising by periodically opening your development file after some attacks.
         You should be able to attack enough that your str raises.
         You should receive a message saying you received a stat increase.
         You should have a good knowledge of the folowing:
         -getvar(…)
         -putvar(...)
         -sub
         -variable
         -select
         -if
         -playermsg(...)
Link to comment
Share on other sites

Sorry… but, try making your tutorial a bit more appealing.
a)Capitalize your sentences, looks a lot neater.
b)Try using fluent grammar, makes it more understandable.
c)Use the
```
code function
```periodically, it helps organize things a bit.
d)I don't really understand what this tutorial is supposed to be about. Try including a summary somewhere.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...