ID:160278
 
how would i code if a new player logs in and if they pick a class witch for example they randomly get a verb like premonition for example and if they pick a class like whitelighter they automatically get the whitelighter powers
Look up the procs pick() and Login() in the DM guide and explain your question more.
In response to Lyndonarmitage1
Mel23jones, you are overdoing it a bit, dude. While your enthusiasm is great, you are (unknowingly) sucking the life out of the forums by posting a *huge* number of threads for little things that a practiced DM programmer can usually figure out on theri own. This is why the term 'help vampire' has been used in several of your threads.

What it amounts to is that everyone else is building your game for you, bit by bit, fixing problems that you should be able to fix yourself (in most cases). We are not adverse to helping, but there is an expectation that you try to solve these problems and ideas *first*, before coming here.

Please take the time to read through the following links. Yes, it will mean that you might stop your game development for a while, *but* the benefit is that you will understand 75% of the stuff you ask us about, and your game will progress faster in the long run.

http://www.byond.com/members/ DreamMakers?command=view_post&post=40355
http://www.byond.com/members/ DreamMakers?command=view_post&post=36143
http://www.byond.com/members/ DreamMakers?command=view_post&post=36233
http://www.byond.com/members/ DreamMakers?command=view_post&post=36273
http://www.byond.com/docs/guide/
http://www.byond.com/docs/ref/

Please come back when you are more comfortable with the langauge. We'll be here.
In response to Lyndonarmitage1
Lyndonarmitage1 wrote:
Look up the procs pick() and Login() in the DM guide and explain your question more.

I'm afraid you're mistaken sir. He asked if the user picked, not the program. pick() would not be the proc to use here. At it's most simple form, he'd be looking for input() to allow users to pick something from a list themselves.
In response to Tiberath
Apologises the name of the thread is randomly give powers and I sped through reading it and didn't quite get what he meant, so when he said randomly get a verb I thought pick()!
But as you have said looking up input() and lists will help.
In response to digitalmouse
The tricky bit he's encountering here is that verb access is static and (to my knowledge) cannot be modified at runtime.

So you can't do something like define a bunch of verbs on the player mob and have them activate or deactivate depending on which powers they ended up with. You can prevent them from running with a control variable, but you can't hide them (I assume "set hidden" is made constant at runtime like anything else manipulated with the verb "set" command).

There's a few ways to get around this - such as not using verbs at all - but the most straightforward may be to use inventory objects with "set src in usr.contents" verb settings. Then all you have to do is create that inventory object inside the player mob every time they want them to have access to that power.

If that's still too complicated, yes, you'll definitely want to practice your coding until these things seem more self-evident.
In response to Geldonyetich
Geldonyetich wrote:
The tricky bit he's encountering here is that verb access is static and (to my knowledge) cannot be modified at runtime.

Very wrong; give DM more credit. =) See here.
In response to Kaioken
Kaioken wrote:
Geldonyetich wrote:
The tricky bit he's encountering here is that verb access is static and (to my knowledge) cannot be modified at runtime.

Very wrong; give DM more credit. =) See here.

Oh ho! I see what you're doing here.

I was partly right, but I didn't think outside the box. My limitation was that you can't change the set commands (including "verb access" set src commands) on your verb at runtime. The solution? Add and remove entire verbs as necessary.

If I hung out on these boards more often I'd learn these things, eh? Thanks much for the info.
In response to Geldonyetich
Geldonyetich wrote:
My limitation was that you can't change the set commands (including "verb access" set src commands) on your verb at runtime. The solution? Add and remove entire verbs as necessary.

Correct, but you said 'access' - that specifically can be changed at runtime.

If I hung out on these boards more often I'd learn these things, eh?

Sure, you learn some cool knowledge on the forums, sometimes even undocumented - but to be honest with you, really, this kind of thing and the bulk of knowledge is available at your demand and you don't need to start reading every topic throughout the forum to get it. =P If you're interested, I really suggest reading through the entire DM Reference and as such sometimes - it documents most of DM's features, so this way you'll know what's possible, what not, etc... the DM Guide also has some nice info that isn't present in the Reference, despite being much older (the Guide is very old, the Reference is current). DM is even more awesome than how you currently think it is!

Thanks much for the info.

Any time. =)
In response to Kaioken
Though I've been dabbling with BYOND for about a couple months, have some previous experience dabbling with code in other languages, and have printed off the entire Byond Manual PDF (ancient as it is) and given a thorough read from back to front, it'll probably be awhile until I can pick up every single nuance of DM code.

In this way, having the reference isn't good enough. I need to actually use it to understand what the reference means. The same applies to the OP of this thread, I imagine. These forms are useful to help bridge the gap.

For example, thanks to the reference, I knew that you could convert procs to verbs. Thanks to your post, the utility of it now makes a lot more sense. I imagine I'll have similar epiphanies as I continue to work with BYOND and its community. ;)