![]() |
Triggerserver In a Level NPC
I'm not honestly sure how many people care about this at this point, especially when setshape & triggeraction has been such a viable option for a long time now, but I've actually come up with a solution to make this possible that I've personally tested and succeeded with. It's not efficient, but it does get the job done, and if you desperately need a local npc to use client/server interaction without having the npc have a shape, you can use this.
Anyway. First I'll explain the problem that actually causes this to initially not work. The issue is that level npcs simply do not have a name on the clientside of things. Only server. So the issue is that, basically, if you try to use PHP Code:
PHP Code:
Like I said, not sure if this serves anybody any use, but I was ****ing around this morning experimenting different methods of getting triggerserver to work in a Class NPC because I've always wanted to do it, (mostly because of my irrational hatred of triggeraction() ) and when I figured it out I thought I'd share with this lovely (read: vile) community. Also, pls rep me. Enjoy. :) |
Quote:
PHP Code:
PHP Code:
also, wouldnt this stop working if you use several npcs? i'd just suggest to stick with the setshape/triggeraction version like you mentioned it |
The timeout method is really dumb, this is a much better method:
Quote:
PHP Code:
Depending on your situation, a better solution can be to have an actual DB NPC which handles the actions/logic of the level NPC and simply trigger that. Quote:
|
I'm aware @ the timeout method being dumb, the only reason I used that is because I wanted it to be constantly running for testing purposes. I wouldn't use it in an actual NPC. The attribute idea is pretty great, I actually didn't think of that.
And yeah, I know in most situations you can just use a DB Npc to handle all level NPC trigger needs -- that's why I opened the thread by saying that it's probably not all that useful. I just thought it was neat that I got triggerserver to work and figured I'd share. EDIT: Post 69 ajajaja. |
All times are GMT +2. The time now is 07:32 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.