![]() |
mouse coords
NPC Code: this should transefer player mouse x and y coordinates to the npc's values thos.x and this.y right? If not what am I doing wrong? (if needbe I can post more of the script) |
Quote:
|
Well is there anyway i can access them with a serverside script without trying to somehow get the client to constantly send them as new variables?
|
Quote:
|
I did try it, of course, I read the rules. By it should i mean it doesnt but it should and by iof not what am i doign wrong i mean if im wrong assuming this should what is the proper method? But anyway, what i am trying to do is have a summoned monster move to and when close enough attack that coordinate. I couldnty use a triggeractrion or client.string since it's a putnpc2 class npc that gets summoned, so yes any help would be appreciated.
|
Quote:
NPC Code: That would be the best way to go about it in my opinion. It is best to keep as much of the monster code in the actual monster class, rather than spread it out (Makes it easier for editing and just overall purposes). If you have any other questions ask away (within reason and after evaluating what you're asking ;)) |
I will try using this method and tell you ifd it works, thanks for your help.
|
Quote:
|
hmm, doesnt seem to be working, through debug maneuvers the problem seems to be that the monster isnt recieving the flag....
NPC Code: which is called from the script: NPC Code: I believe this is what you said to do, I haven't ever used callnpc before though, so i wouldn't know. |
Quote:
|
I tried both, neihter worked.
|
Quote:
|
I already made sure that part works, don't worry about it.
|
Quote:
Anyway, follow the debug process, dude. Figure out exactly which part of your code is not working, and then post it. |
I did, the problem is that the callnpc isnt getting picked up by the monster.
|
Quote:
For debugging, that's a crucial part man x.x I'd suggest trying with (npc[client.id]) sendtonc accessing the monster!: And if you do the this.npctype I said also send that, perhaps your'e not on the right NPC (as I said prior). What server is this on and I might swing by? |
Clientside ID of a NPC does not always equal the serverside ID of a NPC.
Also why not just trigger the npc directly from clientside? |
Dont you need callnpc servewrside if dealing with a serverside npc?
|
Found the problem, cant fix it:
NPC Code: That part, where it sends the command to the npc, which should recieve it with: NPC Code: But it doesnt make any acknowledgement that it was told to move. |
> Clientside ID of a NPC does not always equal the serverside ID of a NPC.
> Also why not just trigger the npc directly from clientside? |
Is there any way to convert a clientside id to a serverside one?
|
Quote:
1. You trigger on the position of the npc you want to move, then the npc directly gets the trigger and you don't need to code anything complicated (triggeraction monsterx,monstery,test,...; -> if (actiontest) ...) 2. You send the ID of the npc (not the index), and on the serverside you are searching for the npc with the right id - this works because the ID is actually the same, except when the npc is not existing on the serverside, e.g. if it only has clientside script for (i=0; i<npcscount; i++) if (npcs[i].id==monsterid) callnpc i,test,...; |
I'll try the second one.
EDIT: It works, thank you so much! And also thanks PS for giving me tha targeting system when you came on last night. |
All times are GMT +2. The time now is 06:23 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.