ID:139718
 
mob/NPC
Morshu
name = "Morshu"
icon = 'Morshu.dmi'
density = 1
dead=1
Click()
new/obj/MorshuScene(usr.client)
sleep(60)
usr << sound('Morshu Scene.wav')
sleep(80)
del/obj/MorshuScene()

It keeps giving runtime errors. How do I get it to delete obj/MorshuScene?.
In response to Garthor
Garthor wrote:
By storing a reference (using the var keyword) to the created object and deleting THAT.

See: http://www.byond.com/ members/?command=reference&path=proc%2Fnew#comment_1 , http://www.byond.com/ members/?command=reference&path=proc%2Fdel#comment_1

obj
MorshuScene
icon = 'FoE-Scene09.gif'
layer = 999
New(client/c)
src.MMM = 1
screen_loc="5,5"
c.screen+=src
Del(client/c)
c.screen-=src
mob/NPC
Morshu
name = "Morshu"
icon = 'Morshu.dmi'
density = 1
dead=1
Click()
new/obj/MorshuScene(usr.client)
sleep(60)
usr << sound('Morshu Scene.wav')
sleep(80)
del(MorshuScene.MMM)

loading Legend Of Zelda RPG.dme
loading skin.dmf
NPC.dm:67:error: MorshuScene.MMM: undefined var

Legend Of Zelda RPG.dmb - 1 error, 0 warnings (double-click on an error to jump to it)

I don't know if this problem is deleting it wrong or if I am specifying to delete the wrong thing.
Also I am not trying to delete something from someone's inventory. I am trying to delete a HUD that appears in their screen (Link one sends me to deleting inventory items). I am definently not trying to delete usr or src (Morshu NPC) which is what link 2 sends me to.
In response to Narutorox123456
In response to Garthor
Garthor wrote:
http://www.byond.com/ members/?command=reference&path=proc%2Fnew

So basically it says to replace it's location to null by making a new one?
In response to Narutorox123456
No, I'm saying you need to read the damned example and compare it to what you have.
In response to Garthor
Garthor wrote:
No, I'm saying you need to read the damned example and compare it to what you have.

Well I can't compare them. The example shows something being added to usr's inventory and being deleted from it. My problem is having an HUD appearing and being deleted. Two completely different things.
In response to Narutorox123456
Yes, you can compare them. No, I'm not going to spoon-feed you code. The two Reference entries (for new and del) give you all the information you need. If you can't figure it out, try harder.
In response to Garthor
Garthor wrote:
Yes, you can compare them. No, I'm not going to spoon-feed you code. The two Reference entries (for new and del) give you all the information you need.

Well I can't understand it. I am not asking for code string. I am asking for something I can understand. I didn't learn how to code by reading every sentence in the long guide like most people do. I got an actual source so I could do an iconning job and studied the coding to learn. I am not asking for a source either. All I want is something I can really understand. I couldn't delete the HUD due to runtime errors and all you give me are two examples which didn't help me at all and both don't fit my situation in almost any way and you said "Look at this" instead of actually taking some time to type something I can understand like the other topics where someone says "Lets say You login and are 'Bob' and you give him verbs. You then make or load a save file and 'Bob' gets thrown into the pile of verbs and you become 'NotBob' " instead of "See these topics: (Url)"

So please just understand my situation because I have to stay up this late (10:00 PM) just to solve one code problem and I have to wake up 6:45 AM to go to high school for a whole day and I get some reply that doesn't help me as much as taking time to type a sentence or two to help me. It isn't hard since I typed this whole thing in two minutes.
In response to Narutorox123456
Sounds like your issue is you never actually learned anything at all and people are just enabling you by spoon-feeding you code.

I guess the solution then would be for you to read the Guide. Here, I'll even link you to the relevant chapter: http://www.byond.com/docs/guide/chap05.html
In response to Garthor
Garthor wrote:
Sounds like your issue is you never actually learned anything at all and people are just enabling you by spoon-feeding you code.

I guess the solution then would be for you to read the Guide. Here, I'll even link you to the relevant chapter: http://www.byond.com/docs/guide/chap05.html

No that's not true. Read my reply. I am NOT asking for code or a source.

Maybe doing the guide would be a solution. I'll check it out tomorrow.
In response to Narutorox123456
Narutorox123456 wrote:
(...)I am asking for something I can understand.

Please understand that what I'm going to say isn't meant as talking down to you, but to explain the problem you encounter without sweet talking. I have the hope that this might help to get you to improve yourself to a level that you haven't even considered as possible yet.

Garthor explained the problem in easy terms when he told you to store a reference to the instance of the object and then passing that reference to the procedure in order to delete that instance. But you never spent time learning the concepts and are just trying to blindly stumble along by the old trial and error game, hardly being able to modify existing code, let alone to understand what's going on.

In the hope that you're actually going to read up on programming by working your way through the guide and related material, I'll show you that what Garthor linked to is indeed perfectly valid.

            var/obj/CoolHub/CH = new/obj/CoolHub(loc)
// A variable of type /obj/CoolHub, named CH is assigned a reference
// to the instance of an object of type /obj/CoolHub.
// Exactly like in the link Gathor provided.
// http://www.byond.com/members/?command=reference&path=proc%2Fnew#comment_1
spawn(60)
if(CH)
// If this variable is still holding a valid reference...
del CH
// delete the instance of the object that the variable is pointing to.
// Again, exactly like Gathor linked to.
// http://www.byond.com/members/?command=reference&path=proc%2Fdel#comment_1



Narutorox123456 wrote:
(...)taking some time to type something I can understand

You won't ever understand anything, unless you learn the related terminology. If you attempt to study cell structure and aren't going to know what an endoplasmic reticulum might be, nobody is going to take the time and explain the concept in baby steps, because you're expected to learn these by yourself.
In response to Schnitzelnagler
Schnitzelnagler wrote:
Narutorox123456 wrote:
(...)I am asking for something I can understand.

Please understand that what I'm going to say isn't meant as talking down to you, but to explain the problem you encounter without sweet talking. I have the hope that this might help to get you to improve yourself to a level that you haven't even considered as possible yet.

Garthor explained the problem in easy terms when he told you to store a reference to the instance of the object and then passing that reference to the procedure in order to delete that instance. But you never spent time learning the concepts and are just trying to blindly stumble along by the old trial and error game, hardly being able to modify existing code, let alone to understand what's going on.
He didn't explain anything. All he said was basically make an object and delete THAT, which he didn't explain what THAT meant or refered to.
In the hope that you're actually going to read up on programming by working your way through the guide and related material, I'll show you that what Garthor linked to is indeed perfectly valid.
I didn't say it was invalid I said it didn't fit with my situation. He tried to link me to inventory item problems that didn't help me with an HUD Error.
Narutorox123456 wrote:
(...)taking some time to type something I can understand

You won't ever understand anything, unless you learn the related terminology. If you attempt to study cell structure and aren't going to know what an endoplasmic reticulum might be, nobody is going to take the time and explain the concept in baby steps, because you're expected to learn these by yourself.

That isn't what I meant by taking time to type. I meant something like an actual example through the top of your head without using code strips and being relevant like most normal people do.

Now let's end this conversation because I am not using an HUD anymore, I am just going to change their icon to morshu.