PDA

View Full Version : Script line limit


sssssssssss
10-15-2013, 02:36 AM
Is there some kind of script line limit or an amount to stay away from?

For my movement it seems I have to update the weapon twice for it to load at all after login for myself. I haven't had a chance to test with anyone else yet...

I've tried weaponorder=-GUIProfiles,-System/Initialize,-System/Movement

but it seems it didnt make a difference...

Even the timeout doesnt show up unless I update the weapon twice after logging in.

callimuc
10-15-2013, 06:34 PM
How many lines does the script have? only thing i realized with long scripts has been that it took them longer to update/load (in rc), nothing on the player itself

fowlplay4
10-15-2013, 09:32 PM
Sounds like laggy servers or your script aint right.

sssssssssss
10-15-2013, 09:45 PM
It's 1092 lines. I've actually noticed my other issue of being invincible:
http://forums.graalonline.com/forums/showthread.php?t=134268833

is linked to this as well, because when I update it to finally show the player chat in the timer, I also finally get hurt... I would think it's lag but thats weird that updating 2 times, no matter how long in between those 2 times, it works.

Also, script was working fine yesterday. I added one thing and just took it out just in case, and it's still happening.

Jakov_the_Jakovasaur
10-15-2013, 09:47 PM
are there any errors showing up when you press f2 and go to scripts?

my guess is that despite what youre doing with the server option weaponorder your movement is attempting to do things before every resource it relies on is initializing

if all else fails try re-adding the movement weapon on login like so:

player.removeweapon("-System/Movement");
player.addweapon("-System/Movement");

sssssssssss
10-15-2013, 09:54 PM
I will try that in just a min but even more odd it seems its just me... Decus char showed the chat in timeout right off the bat. I've already copied my player weapons and flags from him amd I have nothing specifically being done to my char account.

Also when this happened the movement sys wasn't in the server opts weapon order at all.... working just fine until last night.

F2 didn't show any errors for movement but ill check again in a sec.

sssssssssss
10-15-2013, 10:22 PM
And now it all works? Very strange.........

Sorry guys, no idea what happened I didn't change anything to make it work except taking out disablenpchits = false; in the onCreated(). Guess that was messing something up?

cbk1994
10-16-2013, 05:06 PM
It's 1092 lines.

I know this is now slightly off topic, but wanted to mention that 1092 lines is fine. I've gone well into the high thousands in the past. SQL Explorer is about 4000, my support center is close to 8000 in the main script.

(your scripts should definitely not be this large, it is a sign of poorly-organized code—and indeed these are examples of that)

sssssssssss
10-16-2013, 05:48 PM
The movement system not even setting the ganis so the movement system isn't loading at all for me, I've recently noticed. Maybe it's just a single issue for myself since Decus' is working perfectly fine, it's just very strange...

Ok so if the first thing I do is echo "started" in oncreated, then echo "joined classes" after joining classes the very next thing, it gets to started, but that's it. I've commented out each line and tested the classes joined to the weapon, but it didnt make any difference on any of them.

If I update twice it still goes through the entire thing and works. Sometimes just once.

The movement weapon still isn't loading upon login for me whatsoever, unless I update it twice (or once sometimes), only for me, not Decus.

I am completely lost on why this is happening at this point...

sssssssssss
10-16-2013, 10:00 PM
I ended up having to do this at the beginning of the onCreated function:


if (!player.run && player.account == "sssssssssss") {
scheduleevent(3, "Created", null);
}


player.run is set in onCreated. If anyone has a better fix up, or an actual reason or solution let me know, that hack is lame to have to do. :/

Jakov_the_Jakovasaur
10-16-2013, 10:11 PM
why not just call a function to that weapon at the same time player.run is being set in the other weapon script, and only set player.run if the movement weapon object exists, checking every frame?

sssssssssss
10-17-2013, 02:31 AM
player.run is set in the movement script, so I'm not sure what you mean by "at the same time player.run is being set in the other weapon script".

This is all the same weapon with the problem. :/ What's posted works, it's just I shouldn't have to do it at all... if there is a solution that isn't hacky, I'm up for ears, but a better hacky version isn't really in my look.

I don't mean that rude by any means either, and I appreciate the response. I just would rather keep what I put, unless there is an ultimate fix to the server and my player itself, and not some wacky hacky way to make something work that should work automatically, ya know what I mean? :)

Jakov_the_Jakovasaur
10-17-2013, 06:59 AM
unless you show more code this is basically like having to find a needle in a haystack while blindfolded

you did say you were using a clientside player class previously, i remember a problem in the past where classes which were no longer joined to the player clientside were somehow still stuck to the player, it might be worth debugging whatever that class was and if its somehow still doing stuff, try removing it with player.leave("class");

sssssssssss
10-17-2013, 11:32 AM
I can let you on if you have gold by chance like I said before so its not as difficult. I don't think its a class I believe is the movement weapon not loading, being that the ganis to replace in the weapon are not being replaced either and literally nothing in the weapon is loading unless I update twice or use the code I posted that I'm using to force it to keep scheduling an event until it all works (see where i talk about the echoes above). Its not the class. Its the movement weapon not loading.

I also have had classes take a day or two to actually update but I know exactly what class it is and its still being joined to I and decus. Its not the class.

Jakov_the_Jakovasaur
10-17-2013, 05:50 PM
sorry!

as you can see from this thread i am choosing to no longer use gold - http://forums.graalonline.com/forums/showthread.php?t=134268836

i dont see the point in being so secretive though because nobody who has to copy code is ever going to make anything successful with it

sssssssssss
10-17-2013, 07:06 PM
Wow that sucks.

I know what ya mean, but I'd still rather not post it. It's not just someone stealing it that I'm worried about, but also that we have stuff in there we don't want to release that we are doing yet.