ID:144507
 
Code:
var/list/Teleports=list()

atom
proc/Bumped(var/atom/movable/A)
movable/Bump(var/atom/A)
spawn() A.Bumped(src)
..()


obj/TeleportPiratesIsle
icon = 'Objects.dmi'
icon_state = "wheel"
density = 1
New()
..()
name = "Pirates Isle "
Teleports+=src
Bumped(var/atom/movable/A)
if(!ismob(A) || !A:client) return
usr << sound('Magic.wav')
var/obj/i = input(A,"Which teleport would you like to go?")as null|anything in Teleports
if(!i) return
A.loc = i.loc
obj/TeleportSkullIsland
icon = 'Objects.dmi'
icon_state = "wheel"
density = 1
New()
..()
name = "Skull Island"
Teleports+=src
Bumped(var/atom/movable/A)
if(!ismob(A) || !A:client) return
usr << sound('Magic.wav')
var/obj/i = input(A,"Which teleport would you like to go?")as null|anything in Teleports
if(!i) return
A.loc = i.loc
obj/TeleportOtherPiratesBase
icon = 'Objects.dmi'
icon_state = "wheel"
density = 1
New()
..()
name = "Other Pirates Base"
Teleports+=src
Bumped(var/atom/movable/A)
if(!ismob(A) || !A:client) return
usr << sound('Magic.wav')
var/obj/i = input(A,"Which teleport would you like to go?")as null|anything in Teleports
if(!i) return
A.loc = i.loc
obj/TeleportVolcano
icon = 'Objects.dmi'
icon_state = "wheel"
density = 1
New()
..()
name = "Volcano"
Teleports+=src
Bumped(var/atom/movable/A)
if(!ismob(A) || !A:client) return
usr << sound('Magic.wav')
var/obj/i = input(A,"Which teleport would you like to go?")as null|anything in Teleports
if(!i) return
A.loc = i.loc
obj/TeleportDarkIsland
icon = 'Objects.dmi'
icon_state = "wheel"
density = 1
New()
..()
name = "Dark Island"
Teleports+=src
Bumped(var/atom/movable/A)
if(!ismob(A) || !A:client) return
usr << sound('Magic.wav')
var/obj/i = input(A,"Which teleport would you like to go?")as null|anything in Teleports
if(!i) return
A.loc = i.loc

obj/TeleportSamuraisVillage
icon = 'Objects.dmi'
icon_state = "wheel"
density = 1
New()
..()
name = "Samurais Village"
Teleports+=src
Bumped(var/atom/movable/A)
if(!ismob(A) || !A:client) return
usr << sound('Magic.wav')
var/obj/i = input(A,"Which teleport would you like to go?")as null|anything in Teleports
if(!i) return
A.loc = i.loc






obj/GuildHouses
icon = 'Objects.dmi'
icon_state = "wheel"
density = 1
New()
..()
sleep(20)
name = "Guild Houses"
Teleports.Insert(1,src)
Bumped(var/atom/movable/A)
if(!ismob(A) || !A:client) return
usr << sound('Magic.wav')
var/obj/i = input(A,"Which teleport would you like to go?")as null|anything in Teleports
if(!i) return
A.loc = i.loc


Problem description:
runtime error: Cannot execute null.Bumped().
proc name: Bump (/atom/movable/Bump)
source file: Teleport System.dm,6
usr: Frozen (/mob/You/Human)
src: Frozen (/mob/You/Human)
call stack:
Frozen (/mob/You/Human): Bump(null)


You screwed with the whole system so badly. Those teleports should be under their own parent_type with one version of bumped. name does not need to be set at runtime, and it should not be. You also don't even need it, if you replace spaces with underscores when given the name. You can have the name variable, nothing wrong with it, but it's a personal preference.

You can also set Guild Houses to the parent_type of Teleports if you'd like. You'd have no need for the procedures under it because /obj/Teleport already has them.

var/list/Teleports=list()

atom
proc/Bumped(var/atom/movable/A)
if(!A) return
..()
movable/Bump(var/atom/A)
if(!A) return
spawn() A.Bumped(src)
..()


obj/Teleport
density = 1
icon = 'Objects.dmi'
icon_state = "wheel"

New()
..()
Teleports+=src
Bumped(var/atom/movable/A)
if(!ismob(A) || !A:client) return
usr << sound('Magic.wav')
var/obj/i = input(A,"Which teleport would you like to go?")as null|anything in Teleports
if(!i) return
A.loc = i.loc

Pirates_Isle
Skull_Island
Other_Pirates_Base
Volcano
Dark_Island
Samurais_Village

obj/GuildHouses
icon = 'Objects.dmi'
icon_state = "wheel"
density = 1
name = "Guild Houses"
New()
..()
Teleports.Insert(1,src)

Bumped(var/atom/movable/A)
if(!ismob(A) || !A:client) return
usr << sound('Magic.wav')
var/obj/i = input(A,"Which teleport would you like to go?")as null|anything in Teleports
if(!i) return
A.loc = i.loc


I believe that runtime was caused because an atom bumped into something and the atom was deleted at the same time. Maybe you killed a Werewolf once it bumped into a teleport.
CaptFalcon hit the nail on the head: You shouldn't have spawn() in your Bump() proc. It's what's messing things up.

Mind you I saw also in your Bumped() procs that you're abusing the : operator. You shouldn't be using that.

Lummox JR
In response to Lummox JR
This is something I can't stress enough. Don't just say you can't do it, but state why. Why is spawn() unacceptable there?
In response to CaptFalcon33035
CaptFalcon33035 wrote:
This is something I can't stress enough. Don't just say you can't do it, but state why. Why is spawn() unacceptable there?

Because it's there for no reason and can do nothing except create situations like the one happening here--where an object is being deleted before it can be used. Never interrupt the execution of your code, passing off control to something else that could screw with it, if you don't have a reason to.

Lummox JR
In response to CaptFalcon33035
thanx so much guys and capt i wanna add in skils like fishing and mining maybe u can help me again when u ahve time atm my game is pretty solid