ID:1215795
 
(See the best response by Fushimi.)
Code:


Problem description: So am making a timing system for my world simulator game i want to add a aging system i want after a year for all the mobs age go +1 how do i do that

BTW: i haven't coded for a while
... you do it exactly like that +1 or ++

Developer help is also exactly just that, try giving us some example code instead of just asking for it.

You've done this in the past many times no one will help you unless you try first.
So how i use ++
In response to Dr.Penguin
++ is the increment operator. It's equivalent to x + 1 (though it has some side effects, depending on how you use it.)
mob/verb/test()
var n = 0
src << n
n++
src << n
i was talking about +=
In response to Dr.Penguin
You need to learn the basic's before you even post an issue.

http://www.byond.com/docs/ref/index.html

http://www.byond.com/docs/guide/

Honestly you are wasting your time if you don't learn the language.
And its a world proc
How do i identify M as everyone
In response to Dr.Penguin
What do you mean "identify M as everyone"?
In response to Dr.Penguin
You seem to be a code taker. But I'm nice so..
mob/var
Str=null //Stands for strength
EXP=null //experience
HP=null //health point
MEXP=10 // max experience
Level=1 //level


mob/verb
Punch(mob/M in get_step(usr,usr.dir))
var/punch = pick(Str*1.1,Str*1.2,Str*1.4,Str*1.5,Str*1.3)
M.HP-=punch
EXP++
usr.Levelcheck()

mob/proc
Levelcheck()
if(MEXP == EXP)
usr.Level+=1
MEXP++
EXP=0
else
return


Also to identify all the player in the world you use:
for(var/mob/M in world)
//exemple

mob/var/Boy=null
mob/var/Girl=null

mob/Mod
verb
GenderCheck()
for(var/mob/M in world)
switch(input("Are you a boy or a girl",text) in list ("Boy","Girl"))
if("Boy")
if(M.Girl)
world<<"[M] has become a boy to girl!"
M.Boy=1
else
M.Boy=1
M.Girl=0
else
if(M.Boy)
world<<"[M] has become a girl to boy!"
M.Girl=1
else
M.Girl=1
M.Boy=0
In response to Dark-DVF
Dark-DVF wrote:
You seem to be a code taker. But I'm nice so..
> mob/var
> Str=null //Stands for strength
> EXP=null //experience
> HP=null //health point
> MEXP=10 // max experience
> Level=1 //level
>
>
> mob/verb
> Punch(mob/M in get_step(usr,usr.dir))
> var/punch = pick(Str*1.1,Str*1.2,Str*1.4,Str*1.5,Str*1.3)
> M.HP-=punch
> EXP++
> usr.Levelcheck()
>
> mob/proc
> Levelcheck()
> if(MEXP == EXP)
> usr.Level+=1
> MEXP++
> EXP=0
> else
> return
>


am working with a world proc
In response to LordAndrew
LordAndrew wrote:
What do you mean "identify M as everyone"?

like you know M as mob i want something like M as world

M.Age += 1

and it will add it to everyone
In response to Dr.Penguin
You'd want to use a loop in order to change variables for everyone. Check into the for construct in the reference.
In response to Dark-DVF
Please don't do that again! :)

He needs to learn, he has been on BYOND for over a year now he needs to learn the language instead of begging.
            for(M in world)
M.Age += 1


Something like that
In response to A.T.H.K
A.T.H.K wrote:
Please don't do that again! :)

He needs to learn, he has been on BYOND for over a year now he needs to learn the language instead of begging.

Can you tell me when was the last time i posted a developer help
In response to Dr.Penguin
Close! You need to tell M what type it needs to be. In this case, you'd want to tell it that M needs to be a mob.
In response to Dr.Penguin
That has nothing to do with it, if you actually learnt the language (do I have to keep repeating myself?) you shouldn't just forget it all within the 3 - 4 months you have not been active.

So again, if you learn it properly like everyone else does the time you weren't active on the forums or BYOND would mean you may have to learn some new features added, which in that time span we didn't really have any.
i haven't been in byond for a couple of months and why would i
remember a language when i have had alot of things to do
In response to Dr.Penguin
Dr.Penguin wrote:
i haven't been in byond for a couple of months and why would i
remember a language when i have had alot of things to do

You never knew the language to begin with..

Simple issues like these

http://www.byond.com/members/ DrPenguin?command=view_post&post=1044088&first_unread=1

http://www.byond.com/members/ DrPenguin?command=view_post&post=1073230&first_unread=1

http://www.byond.com/members/ DrPenguin?command=view_post&post=1042743&first_unread=1

http://www.byond.com/members/ DrPenguin?command=view_post&post=819944&first_unread=1

http://www.byond.com/members/ DrPenguin?command=view_post&post=819052&first_unread=1

http://www.byond.com/members/ DrPenguin?command=view_post&post=814360&first_unread=1

Would NOT be an issue for someone who took the time to learn DM.

[EDIT] Not to mention all the exact same issues you posted with your other account - http://www.byond.com/members/whybe

Honestly I am not trying to be an ass (although it looks like it), Just learn try fail, produce code so we know you are trying.
Page: 1 2