![]() |
NPC Setlevel2 problem
So I have a problem where setlevel2 is not acting appropriately.
Example: So imagine I'm building an hotel with 30 floors/levels that will all be 100% similar. The stairs will be on the north and south of the room, with NPC's as level warps. If the north and south npcs - that use selevel2 to change floors - are on the same x axis location, then it will enter the script of the next floor's npc to go to the next level, etc. In a split second, you go from floor 1 to floor 30. The problem: Npcs using setlevel2 to transfer a player to another level which contains an npc with a setlevel2 call also, will send the player to that call's location as well IF they have the same x location; the y location is not important. If you want to see an example, log onto my server - Aqua (Going to be renamed to Vivitron), and I will show you a hotel system I'm working on. |
post some script(s) please.
don't really feel like logging onto a private server after aforementioned security flaws, and not really looking forward to hunting down some hotel system... Just based on the description, you need to compensate for the direction the player is traveling in, because it seems you are probably warping him either: 1.) Directly on top of the next NPC, causing the player to touch the NPC event to occur, and warp him appropriately, or 2.) You are warping him too few tiles apart from the NPC and he is still traveling causing him to touch the NPC promptly after he warps. A video here might help. Also, is there any particular reason you are using NPCs to set the level here? If this is some form of an elevator system, don't you think you could integrate it into a grab system you develop? ( onActionGrab() ) |
sounds like a never-ending chain of onPlayerTouchsMe events, although its hard to tell given the lack of script or screenshots the problem could also involve needing to change the players direction
if you script the touch event on Clientside then trigger to Serverside on the npc to handle warping, that should definitely prevent this |
The reason they are NPC's is because they are copyLevel generated floors. It is an automated playerhouse-esque system, and I needed to dynamically set the level to go to next, as regular level links wouldn't work dynamically like that.
NPC Code: Here is a video (disregard floors 1,2 and possibly 3, as they are made in a way that works, but is not the way I want the levels to look like): http://youtu.be/w6vKyZ8Pa_I At around 18-20 seconds I demonstrate how moving slowly, the setlevel2 transition works just fine, but anytime before that, weird things happen, such as some images not loading (due to such immediate level switching, I'm assuming). |
Quote:
I think I'll try something like that. Hopefully the playertouchsme chain won't happen after taking time to chat with the npc server, and add a bit more precision by relying on clientside checking. And I apologize for the initial post having no resources to review. In the middle of a house move and I didn't have internet for a bit. |
On delteria when we generate levels we change the links via script
|
You can change level links via script? How would you go about doing that, if you don't mind me asking? I haven't done much level manipulation via script.
|
Quote:
PHP Code:
TBH I've never really tried editing the links directly like that, but that's the way that I can think of right now. Probably would end up changing it all again |
Quote:
We actually find the links using a identifiable name such as original. All our instance levels are levelname-original.nw. to get the copy_id, we calculate each instance created (Ex: this.copy_counter.(@temp.id) ++;//temp.id would be the instance type) PHP Code:
And what this does is it copys the x and y coordinates of your original level, and renames the copied level as well as the links. |
All times are GMT +2. The time now is 09:35 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.