ID:167245
 
Ok, here are some problems I'm having with my game.

1. How do you make EXP? Like, when you kill a monster or something you get EXP. Also, how do you make EXP limits so when your EXP get past a limit, you grow a level?
2. How can you make stats and stuff, and how can you make it so you can freely distribute different points to them when you grow a level?
3. How do you create a screen where it shows your stats and stuff?
4. I don't know how to make different animation pictures for my characters. Like when I want them to walk forward they turn their backs and you can see their feet moving and when they're attacking you can see the sword moving.
5. How can you make enemies move?
6. How can you save your progress so you don't have to regain EXP and stuff?
7. How can you make your characters with armor and stuff? Like, I got some armor and weapons off the net, so how do I put them on my character?
8. How can you make objects solid?
9. How do you make shops and stuff?
10. How can you make it so you can go into a place and it changes maps? Also how can you make it so you can talk to people?
11. How can you put stat requirements on weapons?

That's all of them... You don't have to answer them all... Just put the number and answer... I would really like to know the animation question answer because I do not know that especially...
1.
mob
var
hp = 500 //This is just an example
str = 50
def = 25
exp = 0
maxexp = 1000
level = 1
mob
proc
Experience()
src.exp += rand(1,100)// Just an Example
Level_up()
mob
proc
Level_up()
if(usr.exp>=1000)
src.level += 1
src.exp == 0
src.maxexp += (maxexp*src.level)
else
..()

In response to TheLunarWolf
for switching areas you use z's. so say you wanted your char to enter a house when he bumps into it. z1 will be the area you start in z2 will be inside the house.

mob/Bump(atom/m)
if(istype(m,/turf/house))
usr.z=2
//this is saying if you bump into the house turf your guy will be transported to z2

or

mob/bump(atom/m)
if(istype(m,/turf/house))
usr.Move(locate(1,1,2))
//this is saying that once your bump into the house turf your guy will be transported to the coordinents of x=1 y=1 z=2
In response to Kerep
All of your, euhm, 'examples' are, excuse me, horrible. You should never use 'usr' in procs, except for Click and DblClick().

Also, if you have so many questions, why not try and read
The DM Guide
In response to Mysame
fine, just change usr to src. I don't really see the problem with it though. (I make single-user RPGs so haven't encountered this before)
In response to Mysame
Actually, you're probably right to say that people should stray away from using usr whenever they don't have to to avoid future confusion and abuse, but usr is okay in some procs.

For example, client.Dir() where Dir is any of the directions (North, South, etc..), Click(), DblClick(), client.New(), and others.

I beleive Lummox actually wrote a BYONDScape article about this. Search for something like usr abuse, or usr sucks or something.

[Edit]
It's okay in mob.Login() and in mob.Stat() as well, but are circumstantial. Found the BYONDscape article: http://www.byondscape.com/ascape.dmb/LummoxJR.2002-1104/

From now on, we should direct people to that article when usr abuse is encountered.
In response to TheLunarWolf
Usr abuse can and will still cause problems in single-player games. Imagine the following - you have a 'fire' turf that is supposed to hurt people when they enter it. But, you abuse usr in the Entered() proc for the fire turf, like so:

turf/fire/Entered()
..()
usr.GetsHurt(5) //Bad! No put usr in proc!


That's all fine and dandy - PCs moving of their own accord will make it work as intended. But what about NPCs, like the following?

mob/NPC
proc/Ai()
while(src)
walk_rand(src,10)
New()
..()
spawn() Ai()


If that NPC steps on a fire turf, suddenly you'll get runtime errors! OH NOES!

Why? Because usr is null in the movement procs for the NPC.

Even worse - let's say that players can push other players, using this verb:

mob/verb/Push(mob/m in view(1))
step_away(m,src)


Simple, right? But what if some clever player pushes someone else into a fire? Then the pusher, not the pushee, will be damaged! OH NOES! Why? Because the pusher is usr - the pusher initiated the action.

And that is why usr abuse is a big no-no. Just because you can use 'in' as a prefix for some words (Say, incompetent) doesn't mean it works for all words (Say, rice). Just because you can use usr in some procs (Verbs are really disguised procs, you see) doesn't mean you can use usr in all procs.
In response to TheLunarWolf
TheLunarWolf said:
fine, just change usr to src.

usr != src

src var (proc)
This is a variable equal to the object containing the proc or verb. It is defined to have the same type as that object.

usr var (proc)
This is a mob variable (var/mob/usr) containing the mob of the player who executed the current verb, or whose action ultimately called the current proc.
Those are all simple to implement, and once you do it you've pretty much got a game. Why should we tell you step-by-step how to do them? If you have some coding experience, check out Zilal's ZBT tutorial. If not, try learning the basics of computer science. As you learn more, you'll be able to tackle those problems easily.
In response to Jp
seriously? i always thought usr standed for user. so i thought it was basically saying transport the user to z2 =P
In response to Kerep
But who is 'the user'? Remember, BYOND games are ultimately designed for multiple players. There is no one 'the user'.

You should try out something similar to those simple examples if you want to be sure, but that's why we keep pushing usr abuse so much - usr is ultimately equal to the mob of the player that called the proc/verb, or it is null if no player called it. It isn't a sort of magic variable that instantly becomes whatever mob you want.
In response to Kerep
Even though it does seem like it means the user, I think it is a variable directing the path to the client. If it doesn't fine this, it gets confused and will give you a runtime error. An example of this abuse is:
obj/Fire/Entered()
usr.Health -= 10
//The mob entering the fire is not nescesarily the player.
//If there are NPC's, the game would get confused and output a runtime error

obj/Fire/Entered(mob/M) //The makes a variable that links to a mob rather than a client.
M.health -= 10 //Then it lowers that mobs health


I may be wrong about some of it, but I think most of that is correct.
In response to Popisfizzy
Bzzzt! Wrong, thanks for playing!

Usr is a variable that references the mob that ultimately called that proc or verb. For example, say you hit you use the say verb. Then, in that instance of the proc, you are usr. If I hit the say verb, then for that instance of Say(), I am usr.

If I move around on the map, then I am usr for that Move() proc. But if someone pushes me, using a verb - so my Move() proc has been called from their verb - then usr is the person doing the pushing.

And if NPCs are involved, usr could be null, too.

That is why you should only ever use usr in procs/verbs that are only ever directly called by a player - like Click(), or any verb.