Im trying to write a Create_Character proc, but I keep getting errors when I try. I was wondering if someone could write a Create_Character proc for saving and loading.
Heres the code I need to be put into the proc.
mob
var/team
mob/character_login
mob/Login()
team = (input("What team do you want to be on?","team") in list("Red","Blue"))
var/area/A = locate("[team] base")
if(!Move(A)) loc = locate(/turf) in A
if(team=="Red")
icon='red.dmi'
else
icon='blue.dmi'
No errors in it when connected to the other coding.
P.S. Im using this proc for a clickscreen for when people log into my game.
ID:148625
Dec 4 2002, 3:47 pm (Edited on Dec 4 2002, 5:51 pm)
|
|
In response to RainZero
|
|
You have an indentation problem and your usage of locate is incorrect so you probably want to take a look at how it works in the reference.
|
In response to Theodis
|
|
The locate() usage looks fine to me... what's wrong with it? :-\
|
In response to Crispy
|
|
Crispy wrote:
The locate() usage looks fine to me... what's wrong with it? :-\ You can send a text string to it without the \ref macro? |
In response to Theodis
|
|
From the reference (relevant bits in red):
locate proc Format: locate(Type) in Container locate(X,Y,Z) <font color=red>locate(Tag)</font> locate(TextRef) Returns: An object of the specified type or the turf at the given coordinates. <font color=red>If a text string is given in place of an object type, the object with the same tag is found.</font> If a container is given, only objects directly within that object are searched. |
In response to Crispy
|
|
I musta accidently scanned over that :P.
|
In response to RainZero
|
|
RainZero wrote:
world The big problem here: You're using code you inherited from Zlegend2 whose origin you apparently don't know. Some of this code originated with me: I showed him how to do a part of it. Zlegend2, however, put in this mistaken line: if(team=="Red") var/team = lowertext(input("What team do you want to be on?","team") in list("Red","Blue")) So you have three things to fix:
|
mob=/mob/ppp/Choosin
mob/proc/CreateCharacter()
mob/character_login
mob/Login()
var/team = (input("What team do you want to be on?","team") in list("Red","Blue"))
var/area/A = locate("[team] base")
if(!Move(A)) loc = locate(/turf) in A
if(team=="Red")
icon='red.dmi'
else
icon='blue.dmi'
if(!Move(A)) loc = locate(/turf) in A // This is an invalid expression.
var/area/A = locate("[team] base") // Variable defined but not used.
var/area/A = locate("[team] base") // locate undefined proc
I DONT GET IT. It all looks perfectly good.