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

Player Development or Skill Building Tut.


shadowwulf
 Share

Recommended Posts

I found this is my sent items when I was helping somone.
It isnt a great way to do things and is one of my first scripts.
This should work good for learning some things though.
Might want to have a command list handy…

Make your own player development system
by Shadowwulf

ok first thing is we are going to want to do some stuff then 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 names 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:
-str=0
and anything else you think you may want to look into.(for now lets just 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.

so 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 regaurding their points.
make some variable equal the players points.
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 fine 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 pouint 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, our variable at the top.
this may just be redundant 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

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...