![]() Dec 11 2013, 4:29 am
|
|
I read them. I still don't get what I must do.
|
If the tutorials are unclear, talk to me in the tutorial threads and quote specifically the bits that you don't get. I wrote the tutorial because a number of people were having issues with saving systems just like you.
If I wrote it incorrectly, and it's just confusing people, I'd appreciate it if we could address it within the tutorial's thread so that we can clear up any confusion for future readers. |
I am trying to fix my code. This still isn't working. I did this:
if(choose=="Load") |
Okay... So you ignored my request and copied/pasted about 30 lines from my tutorial intended as an example. Great. Now what?
To be clear, I'm really not trying to be mean here, but each and every time we interact about a problem on this subforum, it becomes increasingly clear to me that you genuinely do not read what we type. Nor do you try to understand code before assuming it is a magic pill that will fix all your problems and pasting it into your project. I'm trying to help you. Give me the respect of making an effort, and we don't have to go through the entire military training instructor routine. Did you read the bits about saving icon, overlay, and icon_state variables, and why you should never, ever, ever do it? Of particular importance is in regard to the neversave bootstrap I laid into my system. Did you understand the underlying reason why I did all of that? |
TheDarkChakra wrote:
Yeah. I didn't get those yet. I must study these more. There's no studying. The code is commented aggressively, and each step walks you through why I did it. If it's confusing, please quote the parts that are confusing so I can fix them, because these vague responses just make it harder for me to help you. |
It seems now I got rid of some of the problems but when I load it keeps taking me to the Login() screen.
|
Here are the codes:
mob/player/proc/save() |
By load, do you mean you call a procedure on some screen to load a character, or do you just kind of ... load into the character, when you login to the server?
|
I want it to automatically load the character when I login and I do it by testing if(fexist etc... but the test always fails so it makes me always create a new character. Then I try to load using a verb and it takes me to login screen again.
|
if(fexists(new/savefile("saves/[src.ckey].sav"))) Review part #1 section 1: Getting Started. if(usr.phase1||usr.phase2||usr.phase3||usr.phase4||usr.inturny)
usr in proc. if(src.key=="TheDarkChakra"...) Redundant logic, integrated design. if(fexists(FileName)) Incorrectly embedded code. if(fexists(FileName)) Redundant logic. F<<src.x Incorrectly embedded code. if(randitem=="Shuriken") Redundant logic. var/obj/weapon/we=locate() in src.contents redundant logic. inzetsu=0 Redundant logic. if(def<=5) Redundant logic. if(str<=5) Redundant logic. if(nen_type=="Enhancement") Redundant logic. goto NAME
goto albeit not that bad of one. if(src.hp<25) Redundant logic. In the interest of time, I'm going to rehash this for you quickly so we can at least address the core issue, and ignore the rest of the stuff here. Give me a bit with another reply. |
This is not intended to compile, much less actually work. It's meant to show you the way you should be moving toward.
You are going to have to adjust significant portions of your code to comply with basic rules of sanity, but I've cleaned up the majority of your major flaws and made it at least a *little* easier on the stomach. Pay attention to my comments. They will explain why I did what I did, and be very wary of what they warn against. Per usual, specific questions will be answered with specific answers. Vague questions without context will not get either of us anywhere we want to go. //you should never have to touch any of this: |
TheDarkChakra wrote:
So I can't just use what you wrote for me here? It's not going to compile because it's not intended to. It's meant to be an example that you are supposed to learn from. Parts of it will work fine without modification. The Read/Write overrides should be just fine as they are. You don't need to tell it to save anything else as long as you mark your variables as tmp/global/const correctly. Most of the login code will work fine as well, provided you restructure your project a bit for some of the changes it necessitates. Lastly, I've stripped out some bits of code that I found offensive, like the input() based menu system for New/Load/Delete... Which is a trend that needed to die in 2003. Then there's the issue of your admin commands being defined entirely wrong. Admin commands should belong to the client, not the mob. This prevents mob-switching/saving from accidentally granting powers to people that shouldn't have them. You should know me by now, TDC: I don't tend to hand out copypasta code, because I actually want you to learn something. I'd actually like to see you, and everybody else around here improve. It's why I'm still here. That, and BYOND's limitations are quite fun to try to circumvent. |
TheDarkChakra wrote:
But I can't understand this yet. Don't/won't. Can't is defeatist. Don't try to digest it all at once. The saving bit is done for you. Pick out a specific detail that you don't understand, and I'll be more than willing to discuss it with you. Until you do that, there's nothing I can do to help you further. Just saying: "I don't get it." isn't going to help you. You're in your mid-twenties. I'm in my mid-twenties. I'm not especially gifted. You know how I learned? Lexy, Lummox, and Skysaw. Among others, but those three were tough teachers. Don't throw your hands up in defeat. You want to do this. You want to get it. Take a few lines at a time and try to understand it. If you have questions, ask them, but be specific. If you can write code, you can read it. Just because you don't understand my patterns or my reasoning doesn't mean you don't get the code. Why is a valid question. How is sitting right in front of you. |
OMG! I plugged in that code and once AGAIN my icon is blank invisible! Maybe the error is somewhere else...
|
TheDarkChakra wrote:
OMG! I plugged in that code and once AGAIN my icon is blank invisible! Maybe the error is somewhere else... You do realize that my code prevents the icon and icon_state from saving, right? (And I really strongly doubt you managed to plug that code in less than 19 minutes after you said you couldn't, and still get it to compile, much less run without potential errors.) I explicitly outlined that in three separate posts in this thread, in both of my tutorials' parts, and the code blatantly lists icon and icon_state as parts of NeverSave, right? And you realize there's a good reason it does that, right? You are setting the icon during character creation, am I right? In a part of your login proc you never actually showed us? I promise you I know exactly what you are doing wrong, but you completely refuse to ask me actual questions, and instead insist on beating your head against a wall of your own construction. |