ID:1473061
 
(See the best response by Albro1.)
if("Saiyan")
mobcreation = new /mob/PC()
// if(prob(0.1))

if(prob(50))
mobcreation.rage_chromosome = 1
else
mobcreation.train_chromosome = 1
mobcreation.legend_chromosome = 1
mobcreation.god_chromosome = 1
mobcreation.race = "Saiyan"
mobcreation.powerlevel = 200
mobcreation.powerlevel_max = 200
mobcreation.strength = 15
mobcreation.strength_max = 15
mobcreation.overlays += tail
mobcreation.Skin()
mobcreation.Hair()
mobcreation.Karma()


This is my code for saiyan and I can't figure out how to put legend and god gene in with out putting 3 types of genes at once please help! :(
You would use the pick() proc and then give a prob () for each type of gene type.

Then take all that stuff and move it into a proc which is within the saiyan mob type that stores all that data and takes an argument of a gene. Then this gene would determine which gene set they have.

So like
Pick ( 
Prob (50)
Gene ="rage"
Prob (35)
Gene = "angry"
Prob (15)
Gene = "god"
)
Selectgene (gene)
Mob/saiyan/proc

Selectgene (mob/saiyan/geneType)
Switch geneType
// other code here.
if("Saiyan")
mobcreation = new /mob/PC()
Pick (
if(prob(35)
(Gene ="src.rage_chromosome = 1")
if(prob(45)
(Gene ="src.train_chromosome = 1")
if(prob(23)
(Gene ="src.legend_chromosome = 1")
if(prob(10)
(Gene ="src.god_chromosome = 1")
mobcreation.race = "Saiyan"
mobcreation.powerlevel = 200
mobcreation.powerlevel_max = 200
mobcreation.strength = 15
mobcreation.strength_max = 15
mobcreation.overlays += tail
mobcreation.Skin()
mobcreation.Hair()
mobcreation.Karma()




How do I make it work like my coding?
Your way wouldn't need the gene = you would just make it src.legend_chromosome
Says missing expression or need right paren?
Best response
Oh my.

Are you just throwing random parenthesis in there?
I'm just tryna figure out where things are suppose to go. I'm just now learning how to do this stuff and I suck so far. :(
In response to Yoshino21
Can you copy and paste the runtime error?
1.0 System\1.1 Character Creation\Character Creation.dm:305:error: (: missing comma ',' or right-paren ')'
1.0 System\1.1 Character Creation\Character Creation.dm:305:error: (: missing comma ',' or right-paren ')'
1.0 System\1.1 Character Creation\Character Creation.dm:305:error: expected expression
1.0 System\1.1 Character Creation\Character Creation.dm:307:error: (: missing comma ',' or right-paren ')'
Dragonball Z Saiyan Revenge.dmb - 7 errors, 0 warnings
You forgot the second ) to end the pick proc at the very botton of the above code add )
loading Dragonball Z Saiyan Revenge.dme
1.0 System\1.1 Character Creation\Character Creation.dm:307:error: (: missing comma ',' or right-paren ')'
1.0 System\1.1 Character Creation\Character Creation.dm:307:error: (: missing comma ',' or right-paren ')'
1.0 System\1.1 Character Creation\Character Creation.dm:309:error: (: missing comma ',' or right-paren ')'
1.0 System\1.1 Character Creation\Character Creation.dm:311:error: (: missing comma ',' or right-paren ')'
Dragonball Z Saiyan Revenge.dmb - 4 errors, 0 warnings


Now I get this.
Akando gave you a bad example of using pick().

1. pick() is all lowercase.
2. Simply hitting enter and/or tabbing will not move you to the next argument in pick() - you must use commas. I understand you were using the syntax to weigh the options in pick(), but to be honest the way you did it is very confusing for a newbie to read.


As for your snippet, you cannot of if statements inside pick(). To accomplish your task, you need to weigh your different options inside pick using the syntax found when you hit F1:

usr.gene = pick(
"normal", /*this is the normal gene, and it is the "norm" to be picked*/
prob(50); "legend", /*this "legend" is half as likely as the norm to be picked*/
prob(20); "god" /*and this "god" is 1/5th as likely to be picked*/
)


I hope that helps (And I hope I didn't mess up with my explanations. If someone happens by that notices something I messed up on, feel free to point it out).
Albro can you edit my code to do as so btw I just had to edit it because I left out the = 1
You're missing the second parentheses after the prob() number
In response to Leoinpharoh
As I already explained, he can't have if statements in pick.

And no, Yoshino, I can't edit your code. If I do that, you won't learn what you need to do. I explained what I could given the information you've presented - if you want to know more, be more specific.
In response to Albro1
But he just needs the codes, why don't you give them to him. Then he can move on with his game! C'mon Albro, don't be stupid.

hahaha

Edit: Sorry, just having a laugh. The lack of trying really concerns me, which is why I poked at some fun.
In response to FIREking
FIREking wrote:
But he just needs the codes, why don't you give them to him. Then he can move on with his game! C'mon Albro, don't be stupid.

hahaha

I can say, without a doubt, that this attitude is killing BYOND.

It's sad that long-time users do not appreciate that their attitude is fundamental to the downfall of BYOND. Obviously the OP needs assistance, but instead of supporting him, this thread is riddled with sarcasm and pessimism. If I was beginner programmer, I would stay far away.

BYOND needs fresh ideas. BYOND needs to question the status quo. If regular developers remain resistant to help new members, BYOND will continue to be unsustainable.

Granted, the OP is asking relatively simple questions. However, without clear access to demos and tutorials, I can understand why he needs assistance.
I can say, without a doubt, that this attitude is killing BYOND.

It's sad that long-time users do not appreciate that their attitude is fundamental to the downfall of BYOND.


We're not having a meta-discussion in this forum. Please take it out of the thread if it's going to turn into yet another "this is why BYOND is terrible and so should you." That stuff belongs with the rest of it in Off Topic/Byond Discussion.
Did you get it working?
Page: 1 2