mob
player
Guild
ID:169761
May 3 2005, 3:43 pm
|
|
How do you access this variable?
|
In response to Chance777
|
|
This is what I have
mob How do I access it? |
In response to BakaSan
|
|
Same way you access any other variable. What are you trying to do?
|
In response to Chance777
|
|
I'm trying to make a guild system and it doesnt work with M.Guild. I'm also trying to save it.
|
In response to BakaSan
|
|
Someone Please Help. I need this soon.
|
In response to BakaSan
|
|
M is probably defined as /mob. If it's always going to be of type /mob/player you can define it as var/mob/player/M.
|
In response to Chance777
|
|
Chance777 wrote:
Well, first you'd have to define it as a variable. mob/var/player/Guild = "" I think, anyways. I seem to get corrected everytime I post help on the forums. Well, since you're already braced for it, here goes: Why are you setting this to an empty string if it's defined as a /player datum? While this is technically legal, there's no reason to do it. Why not just leave it with the default value, null? Lummox JR |
In response to Lummox JR
|
|
mob This is what I'm using it for. |
In response to BakaSan
|
|
Well, you seem to have replied to the wrong post here, but I'm very concerned about this:
return char_name I have no idea what that's supposed to do, but it won't do it. You can only return one value from a proc, and once you do, it's done. None of the code after that first return line will ever run. Lummox JR |
In response to Lummox JR
|
|
So how would you access Guild?
mob I gives me an error that the variable's undefined type. The code in the previous post was to create a character and save all the data into a file. |
In response to YMIHere
|
|
All the varriables I have here are all under mob/var/player/
|
In response to BakaSan
|
|
That suggests to me that the problem is that you don't understand typecasting.
http://www.byondscape.com/ascape.dmb/YMIHere.2005-0322/ Hopefully, that'll help. |
In response to Jp
|
|
The simple answer is just use M:guild istead of M.guild. Since you are accessing a mob/player/var in a mob/proc, you have to use the :.
|
In response to DarkSkythe
|
|
You're telling someone to use <code>:</code>? When there are alternatives available?
|
In response to DarkSkythe
|
|
DarkSkythe wrote:
The simple answer is just use M:guild istead of M.guild. Since you are accessing a mob/player/var in a mob/proc, you have to use the :. No you don't. That's bogus advice. You never "need" the colon operator; it's merely convenient for certain situations. In this case it does not belong there, because it would mask over a conflict of types. You just have to make sure you handle types correctly. The problem is either that 1) this shouldn't be a mob proc, but a mob/player proc, or 2) this shouldn't be a mob/player var, but just a mob var. Lummox JR |
I think, anyways. I seem to get corrected everytime I post help on the forums.