Ah, the stack structure. It harkens back to my Computer Architecture course I took oh so long ago (two semesters ago.) Between the frustration of building a compiler and using the Intel assembly language, I am very proud I passed that class.
But I digress. Good stuff, Ter--I learned lots. Remind me to buy you a beer if we ever meet in real life.
1
2
I'd like to see your whole character creation process, TBH. I can't know what I'm working with unless I see the whole structure.
|
In response to Ter13
|
|
mob/Login() |
world I changed a few things. The major problems was that during character creation, you were never actually assigning the client to the created mob. You need to do that to kill the menu loop, which depends on the creating character mob having an assigned client. I also reduced the number local of variables you are using. If a value doesn't change, it shouldn't be a variable. It should be a constant. Another thing that I fixed was your mob/Login() proc. You were using a look-down inheritance model to stop sending sample_report() if the mob's type was a character creation thing. Instead, I took advantage of polymorphic overrides and simply fully overrode the behavior that would display that message and didn't perform a supercall. I removed your client/LoadMob function because I'd much prefer to keep the savefile open for the duration of time that it's being manipulated. This is faster and has less chance for failure. The character creation mob will take care of loading mobs and will also perform an initial save after creation is completed. Another thing that I added was a variable called "savable" to the mobs. This will ensure that only character mobs ever wind up getting saved. These are set to 1 whenever a player loads or creates a new character from the character creation menu, but are set to 0 for every other character. |
In response to Ter13
|
|
Sir you are a byond genius. Not only did you modify it or me you also gave me an explanation as to so I do not do it again, I dont know how I would ever repay you.
|
Not only did you modify it or me you also gave me an explanation as to so I do not do it again You didn't actually do anything overly wrong. You just have some unnecessary habits, and are learning. You are doing more than fine. I dont know how I would ever repay you. Keep bringing me interesting problems and keep learning to program so your problems can start stumping me and challenging me to learn more. Deal? |
In response to Ter13
|
|
Deal! Also I have one question, after I modified your code to suit my needs I compiled it and I got errors with F.cd and F.dir, I must wonder what does the F. stand for and contribute?
|
In response to Ter13
|
|
These errors popped up when I tried to create new character and I cannot make sense of it o.o
runtime error: list index out of bounds proc name: CreateNewCharacter (/mob/other/choosing_character/proc/CreateNewCharacter) usr: (src) src: Dragonpearl123 (/mob/other/choosing_character) src.loc: null call stack: Dragonpearl123 (/mob/other/choosing_character): CreateNewCharacter() Dragonpearl123 (/mob/other/choosing_character): ChooseCharacter() Dragonpearl123 (/mob/other/choosing_character): Login() Edit/:Upon further inspection I saw that the runtime error only occurs whenever I create a new character and the only list associated to new characters is the pick races, because it goes to the type my name part right. |
Fixed another minor typo in the global _races list. I accidentally put one too many equals signs in it. It should be fixed now.
|
In response to Ter13
|
|
Finally! I want to say thanks for the help and Happy New Years, and for a present I found one stumping problem. Every time I want to use the char name for anything I use the brackets [char_name], and I get the following error, 119:error: char_name: undefined var. Using this code,
world << output("<font color=purple><b>[char_name] has joined the ranks</b></font>", "chatbox") world << output("<font color=blue>{[rank]}</font><font color=red>{[usr.name]}</font>: <i><font color=white>[t]</font>","chatbox") Edit/bonus: I feel like this is also preventing me from viewing the admins tab, but I also assume its because i'm playing solo and It is not being hosted at the moment. If youre interested all the code/verbs I have for the admins are mob/Login() Edit Edit/ Bonus Bonus:This is the last one I promise, this one is short too. The save file saves char name but that is about it. All the stats that are attached to mob are supposed to be save together aren't they? Even the location doesn't get saved. |
src.ckey=="Dragonpearl123", "Jamarcus mosley" You've got a bit of an error here. The comma is invalid. Also, ckey is all lowercase and has spaces removed. You will want to use key instead of ckey or "==" won't ever work. A better approach is to use an associative list for admins: var 119:error: char_name: undefined var. Using this code, An undefined variable means that the variable of that name has not been properly defined in the scope you are attempting to use it. char_name was a local variable within CharCreate() it won't continue to exist outside of that function because local variables are tied to the function themselves. You should read up on "variable scope". It's an important concept. The save file saves char name but that is about it. All the stats that are attached to mob are supposed to be save together aren't they? Even the location doesn't get saved. Well, only variables that have actually been changed from their default value, and aren't marked temporary will be saved. |
In response to Ter13
|
|
Again thank you for you have proven your wisdom. How would I define char_name outside of CharCreate() without prompting user twice for a name? or would it be a new var and make it equal to char_name. No that wouldnt work because you cant define it outside of CharCreate()
|
Atoms already have a variable called name. during character creation, you will want to assign the mob you are creating for the character the name the player entered and was stored in char_name.
|
In response to Ter13
|
|
Atoms already have a variable called name. during character creation, you will want to assign the mob you are creating for the character the name the player entered and was stored in char_name.How would I do that without defining it inside the variable, all solutions I visualize wouldn't work. Well, only variables that have actually been changed from their default value, and aren't marked temporary will be saved.It doesnt even save movement which is not supposed to be temp unless it is default temp, if so is there a guide into where I can read up on how to make a variable stay changed from default value. |
In response to Ter13
|
|
world |
1
2
I can see how you did it with fill in the blank, but how would it be done with select the following options?