I am working on an advanced organization system using objs called folders. Im makeing towhere the user can store objs into the folder by placing the objs into a list. But, I have foundmyself stuck.
When the usr clicks the folder im wanting a statpanel to appear with the same name as the folder. Inside of the statpanel I want it to show the folder's list.
Anyone here know how to help me with this problem?
ID:174192
Sep 20 2003, 6:10 am
|
|
In response to Lummox JR
|
|
Thanks for the valuable info JR :).
How would I make it towhere the use view the stapanel and close it at will? |
In response to Texter
|
|
Texter wrote:
Thanks for the valuable info JR :). To view the statpanel, you'd have to set the player's folder var to a valid folder object. To close it, set the folder var to null. Lummox JR |
In response to Lummox JR
|
|
obj/var/list/storage
obj/Folder icon= 'Folder.dmi' Click() usr.folder.contents = src.storage mob/verb/Test3() var/obj/Folder/s = new/obj/Folder sheet +=s //adds folder to table var/obj/Sheet/d = new/obj/Sheet s.storage +=d //adds sheet to folder When I click it.. it gives me this runtime error runtime error: Cannot modify null.contents. proc name: Click (/obj/Folder/Click) usr: Texter (/mob) src: Folder (/obj/Folder) call stack: Folder (/obj/Folder): Click("Game") |
In response to Texter
|
|
You forgot to check if usr.folder is null.
Lummox JR |
In response to Lummox JR
|
|
You have been very helpful Lummox JR and greatly appreciate it.
Unfortunatly I have come across another dead in this maze. Usually I can skim through and figure out what causes an error like this but today I cannot seem to find anything wrong. TextMudPuddle.dm:94:error: is: missing comma ',' or right-paren ')' TextMudPuddel.dmb - 9 errors, 0 warnings (double-click on an error to jump to it) It highlights over the if(usr.folder is null) Folder icon= 'Folder.dmi' Click() if(usr.folder is null) usr.folder.contents = src.storage else usr.folder = null |
In response to Texter
|
|
if(!usr.folder)
That might work better. |
In response to Jon88
|
|
runtime error: Cannot modify null.contents.
proc name: Click (/obj/Folder/Click) usr: Texter (/mob) src: Folder (/obj/Folder) call stack: Folder (/obj/Folder): Click("Game") I still get this runtime erro when I click the obj. _-_ |
In response to Texter
|
|
Heh, stupid me. I meant if(usr.folder)
Doh! |
In response to Jon88
|
|
Folder
icon= 'Folder.dmi' Click() if(usr.folder) usr.folder.contents = src.storage else usr.folder = null With if(usr.folder) it doesn't do anythign at all when I click it. This gets more puzzling.. o.o |
In response to Texter
|
|
Well, that means that usr.folder is null. You need to set folder to something.
|
In response to Jon88
|
|
I don't think this would make any diffrence but Folder is stored on a varlist called sheet and the sheet is put into a mob/var/list/sheetsc |
Whoa! Time out! Say "the player" instead; you've just made an error in terminology by saying "the usr". This is a big deal because when you unconsciously conflate the two, you're more likely to put usr in places where it's dangerous.
Common mistake:
"the player" = "the user" = usr
Not trying to get on your case or anything here; I just like to head up these issues before they creep into people's code.
As far as the folder goes, I'd give each mob a var for the active folder they're looking at. If objs go in the folder by being added to its contents, then to view the folder all you need is this:
Lummox JR