![]() |
Setting variables when a player enters a level
Alright.. I have a ladder NPC.
When the player enters the level, I want each ladder to tell the player where it is. A system handles climbing, based on this information. When the player enters the level, it adds the ladder's ID to one array (ladders) and it adds the ladder's area to another array (ladder#). When the player enters, the system clears the ladders, so old ladder placements aren't carried into the level. However, the ladder ID array is randomly being erased. I'm guessing it's by the clearing of ladders when the player enters. I tried making it set the ladder ID array after .5 seconds, but it still doesn't work. The ladders array just randomly clears itself; if I update the level or relog, it works. However, like I said, after a while it clears itself for no reason. Any ideas? |
Try using a level. variable so you don't have to clear it when they enter a new level?
|
Quote:
|
Yeah, it doesn't work at all as level.
|
Try making the ladders NPCs, and then having the system detect the NPCs.
ex. ladder PHP Code:
|
To access level. variables clientside, you have to set them clientside.
This would probably be your best method of doing this, something like: PHP Code:
|
Quote:
I can't really make the system detect them, because the player could be on a gmap with 1000s of NPCs. You know how laggy that is. :P |
Quote:
findareanpcs(x,y,w,h) returns an array of npc objects on x,y,w,h. Therefore you don't have to cycle through thousands of NPCs. He's been talking about doing a findareaplayers function, that will also be quite helpful. |
Do you know if PlayerEnters is called when the player enters a new section of the gmap?
|
I generally treat the gmap as if it were one level, though I'm sure it does in some senses, just not trustworthy senses.
|
Quote:
|
Quote:
|
Quote:
The clientside does not see the GMAP as one giant level, like the serverside does. Therefore, function onPlayerEnters() will be called clientside as you enter each level in the GMAP, not on every level as you enter the GMAP. |
Quote:
|
Quote:
Ganis will fix it, though! YAY GANI! |
Quote:
|
| All times are GMT +2. The time now is 12:31 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.