I... I think I'm unequipped to handle this without turning it into a shitstorm. Anybody else wanna take over and explain what I'm trying to get across without chasing someone who is brand new away?
Sorry if I give you trouble im a beginner coder trying to understand things I don't even know what fast does in this code im very beginner D:
and brand new idk if you mean brand new coder but im on BYOND till 2010 :P
Yeah, no problem. You aren't the problem, it's just that I don't want to upset you by saying something that probably needs to be said, but you aren't going to want to hear... I can be a bit... er... forceful with my opinions, so I don't want to put you off. I respect your enthusiasm, but I caution you against using that codebase. You'll learn so much faster starting from scratch if you want to learn to program, and you will wind up being much better for it.

The longer you use leaked/stolen source code as your teaching material, the longer it's going to take you to learn to program. All I can really say on the subject at this point.
OK thank you for the advice! I just really like Naruto games so I won't hide to you the fact that the source is NNG(too much ripped ik D:) but I tried to restart it well and I tried to add some original work to it(and it worked I added some cool original stuff) but I didnt saw that it's seems that this code source is so messy because as you said as a beginner starting from a source is not the best solution!But I would still like to work on this source but I'll try to learn to code the right way and meanwhile i'll try to clean this code!
So if you could help me or anyone from the community it would be really appreciate!(And sorry if my english is not too good I talk mainly french because im from Quebec/Canada)
Honestly, there's just so much mess in this code, there's almost no point in trying to fix it. It would literally be faster to learn how it's supposed to be done the right way and rewrite it than to try to make a poor method like this work somehow. (Even though we all know it probably won't.)

Take a step back, take a deep breath and check out both the DM Guide and the Reference, following along in Dream Maker while you do.

They're a bit dated, but it will give you the starting point you need to be at for us to be able to help you progress. There's nothing wrong with wanting to make a Naruto project, that's perfectly fine, what we just want you to understand is that there literally isn't a single open-source Naruto project that isn't complete garbage.

We'll also help you with your methodology, as well. It's not just about making an existing piece of code work, but making it work in a way that isn't going to break the rest of what you're trying to do.

Because of this, it's best to not post a snippet of your code and ask, "Why is this broken?" and instead ask, "I'm trying to implement [x] system and I'm running into [y] errors." while posting a snippet of its relevant source code. You never know. The method you're trying to go about something might be 180 from where you need to be headed with it and without that information, we'd just fix the mess and send you on your way none the wiser.
This is one of the things that Ter would probably have said:

You've been working with a bad assumption here, which is that the code you're using works perfectly well, and that if it works perfectly well you should keep using it and only make minor tweaks.

The first assumption may not be true. You don't know if the code works perfectly well; it may be breaking on you in subtle ways, and it could probably stand to work much better.

The second assumption is that if code works, you should keep using it. A band saw with no safety features works perfectly well, until the one day something goes wrong and you lose a hand. Just because code appears to work correctly doesn't mean it's fine and should be left alone. Code that contains a great many bad practices should be cleaned up before you attempt to do anything with it; and if you see a bad practice in the code, you should look for any other routines that use it and clean it up.

So basically, Ter offered a rewrite to your code that would clean it all up, and you came back with "Well, my code works just fine, so how can I make the fewest changes possible and make it a whole lot better?" That's an instant facepalm. The answer is you can't; you should start with the cleanup he suggested before even thinking of trying to improve performance or fixing a logic error. We programmers get frustrated when we run into that question, because a person who asks that isn't learning from their mistakes (or as the case may be, someone else's mistakes).
Thank you guys for your answers and it is not that I didn't want to use Ter fix is that I tought that he tought the code was for player mouvement not bump and I agree it would be better to start from scratch and I think I will start reading the stuffs you two suggested me and just to know is there a basic demo for a mmorpg with a lot of comments for me to havr a good base to start! And thank you again!
In response to Louis53
Louis53 wrote:
Thank you guys for your answers and it is not that I didn't want to use Ter fix is that I tought that he tought the code was for player mouvement not bump and I agree it would be better to start from scratch and I think I will start reading the stuffs you two suggested me and just to know is there a basic demo for a mmorpg with a lot of comments for me to havr a good base to start! And thank you again!

Try and make learning how to program about the journey and not the destination. Take things nice and slow. Start off with simple, small goals and ramp it up in difficulty when you feel you've mastered the basics. The ideal manifestation of this would be to create small games with an absurd amount of focus on one singular element as opposed to attempting to make some sprawling MMORPG with hundreds of active clients right away.
In response to Azurift
Azurift wrote:
The ideal manifestation of this would be to create small games with an absurd amount of focus on one singular element as opposed to attempting to make some sprawling MMORPG with hundreds of active clients right away.

What's weird is that MMORPG's are literally the single worst project to try to tackle as a beginner developer. They're the pinnacle of game design difficulty, yet somehow have become the "default" game genre here on BYOND. People literally set themselves up for failure.
Ok than i'll restart to code my basic zombie survival I had planned to create the map is a box and you need the kill every zombie and each there is more zombies! I had already started it really simple lets try to make it better :D
If you run into problems, we'd be happy to help you on your way! That's what we're here for.
Ok thank you!
Just a question you both said that goto is not good to use in a loop but I first tought that I needed to use it so last year I did this code that is out of no doubt wrong but how should I write it:
        gtimer()
