ID:2330314
 
Code:
History
mob/History
mob/var/History
mob/proc/History()
var/list/Historie=new/list
Historie.Add("Average")
Historie.Add("Amnesia")
Historie.Add("Vagabond")

switch(input("What kind of backstory does your character have, or best fits your character as the case may be?","", text) in History)
if("Average")
History="Average"
var/choice=alert(src,"An Average background means your character has lived the ordinary sort of life for a character of your race. It went to a school where it probably had average grades, it's parents are still alive where applicable, and there was overall nothing really special about the way the character grew up. Is this the type of History you want? ","","Yes","No")
switch(choice)
if("No") History()
if("Yes") usr<<"Congratulations, Average character! You've chosen the Jack of all paths!"


Problem description: Hey not coded using the Byond API for ages soi am extremely rusty iv been messaging around with this snippet of the full code since it was giving too many errors when full and I keep encountering indentation and duplication errors any help would be highly appreciated

not coded using the Byond API for ages soi am extremely rusty iv

This much is very obvious. So let's go through those first 4 lines and move on from there.
History //This defines a new History datum (better known as a "class" in the real programming world)
mob/History //This defines a child of the mob datum, called History
mob/var/History //This defines a new variable for all objects of the mob type called History, with a null value since you did not set one
mob/proc/History() //This defines a new proc for all objects of the mob type called History

As far as what you're trying to do here, I do not know. All I can tell you, is that it seems very redundant, but should not give you any issues so far, in terms of compiling. Your History() proc shouldn't give you any compiling issues either, since you properly indented everything under it as a nice block of code, as it should be.

Now this next bit is where the compiler should be screaming at you.
switch(input("What kind of backstory does your character have, or best fits your character as the case may be?","", text) in History)
if("Average")
History="Average"
var/choice=alert(src,"An Average background means your character has lived the ordinary sort of life for a character of your race. It went to a school where it probably had average grades, it's parents are still alive where applicable, and there was overall nothing really special about the way the character grew up. Is this the type of History you want? ","","Yes","No")
switch(choice)
if("No") History()
if("Yes") usr<<"Congratulations, Average character! You've chosen the Jack of all paths!"

Your switch statement, as it stands, exists outside of your History() proc, simply because you don't have it indented under it. This makes the compiler think it doesn't belong anywhere and it just hanging code, and it doesn't like that. It's improper syntax.

What's funny, is the fact that your nested switch statement is actually properly indented. If you indent those 3 lines, starting at the first switch statement, it should be all properly indented, and compile just fine.

As a bonus, I'm going to let you know that procs that recursively call themselves, is poor programming practice. You should set up a do-while loop in this scenario. Think of it this way - "I want the player to DO a choice WHILE the value of choice is a certain value." Get it? You want the player to continuously choose a backstory option until they confirm they're happy with what they've chosen and then break out of the loop.