ID:172299
 
Ok, I have come to my latest problem in learning DM. I am having trouble with accessing files for the player. What I mean is, having the player choose, say, a face icon that displays when they talk in game. I would also appreciate it if someone could help me with doing the same for music ; as in, playing music that a player choose to either himself or everyone in the game, kinda like in most chatting/icon trading games.

I've looked for demos, I've scanned through the references and the blue book, yet I can't seem to figure out how to do this!

For anyone that can help, I thank you in advance.

- Clowd
Clowd wrote:
Ok, I have come to my latest problem in learning DM. I am having trouble with accessing files for the player. What I mean is, having the player choose, say, a face icon that displays when they talk in game.
mob/var/faceicon

mob/proc/choosefaceicon()
var/choice=input("What face icon would you like to choose?")in list("Face","Person")
switch(choice)
if("Face")
src.faceicon = 'face.dmi'
if("Person")
src.faceicon = 'Person'

mob/verb/say(msg as text)
world <<"<IMG CLASS=icon SRC=\ref[usr.faceicon]>[usr]:[msg]"



I would also appreciate it if someone could help me with doing the same for music ; as in, playing music that a player choose to either himself or everyone in the game, kinda like in most chatting/icon trading games.
mob/verb/playmusic(s as sound)
var/choice = input("Play music to yourself or to the world?")in list("To myself","To world")
switch(choice)
if("To myself")
usr << s
if("To world")
world << s

In response to SSJ4_Gohan_Majin
um... I'm sorry, that isn't what I meant.

Let me rephrase what I said.

What I'm trying to do is have it so the player can choose a .png or .bmp file from their computer for use as their character's face icon that is displayed while chatting.

The other thing is letting the player choose a .mid file on their computer and having it played, either to themselves or to everyone in the game.

A third thing I almost forgot about was being able to send files between players. for example, player A has icon A, and player B wants icon A. So player A sends player B icon A in BYOND.

I've seen it all been done before, but I just can't find the correct proc for it.
In response to Clowd
Clowd wrote:
What I'm trying to do is have it so the player can choose a .png or .bmp file from their computer for use as their character's face icon that is displayed while chatting.

Don't.

The other thing is letting the player choose a .mid file on their computer and having it played, either to themselves or to everyone in the game.

Don't.

A third thing I almost forgot about was being able to send files between players. for example, player A has icon A, and player B wants icon A. So player A sends player B icon A in BYOND.

ftp()
In response to Garthor
Garthor wrote:
Clowd wrote:
What I'm trying to do is have it so the player can choose a .png or .bmp file from their computer for use as their character's face icon that is displayed while chatting.

Don't.

Why? I want the user to have a custom face icon that is in, at most, a 64x64 pixel format.

The other thing is letting the player choose a .mid file on their computer and having it played, either to themselves or to everyone in the game.

Don't.

Why? bothered by it? I've come up with an idea that should work to make it so that only one person can start a song at a time for the world, and will prevent a world song from playing for a person who is playing a personal song.

A third thing I almost forgot about was being able to send files between players. for example, player A has icon A, and player B wants icon A. So player A sends player B icon A in BYOND.

ftp()

Thanks, I'll look it up.
In response to Clowd
Because both of them just lead to abuse.
In response to Garthor
That's beside the point, are you going to help me with it or not? I just would like to know.

Besides, if anyone abuses them I can just mute them. What MY version of mute does, well, you'll hafta find out yourself!

but, seriously now, if you know how to do it, show me some example code, a link to a demo that I may have overlooked, or tell me what proc does it and I'll look it up myself.

I do believe this forum is for HELPING with problems, not refusing to help because of conflicting philosophies.
In response to Clowd
If I did that, then you'd never learn.
In response to Garthor
well, I'd learn if you did anything but give me the code. I'd wind up disecting the code in the demo, and figuring out how the proc works if I know what it is.
In response to Clowd
No, you wouldn't.
In response to Clowd
Clowd wrote:
What I'm trying to do is have it so the player can choose a .png or .bmp file from their computer for use as their character's face icon that is displayed while chatting.


Well, you can get an icon file from a player by using an argument that's "as icon" in a verb.

Example:
mob/verb/GetIcon(iconfile as icon)
src.icon = iconfile


You'll just need to keep track of the uploaded icon(in a variable somewhere) and display it when you want to.
In response to Garthor
how do YOU know? do YOU know ME? I don't think so!

So, can't you just be NICE and NON-NEWB BASHING for once and actually HELP, that's right H-E-L-P somebody like John88 and ssj4_gohan_majin tried to do?

I mean, seriously, do you lack this word in your vocabulary? if so, I suggest you try to find out, and stop being such an idiot like this.

oh, and I've never seen any problems with stuff like this before.
In response to Clowd
Because 9 times out of 10, I'm right.
In response to Garthor
Then prove you're right about how to do the code. Or is that 1 out of 10 times that you're wrong?

All I'm asking is for YOU to respond about this. After all, this forum IS about helping people, not telling them "do not do this, it'll screw up your game" let the person figure that out for themselves. That'll TRULY teach them about game design. Besides, if we don't learn the code, then people are gunna just churn out crappy games.