![]() |
Npc |Server - Clientside| Communication
Hey guys!
I'm just making a baddysystem. So I'm wondering how you communicate between Clientside and Serverside in an npc class. To make a bit more understandable: Baddy Class ( if the baddy gets hit) PHP Code:
So far... |
Move the "Actionxp" function to the serverside portion of the -xpcalculator script. You should be doing things like that on serverside anyway.
|
When you're developing an EXP system you should have all those functions in a player-joined class. Here have some bare-bones for one.
class: playerfunctions PHP Code:
PHP Code:
PHP Code:
|
aight i see, simple as that.
Thanks =) |
Okay, yet another problem:
I surfed about 1hour in the forums now, but still can't find any good resolution. So for my baddyclass script i need Serverside > Clientside communication ( local npcs that joins baddyclass) . I found out that you can use attr[] , tried it but it seems i can only set them once and then cant change them anymore... then i read that triggerAction would work from Serverside to Clientside aswell , well i tried it and nope unfortunately it doesnt seem to work. At this point i just doubled everything like what i wrote clientside i wrote serverside aswell so it works in both purposes but this cant obviously be the best solution for it. Hope you got any good ideas |
Look up Inverns Clientside <-> Serverside thread in the code gallery, should be helpful, but what your could do, is if you start client side in a class use triggerserver(); to a weapon, then trigger down to the client (triggerclient();) in that weapon then call the function from the class. Or vice versa if starting serverside
|
What do you need to do on the client in your baddy script? Chances are it can be done better on the server.
|
Yea the Problem is i need things like The hitdetection for the npc clientside aswell as dead animation and stuff
|
Quote:
|
How would you do an ani Serverside? And the hitdetection though, im doin it via triggeraction and as you will know, it'll bug out if more than one levelnpc is in the level.
thats why i'm doin it clientside, if you have any other suggestions your welcome |
All the same commands (setcharani) and the triggeraction will hit both the client-side and server-side functions provided there's a set shape or character for it to hit.
|
Triggeraction wont work cause im triggering via this.x and this.y which wont work if the baddy is walking :o
|
aight. so i just made everything work Clientside now. Its all fine except i thought i could easily just use an public image id (<200) and then everything would be perfect; every player would see the same healthstatus of the baddy but unfortunately im wrong :/
any help? |
Maybe try something like this.
Quote:
|
| All times are GMT +2. The time now is 11:37 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.