ID:863038
 
(See the best response by DarkCampainger.)
Code:
world
New()
..()
Host = ""
spawn(300) AutoRepop()
AutoTourney()


Hi, my most used in game name is Akito. I have just started to learn how to code(dedicatedly unlike most people who say they are coders and get other people to do it for them) through the DM guide and resources. I have been practicing non stop for hours on days and I felt like I was ready to work on an actual game. That way I can practice and learn as I go.

Problem description: Now before I go into the details, I am aware of how the world/New() and world/Del() procs work. With this particular game I am working on, the world/New() and world/Del() procs are not going through to the game at all. Its as if the whole DM program skips over those lines. It only happens after you write New() and Del() after world. The code attached above is one particular code that doesn't work either. The logs dont show any sign of errors or problems that are blocking all of these codes. Again, the code snipet above is most definitely not the only one being affected. I'd like to know what things I could do in order to fix this annoying problem. Also, I would like to share that I found a very random and useless variable that someone else coded that was blocking an entire page. But I already went through all of the pages myself and could not find a connection to why this is happening. Any help or advice would be greatly appreciated. Thank you!

~Akito

Best response
If you have world/New() defined in multiple places, each one has to call the parent process (via ..(), which I guess you could say also calls "sibling" processes) to ensure that all of them are called. This is true for any process with multiple definitions at the same level. Make sure none of them are missing it, or delaying it. This means any potential delays need to be spawn()ed off to prevent holding up the other versions (your call to AutoTourney(), for example).

Usually it's easiest to just define something like this in one place. As an added bonus, then you can just double-click it in the object tree to find it.

If there's only one definition for world/New(), then we'll need more information (such as how do you know it's not being called, and if you output to the log with world.log << "----CODE REACHED----" does it show up?).
I just went through the whole source and out of the like 50 world/New() only two of them were missing the parent proc. That seemed to fix it. Thanks!
Well, its half fixed. the world new proc works, but the del (when placed anywhere) doesn't go through. And I know it doesnt read it because Nothing happens in game.

for example

proc/AutoRepop()
world.Repop()
for(var/obj/Corpses/O in world)
del(O)


After the repop, it is still there. The object is written correctly in case you were wondering.
Looking at the code you've provided so far, you aren't looping AutoRepop(), so it's only called a single time 30 seconds into the game. I would suggest an infinite while() loop:
proc/AutoRepop()
spawn()
while(TRUE)
world.Repop()
for(var/obj/Corpses/O in world)
del(O)
sleep(300)


When debugging code, never underestimate the power of a simple text output statement to figure out what is/isn't running and what values variables hold at the time.

Also, don't forget to use <dm> and </dm> tags when posting code on the forums, as it preserves indentation.
Thank you for the suggestion Dark! Although the del still isnt working...I might have to change some parts of the code in order for the corpses to disappear automatically after a certain amount of time, without the need of a repop. Which would make more sense to me.
Instead of using del(O)
Try using:
O.loc = null
It worked! thanks!