I am using a random combat system in my game.
I want to know how to change the music once you enter a battle, and once it's over, put's back the original.
2.
Is there a way to make the character face a certain direction. Someone told me to use
src.dir = EAST, but the whole map turned 90 degrees, which is not what I wanted.
3.
Since I started my project, I was using this weird Login()
code. I just need to know if there's anything I should change on it.
world
mob = /mob/create_character
mob
Login()
usr.Move(locate(/area/start1))
..()
create_character
var/mob/character
Login()
usr << sound('start.mid',1)
world << "[src.name] logs in!"
... //character selection here
character.name = charactername
src.client.mob = character
del(src)
It's works, but I have 2 Login(), and I'm not sure that's good.
4.
I'm still trying to make a code that allows an object to call a verb.
obj/stone
icon = 'stone.dmi'
Click()
usr.Charm()
mob/proc/Charm(mob/M as mob in view(5))
set hidden = 1
if(usr.mp>=5)
M.hp=min(M.hp+100,M.maxhp)
usr.mp-=5
else
usr<<"You don't have enough MP !"
Now, when someone gives me that "stone", I use the following codes:
usr.contents += new/obj/stone
usr.verbs+=new/mob/proc/Charm
Since the verb is hidden, no one can cast the spell, but
by clicking on the stone it should call it.
Unfortunately, it doesn't.
The spell works though when I remove the "hidden" and
call it from the verb panel.
THX in advance.
Cravens wrote:
It depends on how you trigger music in your game. If you trigger it in an area's Entered() proc, it should take care of this for you automatically if you make the battlefield in a special area. You move to the battlefield, the battle music plays. You move back and the other area's music plays.
You changed the client dir var. That will shift the display as you described. If you set the dir of an atom (Area, Turf, Obj, or Mob), that atom will turn in the direction specified.
Since the place you used src.dir is in a client proc, using mob.dir should work to turn the mob in the desired direction.
There's nothing wrong with having the separate Login() codes. In this instance, your game wouldn't work right if you did have them both in one Login() code. The top level Login moves any mob that a client logs into to the start1 area. The other Login() proc adds extra steps that happen when a client logs into character creation mob.
When you click the stone, it doesn't know which mob you want to Charm. It calls usr.Charm(null) and seems to do nothing because Charm wasn't made to accept null input.
You can add an input in the Click() proc to find out which mob they wish to charm, then call the Charm() proc.
You should also make sure that the stone is in the usr's inventory, or people will be able to use the charm stone from anywhere on the map that they can see it. (or even further away through some devious trickery I don't care to disclose. :P)
You don't have to add the Charm() proc as a verb for Click() to be able to call it. Adding it as a hidden verb means that the player can't see it, but could type it into the command line manually to execute it.