![]() Sep 5 2005, 10:50 am
In response to O-matic
|
|
Then why is it saying list is an undefined proc?
|
Popisfizzy wrote:
Then why is it saying list is an undefined proc? I dont have a clue O.o. When I copied the code in DM (to test it) and did what I suggested I didn't got any errors, oddly enough... O-matic |
Options is already a list, so you wouldn't use the list() proc here. Also, using call() with proc name requires the object that owns the proc (in this case, src) be sent as the first argument. Of course, with this setup as soon as anyone Prays everyone will be able to Talk.
Zehlihn |
The problem with that is that it adds the usr's name to a list. I don't want it to do that, because after talk, there will be more things, and it will all get very messy.
|
It's probably better to keep the options on the player for saving purposes anyway. Just add Talk to a zeh_options list in the player and use that list in Click().
|
How would I go about doing that? I'm confused by what you mean? :P
[Edit] I also get this runtime error:<font color = red> runtime error: type mismatch proc name: Pray (/mob/mobs/Holy_Beings/Zehlihn/verb/Pray) usr: Popisfizzy (/mob) src: Zehlihn (/mob/mobs/Holy_Beings/Zehlihn) call stack: Zehlihn (/mob/mobs/Holy_Beings/Zehlihn): Pray(Popisfizzy (/mob)) Zehlihn (/mob/mobs/Holy_Beings/Zehlihn): Click(Grass (36,103,3) (/turf/Environment/Grass/Grass)) </red> |
You'd keep the list of options available for the player to use on his character. If you plan on having a few of these NPCs with dynamic options you might as well make a nice system for it. =)
mob If not, you could just use a list variable (zeh_options) to keep track of what options the player has. mob |
For everywhere you have NPC_name, NPC_options, etc. I have to place in the NPC's name and stuff, right?
|
No, those are variables, you just have to send the right information to those procs. =) The only things you should have to change are the NPCs, like YMIHere and Zeh_fella. If you want to add a new one, you can just do something like this.
mob/dynamic_NPCs Of course, this guy isn't dynamic at all and really shouldn't use this (it's a waste of a list as it is). To make a good example I should show you how the player's NPC_options list would look like after you played around with the other two NPCs a bit. mob/NPC_options = list( Knowing how this adds up, we can give the player a starting option for a certain NPC, and be able to take it away later (which we can't for with constant options). mob/var/list/NPC_options=list("Mr. Talk-a-tive"=list("Greet")) // We can Greet Mr. Talk-a-tive by default. Now he can be used in a nice looping fashion. Useless? I know, but that's only because I have no need for it. =P You might, if you plan on having other NPCs like your first one. Want a guy that will completely ignore you until you show up wearing the ring he lost? mob/dynamic_NPCs/guy_who_lost_his_ring Now you'd just call AddOption("Jed", "I found your ring") whenever the player picked up Jed's ring, and RemoveOption("Jed", "I found your ring") whenever the player got rid of it (mob/Entered() and mob/Exited() respectively). |
My coding:
mob And I get these errors: Deities-Gods.dm:38:error:NPC_options:undefined var Deities-Gods.dm:39:error:NPC_options:undefined var Deities-Gods.dm:47:error:NPC_options:undefined var Deities-Gods.dm:47:error:NPC_options:undefined var Deities-Gods.dm:48:error:NPC_options:undefined var Deities-Gods.dm:42:if :warning: if statement has no effect Deities-Gods.dm:54:error:NPC_options.Remove:undefined var Deities-Gods.dm:8:error:constant_options:undefined var Deities-Gods.dm:14:error:prayers:undefined var Deities-Gods.dm:25:error:prayers:undefined var Deities-Gods.dm:60:error:constant_options:undefined var Deities-Gods.dm:63:error:cal:undefined proc Deities-Gods.dm:63:usr :warning: unused label Its copied exactly, so the lines listed are the actual number. |
First of all, get rid of the old Click() (the one under Zehlihn). We're not using that anymore. =P Then you have to make Zehlihn a type of /mob/dynamic_NPCs or it won't be able to use the new Click() we made.
As far as the other errors go, you've capitalized the O in the declaration of NPC_options, added an extra t in the declaration of constant_options, un-indented the if segment (if(!(option in options))) in AddOptions(), and left an l off of call() in /mob/dynamic_NPCs/Click(). Also, I left out some stuff in RemoveOption(). It won't cause errors without it, but it should be there. RemoveOption(NPC_name, option) |