Hi, I am trying to make my quest npcs have a "!" on them if they have a quest and that only you can see, but if you have finished the quest the "!" dissapears.
any help would be great.
ID:159925
Dec 19 2008, 2:22 pm
|
|
Dec 19 2008, 2:24 pm
|
|
Look up images.
|
In response to Andre-g1
|
|
mob Ok, this is what I got, but it isnt working... |
In response to Carnia
|
|
Two problems that I can see outright.
1) The if(!M.quest) checks to see if they DO NOT have a quest. I would think that you'd check to see if they DO have a quest. I could be wrong though, as I don't know how you coded the rest of your game... 2) That proc doesn't have a defined image, so just giving the letter "i" a variable and deleting it, won't reference the defined image variable in the New() proc. You need to define the image again in the proc, so it knows what to delete exactly. Correct me if I'm off a little please. (Jeff, Kaioken, Andre, etc) :) |
In response to Mizukouken Ketsu
|
|
Ah, I figured it out, thanks alot :)
|
In response to Carnia
|
|
Carnia wrote:
> mob Ok, this is what I got, but it isnt working... If I'm reading it right (aside from the issue mentioned above), it would only show the ! to players who were in the game when the mob is created. IIRC the last time I made something like that, I used Enter() on the area the npc was on, so that when the player enters the area it checks all the npcs and whether they have a particular quest or not. Whether this is the best way to do it or not, it seemed to get the job done. Edit: There was a thread not too long ago discussing the use of ..() in the new proc... in this case I don't think it's necessary, but I could be wrong. |
In response to Carnia
|
|
Code matters (such as using the wrong arguments order in image()) aside, the design itself is bad; often people don't pay enough attention to these things and waste considerable resources instead of reusing existing ones.
The way your code works, when an NPC is created, you create a new image object for every player. So an object for every NPC, for every player (f.ex. 20 NPCs and 10 players produces 200 images). Again, aside from this utterly failing because you're not likely going to have players logged in when the NPCs are first initialized et cetera, this wastes resources: you only really need to maintain a single image on each quest giver NPC, and then turn that single image on and off for players, by simply adding and removing it from the client's images list (not creating new instances and deleting them per player). mob/npc/questgiver Note you could use more resource effective methods, but that's a tad more involving. EDIT: Fixed a Miss |
In response to Kaioken
|
|
Wow, thanks Kaioken, your way is alot let resource killing then mine that I figured out, thanks for the tips, they helped alot :)
|