ID:149217
 
I am trying to make the Characters you chose have there music theme activate when you step on the turf, but it only plays 1 theme from another chaarter. How can i make this activate lets say, Rob Van Dams theme when i choose him and step on the trigger?--->
if ("Edge")
character = new /mob/superstar/Edge()

turf/wwfmusicthemes
density = 0
Entered()
if ("Edge")
world << sound('edgetheme.mid')
if ("Vince McMahon")
world << sound('mcmahon.mid')
if ("Rob Van Dam")
world << sound('rvd.mid')
if ("Tajiri")
world << sound('smack.mid')
You're not telling it umm anything, here's an example on how to make this work:


turf
music
Entered(mob/M)
switch(M)
if("Person one")
...
if(usr.character == "Edge")

Right now it's checking... "Is the text string "Edge" true? Well, it's not null or 0, so it is. Playing .mid file" "Is the text string "Vince McMahon" true? Well, it's not null or 0, so it is. Playing .mid file" etc.
In response to Nadrew (#1)
Not that, I have the login coded and everything is sweet, but, i set the turf on the floor, when you choose Rob Van Dam, and you start the game, walk to the turf called "wwfmusicthemes", and it will play RVD's theme song, but if someone logs in and chooses Gangrel, he steps on the turf while my theme is playing, it will switch to his...ect.


turf/wwfmusicthemes
density = 0
Entered()
if("Edge")
world << sound('edgetheme.mid')
if ("Vince McMahon")
world << sound('mcmahon.mid')
if ("Rob Van Dam")
world << sound('rvd.mid')
if ("Tajiri")
world << sound('smack.mid')
In response to Branks (#3)
So now you're saying it works? I'm confused by you!
In response to Garthor (#4)
i never said it works, i said i had the login made, because Nadrew said something about that. The string you gave me doesnt work at all
In response to Branks (#5)
ive tried over and over for the past hour, and this is pissing me off, there no way to do this..I ask one of my friends on MSn to help, and all he says is "nah, im too tired", and bhe has this coded in already for his game -_-
In response to Branks (#6)
I didn't understand what you're asking for really. What is the problem exactly?
In response to Garthor (#7)
Ok the problem is, When I login and choose a mob like mob/superstar/RVD

and i begin playing, i want his midi to play when I step on the trigger turf which is turf/wwfthemesongs. Then it will play his theme. When I choose somebody different like Rhino, i want his theme to play, only when i step on the trigger turf...you see what im saying?
In response to Branks (#8)
So it plays the first and not the second? Or does it not play the correct music? Or does it not play at all?
In response to Garthor (#9)
It doesnt play at all, but my first post with the code plays only 1 song
In response to Branks (#10)
when you choose a character, does it change your name to that? Because if it does, you can use src.name = "WHATEVER" instead of what you have.
Branks wrote:
I am trying to make the Characters you chose have there music theme activate when you step on the turf, but it only plays 1 theme from another chaarter. How can i make this activate lets say, Rob Van Dams theme when i choose him and step on the trigger?--->
if ("Edge")
character = new /mob/superstar/Edge()

turf/wwfmusicthemes
density = 0
Entered()
if ("Edge")
world << sound('edgetheme.mid')
if ("Vince McMahon")
world << sound('mcmahon.mid')
if ("Rob Van Dam")
world << sound('rvd.mid')
if ("Tajiri")
world << sound('smack.mid')

I have a simple explanation for why your code is both playing the wrong song, and playing a new song when someone else logs in and steps on it.

It's completely messed up.

  • The line that says if("Edge") is meaningless outside of a switch() statement; like Nadrew said, this is basically like saying if("Edge"!=""), which is always true.

  • You're completely ignoring the arguments to Entered(); the first argument, which is the atom that actually steps onto the turf, is what you need to determine which character just stepped there.

  • Once you know who's stepping on the turf, you need a way to lock it down if you don't want the next person to step on it (or another one like it) to have their theme song take over.

    It looks like sending the same file to everyone who's logged in is indeed the intended behavior, so basically I guess you need a way to prevent that song from being overridden by the next person to step on a musical turf.

    Lummox JR
In response to Garthor (#11)
You have been trying to recognize characters when they step on the turf; y not have a var/thememusic for each character and depending on which they pick at start it sets that to the correct theme music for them; then when they step on the turf just play usr.thememusic. This way u could also change a players theme music later without changing their character name or whatever.
In response to LostRealm (#13)
LostRealm wrote:
You have been trying to recognize characters when they step on the turf; y not have a var/thememusic for each character and depending on which they pick at start it sets that to the correct theme music for them; then when they step on the turf just play usr.thememusic. This way u could also change a players theme music later without changing their character name or whatever.

No, no, no. Never EVER use usr inside of Entered().

Lummox JR
In response to Lummox JR (#14)
Of course i meant:
Entered(mob/M)
M << sound(M.thememusic)


I just forgot that we were dealing with the entered proc
but still using it like a var for each character would be better since then thememusic could be changed at anytime
In response to LostRealm (#15)
LostRealm wrote:
Of course i meant:
Entered(mob/M)
M << sound(M.thememusic)

I just forgot that we were dealing with the entered proc
but still using it like a var for each character would be better since then thememusic could be changed at anytime

On this I agree. A different approach to the proc would be better than a switch().
(I just feel a need to reactively cut down any attempt to use usr in an Entered() proc, since doing so may save about 5 "I can't figure this out" posts.)

Lummox JR