Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Scripts not working online. (https://forums.graalonline.com/forums/showthread.php?t=65123)

Link3001 04-01-2006 01:58 PM

Scripts not working online.
 
Hey there!

I have been trying to revive X-Online and I must say that the new engine and everything totally confuses me.

I used to have Grim Squeaker (I bet some remember him) around to do the scripting for me, but he's been gone for ages and now I am on my own.
It's just too bad that I know nothing about scripting (except for some simple, old scripts) and therefore I fail at trying to fix his old scripts.

Now, one of those happen to be lighteffect scripts. They work perfectly offline, but once I try to test them online, they are not even showing me the slightest bit of light.

So what am I doing wrong here? :(

[edit]:

So someone told me to make it Clientside (I had no idea I had to..).

So when should I made something Clientside or serverside?

konidias 04-01-2006 02:44 PM

You should make everything that is important (like saving data or calculating data) serverside. Stuff that should be made clientside is stuff such as lights, which would be the same if they were shown serverside or clientside anyway.

Think about it. If each client is seeing a light clientside, then they are all seeing the light, so it doesn't need to be serverside. Serverside scripting also prevents hackers from easily changing data... Lights are mostly just for show and stuff, so it really doesn't matter what hackers would do to them clientside.

Basically:

Important things that need hack-prevention - serverside
Everything else - clientside

There are a few exceptions... like if you have an npc that moves through levels, then it needs to be serverside, because it's x/y coordinates need to be more global and not tied down to each client.

Link3001 04-01-2006 03:45 PM

I see. That will clear up a lot of errors from X-Online.

Thanks!

*hug*

Bl0nkt 04-01-2006 05:19 PM

Also remember that a lot of GS1 doesn't work on the serverside of a GS2 server.

Skyld 04-01-2006 05:50 PM

Quote:

Originally Posted by Bl0nkt
Also remember that a lot of GS1 doesn't work on the serverside of a GS2 server.

Old gscript is completely functional and compatible on a new engine-enabled server.

Things that don't work on the serverside simply don't work on the serverside, regardless of which language.

Link3001 04-01-2006 06:47 PM

2 Attachment(s)
So, I did some changing in light effects (making them clientside), but suddenly things pop up and are acting like light effects while they have no such scripts!

Suddenly a cloud went transparant and a door became glowing red and resizing itself.

Any idea how this could be happening? I added a screenshot for more information.

lordspawn 04-01-2006 07:11 PM

Usually happens if you update the level with RC or normally i guess, just reconnect, always worked for me.

Link3001 04-01-2006 09:31 PM

Quote:

Originally Posted by lordspawn
Usually happens if you update the level with RC or normally i guess, just reconnect, always worked for me.


I see. Whenever I try to update a level, it updates the entire gmap and warps everyone to one particular level. Is there a way to fix that?

Skyld 04-01-2006 09:42 PM

Quote:

Originally Posted by Link3001
I see. Whenever I try to update a level, it updates the entire gmap and warps everyone to one particular level. Is there a way to fix that?

Yes. Stop updating the entire GMAP.

Nobody on the server should receive an update of the entire GMAP. Ever.

Link3001 04-02-2006 02:04 PM

Maybe I applied the gmap wrongly then. Because no matter what I do, I remain on the gmap, even when I warp to a specific level.

But maybe that is because I am not used to using one (I mean, I first tried to make a bigmap.txt to work and stuff.. go figure. ;)).

Maybe I should just not update the level anymore. :P

KuJi 04-02-2006 04:02 PM

I believe levels automatically update, and if not, just reconnect.

Link3001 04-03-2006 03:29 PM

Hmm. I still have a script that works flawlessly offline, but no matter if I do //#CLIENTSIDE or //#SERVERSIDE, it won't work offline!

I am stunned. I tried all sorts of things. :P

Skyld 04-03-2006 04:54 PM

Quote:

Originally Posted by Link3001
Hmm. I still have a script that works flawlessly offline, but no matter if I do //#CLIENTSIDE or //#SERVERSIDE, it won't work offline!

I am stunned. I tried all sorts of things. :P

There is no such thing as "//#SERVERSIDE".

Here is how the model works.
PHP Code:

function myServersideFunctions()
{
  
// code
}

//#CLIENTSIDE

function myClientsideFunction()
{
  
// code


Everything before the "//#CLIENTSIDE" marker is executed on the serverside. Everything after it is executed on the clientside.


All times are GMT +2. The time now is 09:46 AM.

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