I don't have any code of this kind in my game but it still says that this line:
walk_towards(src, usr)
has errors of duplicate deffinition for src and usr! Anyone know the problem?
ID:150872
![]() Jul 13 2001, 11:36 am
|
|
On 7/13/01 2:45 pm Air Mapster wrote:
On 7/13/01 2:36 pm SSTrunks7 wrote: step_towards(src, usr) this is the line that the error occurs on. I don't have this line anywhere else in my code. The error i get is this: npc.dm:4:error:src:duplicate definition npc.dm:4:error:usr:duplicate definition |
On 7/13/01 2:50 pm SSTrunks7 wrote:
On 7/13/01 2:45 pm Air Mapster wrote: Arrrgh. I just said that was not enough information! Please post at least a few lines above and below that one. The entire proc it's in, and the definitions of relevant mobs, objs, variables, whatever. Anything that is relevant. For that matter, what do you hope to accomplish with this line of code? Maybe that will help one of us determine what is going wrong and how you might want to fix it. By itself, the above line is perfectly valid, no problem with it at all. We need more information. |
On 7/13/01 2:57 pm Air Mapster wrote:
On 7/13/01 2:50 pm SSTrunks7 wrote: Ok, Mapster.........*sigh*....maybe you don't understand, that code is almost all of it in the dm. I just wanted to start simple and make my npc walk towards the player. Ok? So my entire code for this dm is this: mob goblin step_towards(src, usr) ....that's it! Won't this make my npc walk towards the usr??? If not what does it do? Anyway, any help would be appreciated. BTW: If you look back at all my posts, I have been curtious and nice, not demanding help nor harshly critisizing others. If i didn't post enough information, please be leanient and ask for more information in a nicer way. Thank you. |
On 7/13/01 3:04 pm SSTrunks7 wrote:
Ok, Mapster.........*sigh*....maybe you don't understand, that code is almost all of it in the dm. I just wanted to start simple and make my npc walk towards the player. Ok? So my entire code for this dm is this: Thanks. That's exactly what I needed. Sorry if I seemed a little harsh, I guess I was in a bit of a flamewar mood. Bad Mapster. I will restrain myself now. ....that's it! Won't this make my npc walk towards the usr??? If not what does it do? Anyway, any help would be appreciated. Ok, the problem is that the step_towards(src, usr) is not in a proc. Everything that does something must be in a proc. So, you need to do a couple things. First, you need to figure out when you want the goblin to walk towards the usr. When he's clicked on, when the player comes close to him, etc? Once you figure that out, then you can figure out where to put the code. As an example, I'll assume you want to make him walk to you when you click on him. Probably not what you wanted for your game, but hopefully it'll get you started on the right track. Once you start playing around with that, then you can modify it to make him walk under different conditions. Whenever you click on something, it has a Click() proc that is called. If you want to do something when it is clicked on, you put that stuff (step_towards) in the Click() proc. It might look like this: mob goblin Click() step_towards(src, usr) Now, this will only make the goblin take one step towards you. If you want him to keep going, you might look into the walk_towards proc instead. BTW: If you look back at all my posts, I have been curtious and nice, not demanding help nor harshly critisizing others. If i didn't post enough information, please be leanient and ask for more information in a nicer way. Thank you. Sorry, I didn't mean it to come off that way. Hopefully you can see that sometimes it can be a little frustrating to those of us who try to help, but aren't given enough information. It's a very common newbie mistake - either providing little to no relevant information, or posting the entire code or 500 lines, only 4 of which are relevant. It's a fine art to find that balance - often when you get good at determining what is relevant, you'll be proficient enough to figure out the problems yourself. That's the goal when we help people out here. ;-) |
On 7/13/01 3:23 pm Air Mapster wrote:
On 7/13/01 3:04 pm SSTrunks7 wrote: Hes Lucky Lexy wasn't the one to help him |
On 7/13/01 3:23 pm Air Mapster wrote:
On 7/13/01 3:04 pm SSTrunks7 wrote: Thanks a lot for taking the time to help me. I know how newbies can be frustrating to help sometimes cuz i'm a guru in a few things and have to help them then, so no problem. As for the code, i now understand that it had to be in a proc. What i intend to do is if the usr is in (or walks within) 5 spaces of the src(goblin, in this matter) he would walk towards you until you were more than 5 spaces away. Is there a poc for that? I had a friend try to show me but his vars were waaaaay different then mine and he wanted something else with his code so it didn't help me. If you could tell me the proc or anything, i'd be really gratefull. Again, sorry Mapster for the confusion, i'll try to be more understanding in the future. Thanx. |
On 7/13/01 3:35 pm Nadrew wrote:
On 7/13/01 3:23 pm Air Mapster wrote: lol, Nadrew!! I am lucky aren't I?!?! |
On 7/13/01 3:41 pm SSTrunks7 wrote:
On 7/13/01 3:35 pm Nadrew wrote: Hell Yeah!! |
Nope. Need more information. Post the relevant code, the exact error message, and mark the error line in the code, or we can't help!