Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   setlevel2 / onPlayerEnters issue (https://forums.graalonline.com/forums/showthread.php?t=84063)

xXziroXx 02-06-2009 10:33 PM

setlevel2 / onPlayerEnters issue
 
If you use setlevel2 to change a players level, and the player is already located in that level, all timeouts in attached ganis (obj.attr[#] = "gani" etc.) completely halt, and you're unable to reinitialize them since onPlayerEnters() will not be triggered by the warp (clientside nor serverside).

I worked around it by only changing x/y if the player is already in the destination level, but I find it to be a short term solution to a long term issue. Is there anything else I can use to reinitialize the timeout in the gani script?

LoneAngelIbesu 02-06-2009 10:59 PM

Call onPlayerEnters() manually?

xXziroXx 02-06-2009 11:14 PM

Quote:

Originally Posted by LoneAngelIbesu (Post 1463649)
Call onPlayerEnters() manually?

And just how do you propose I call the onPlayerEnters() function inside the attached gani from an external script? onPlayerEnters() isn't triggered serversided, clientsided, or clientsided in gani scripts automatically when you warp a player to the same level he's already in. I shouldn't have to work around it either way.

Crow 02-07-2009 12:11 AM

Check for the level before warping. If the player is already in the same level, just change their x and y...?

LoneAngelIbesu 02-07-2009 12:43 AM

Quote:

Originally Posted by xXziroXx (Post 1463652)
I shouldn't have to work around it either way.

Nobody ever should have to do anything that inconveniences them. What exactly is the problem with using your work-around?

Chompy 02-07-2009 12:50 AM

Quote:

Originally Posted by Crow (Post 1463673)
Check for the level before warping. If the player is already in the same level, just change their x and y...?

You can redefine the setlevel2 function to do this (Do this in a player joined class for example). :]

xXziroXx 02-07-2009 02:05 PM

Quote:

Originally Posted by Crow (Post 1463673)
Check for the level before warping. If the player is already in the same level, just change their x and y...?

Read my first post. :whatever:

Quote:

Originally Posted by LoneAngelIbesu (Post 1463696)
Nobody ever should have to do anything that inconveniences them. What exactly is the problem with using your work-around?

Quote:

Originally Posted by Chompy (Post 1463698)
You can redefine the setlevel2 function to do this (Do this in a player joined class for example). :]

Yeah sure, let's fix everything on our own instead of bringing it to Stefan's attention so he can fix it instead. Geez guys, show some more enthusiasm, this is obviously something that should be looked into since it's affecting the onPlayerEnters() triggers in the engine.

Crow 02-07-2009 02:17 PM

Quote:

Originally Posted by xXziroXx (Post 1463888)
Read my first post. :whatever:

Yeah sure, let's fix everything on our own instead of bringing it to Stefan's attention so he can fix it instead. Geez guys, show some more enthusiasm, this is obviously something that should be looked into since it's affecting the onPlayerEnters() triggers in the engine.

Ow, well. You know this won't be fixed within the next two years, though. Guess you gotta live with that workaround.

xXziroXx 02-07-2009 02:31 PM

Quote:

Originally Posted by Crow (Post 1463891)
Ow, well. You know this won't be fixed within the next two years, though. Guess you gotta live with that workaround.

With that attitude it sure as hell wont. Damn, if you feel this way about Graal, just leave already, it's not like you're improving things with that attitude.

Crow 02-07-2009 02:38 PM

Quote:

Originally Posted by xXziroXx (Post 1463893)
With that attitude it sure as hell wont. Damn, if you feel this way about Graal, just leave already, it's not like you're improving things with that attitude.

Won't improve things with any other attitude anyway, I've already learned that over the years.

xXziroXx 02-07-2009 02:42 PM

Quote:

Originally Posted by Crow (Post 1463894)
Won't improve things with any other attitude anyway, I've already learned that over the years.

Talk about lack of faith... x_x

LoneAngelIbesu 02-07-2009 08:45 PM

Quote:

Originally Posted by xXziroXx (Post 1463888)
Yeah sure, let's fix everything on our own instead of bringing it to Stefan's attention so he can fix it instead. Geez guys, show some more enthusiasm, this is obviously something that should be looked into since it's affecting the onPlayerEnters() triggers in the engine.

Not to be argumentative, but the function name speaks for itself: it's called when a player enters a level, not when they move around in one.

If an engine doesn't do something exactly how you want it to, it's your job to find a way around that. Expecting the engine to be updated for your specific needs is fruitless.

xXziroXx 02-07-2009 08:52 PM

Quote:

Originally Posted by LoneAngelIbesu (Post 1463996)
Not to be argumentative, but the function name speaks for itself: it's called when a player enters a level, not when they move around in one.

If an engine doesn't do something exactly how you want it to, it's your job to find a way around that. Expecting the engine to be updated for your specific needs is fruitless.

That would be fine and all, if it weren't killing all attached ganis timeouts, which classifies it as a bug.

LoneAngelIbesu 02-07-2009 10:30 PM

Quote:

Originally Posted by xXziroXx (Post 1464000)
That would be fine and all, if it weren't killing all attached ganis timeouts, which classifies it as a bug.

Barely. But, fine. You win.

Admins 02-13-2009 07:38 PM

I've not experienced this problem set, does it also happen with the trading card effects and pets?

xXziroXx 02-13-2009 07:44 PM

Quote:

Originally Posted by Stefan (Post 1466110)
I've not experienced this problem set, does it also happen with the trading card effects and pets?

I would debug it, but I don't have any cards at all, and buying them just to debug this sounds a bit too excessive even for me.


All times are GMT +2. The time now is 04:38 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.