mob/var
mutantpowers = newlist(/skill/mutant/invisibility)
How could I make that easier? I tried typesof(), I tried making a global list that generates all of the powers at runtime. I dont want to have to type out all of the powers...
ID:178240
Jun 6 2002, 6:15 am
|
|
mob/var How could I make that easier? I tried typesof(), I tried making a global list that generates all of the powers at runtime. I dont want to have to type out all of the powers... |
Maybe,
mob/proc/AddPowers() src.mutantpowers.Add(typesof(/skills/mutant)) mob/var/list/mutantpowers = newlist() mob/mutant/New() ..() src.AddPowers() |
In response to Super16
|
|
Super16 wrote:
Maybe, Ah, okay, I'll try that. |
obj/powers Thats not showing anything in the statpanel.... PS- this works for my costume code....but I typed every single last of them in the list.... |
In response to Sariat
|
|
//THIS WORKS!! That shows the objects in the statpanel.... now when I do this: mob/var Please tell me why the first one works, and the second was wasn't working. Its easier for me to do the second one.... but it doesnt work! |
In response to Sariat
|
|
I really have no idea what precisely you're trying to do with which list; it's a jumbled mess to me. You have one that's powerslist, and another is mutantpowers, and an empty newlist() (which is pointless--you can use list() for that).
One important thing: You should create any list you don't want to be shared in New(); otherwise all mobs will have the exact same list. Lummox JR |
In response to Lummox JR
|
|
This is what I'm trying to do:
Have a mutant power trainer that lets you select powers from a statpanel, if you dont have them already. But with the second code, it won't show up on the statpanel but the 1st code shows all the powers in the statpanel. Example: Super Hobo Man has Teleportation and wants to learn memorize location for his teleportation skill. He goes over to the mutant trainer, uses the getpowers verb and selects memorize location from his statpanel titled "Powers". I hope that cleared things up. |
Let me explain it more,
I have:
How would I make all of them show on the usr.mutantpowers list WITHOUT having to put them in all at once? ie:
mob/var
mutantpowers = newlist(/skill/mutant/invisibility,/skill/mutant/ invisibility/,/skill/mutant/teleport)
-ST