var/G=0//a bit useless I think
loop1
spawn(10)//each sec
if(G!=1)//a bit useless I think
geninsec-=1
if(geninsec<0)
geninsec=59
geninmin-=1
if(geninmin<0)
geninmin=0
geninsec=0
G=1//useless?
spawn(5102)//the time the exam go on to stop the timer
geninsec=0//reset timer
geninmin=30//reset timet
G=0//?
goto loop1//??
else goto loop1//?
ctimer()//Same comments here
var/C=0
loop1
spawn(10)
if(C!=1)
chuninsec-=1
if(chuninsec<0)
chuninsec=59
chuninmin-=1
if(chuninmin<0)
chuninmin=59
chuninhr-=1
if(chuninhr<0)
chuninhr=0
C=1
chuninmin=0
chuninsec=0
spawn(14402)
C=0
chuninmin=0
chuninsec=0
chuninhr=1
goto loop1
else goto loop1
These are timers for global events, I assume? Chuunin and Genin exams?

You don't actually need a countdown every second. If your world bogs down, the timer will be inaccurate. What you can do is store the time of the next event as a global variable.

var
next_genin_exam = 0
next_chuunin_exam = 0


Once we have the global variables, we can actually set up a timer that will check every second or so whether it's time to do an event.

proc
check_events()
set waitfor = 0
var/time = world.realtime
while(1)
if(time>=next_genin_exam&&next_genin_exam) start_genin_exam()
if(time>=next_chuunin_exam&&next_chuunin_exam) start_chuunin_exam()
sleep(10)


What the above function does, is it checks whether the current time is greater than or equal to the scheduled time of the specific event, and if the scheduled time for the event is greater than 0. If this is true, it will schedule the exam, and then wait 1 second before repeating the loop over all of the events.

In order to set up a genin/chuunin exam's timer, we would set the scheduled time like this:

    next_genin_exam = world.realtime + [DELAY]


DELAY should be equal to how long from now the exam will start measured in 1/10th seconds. So let's say we want to set the exam to be 30 minutes from now?

30 minutes is 30 * 60 seconds, or 1800 seconds. We need to multiply that by 10 to get the number of 1/10th second ticks in 30 minutes. 30 minutes * 60 seconds * 10 ticks = 1800 * 10 = 18000 ticks.

So to set the next genin exam for 30 minutes from now, we'd do:

    next_genin_exam = world.realtime + 18000


We can also stop genin exams from happening at all by simply setting it to 0.

And we can force them to happen RIGHT NOW by setting them to world.realtime.

Now, let's say you want a player to be able to know how long until a genin exam? Well that's easy. We just need to do some quick math.

if(next_genin_exam)
var/t = next_genin_exam - world.realtime
if(t>36000)
mob << "[round(t/36000)]h [round(t/600)%60]m [round(t/10)%60]s"
else if(t>600)
mob << "[round(t/600)]m [round(t/10)%60]s"
else if(t>10)
mob << "[round(t/10)]s"
else
mob << "Immediately"
else
mob << "Unknown"


And to start the event checker in the first place:

world/New()
check_events()


So much simpler to work with than all that goto business and subtracting times and whatnot.
A great thank to you mate!
Here's my actual variable to start exam:
        spawn(18000)geninexam()
spawn(36000)chuninexam()
//and the timer I that I stock a variable geninsec geninmin
//chuninsec chuninmin chuninhr so I can use them to
//show the time remaining until next exam in a player menu
//in this format:
stat("Exams Info: ")
stat("")
stat("Time remaining until Genin Exam: [geninmin] minutes and [geninsec] seconds!")
stat("Time remaining until Chunin Exam:[chuninhr] hours, [chuninmin] minutes and [chuninsec] seconds! ")

//So I would like to know if it is possible to do it this way?
Everything I wrote above supercedes all of that. If you didn't understand something, let me know which specific part you didn't understand and I'll attempt to clarify.
If I set up the code like you said could I use it like that:
                stat("Exams Info: ")
stat("")
stat("Time remaining until Genin Exam: [round(t/600)] minutes and [round(t/10)] seconds!")
stat("Time remaining until Chunin Exam:[round(tc/36000)] hours, [round(tc/600)] minutes and [round(tc/10)] seconds! ")
//tc use for the same variable but for chunin
//could it work if I declare varaiable the right way
Provided that information is in the mob's Stat() proc, yes.

However, I made a dumb mistake in my math... Lemme just adjust a bit.

Alright, the mistake I made is fixed. I forgot to use modulus/modulo.

Modulus is sort of like division, but rather than returning x/y, it returns the remainder of x/y. The mistake I made made it so that 90 seconds would show as:

1m 90s, rather than 1m 30s.

The mistake I corrected is in the bottom of the post.
Page: 1 2 3 4 5