PDA

View Full Version : New npcserver version (5th Update)


Admins
04-02-2005, 08:12 PM
A new npcserver has been uploaded which uses new optimized onwall check and uses the "dummy" npcs for that too (npcs that don't have scripts or only clientside stuff, which were not blocking on serverside before). If possible restart both npcserver and gserver because they also use more precise player positions now (more smooth movement of other players).

In the new scripting engine you can also use setshape2 now. The weapons have been fixed:

Variables and functions for handling the weapon scripts:

player.weapons[] - array of objects
player.findweapon("name") - object
player.weapon - object, current weapon, clientside only
findweaponnpc("name") - object, find 'global' weapon object, serverside only

Automatic mappings for compatibility:

weaponscount -> player.weapons.size()
findweapon("name") -> player.findweapon("name")
hasweapon(name) -> (player.findweapon("name")!=NULL)
#w -> player.weapon.name (clientside only)
#w(index) -> player.weapons[index].name
#W -> player.weapon.image (clientside only)
#W(index) -> player.weapons[index].image


Update:
New stuff for new scripting engine:
- fixed the problem of local npc syntax errors being displayed on RC chat, they are all put into syntaxerrors.txt now
- variables like this.pi or this.switch are working now and dont give errors anymore (pi, switch etc. are reserved words and were not allowed inside variable names before)

Update2:
- optimized saving of npcs, it is not called anymore if not needed, so it's speeding up the npcserver start and taking less cpu time
- if the script exceeds the loop limit of 10000 (e.g. in a for-loop) or is not finding a function then it is displaying the script line (serverside only)
- the number of active npcs is correctly displayed

Update3:
- if you have a variable that is 0 then strlen will return 0. Example:
this.myvar = 0; setplayerprop #c,length: strlen(#s(this.myvar));
This should help for better compatibility, since in the new engine it is meant to be 0==false=="". If you do this.myvar = "0"; then it will display the length 1 like it should be (since it is a string then).
- player.join("classname") is working now, so you can let the player join a class (onCreated() will be invoked the first time it joins a class) and call scripting functions like player.additem("testitem") if you have defined a public function additem() in the joined class. Example:
Control-NPC:

function onActionPlayerOnline() {
player.join("testclass");
player.dosomething();
player.trigger("attack",123);
}

testclass:

function onCreated() {
echo("oncreated for " @ player.account);
}
public function dosomething() {
echo("dosomething for " @ player.account);
}
function onAttack(val) {
echo("onAttack for " @ player.account @ " - " @ val);
}


Remarks:
- obj.trigger(event,parameters) is a replacement for "callnpc" in the new scripting engine
- in the above code you actually don't need to do "player.account", you can also directly access the account name or other attributes of the player without using the "player." in front because the script is run for the player, so you could do echo("new player: " @ account)

Update4:
- number-to-string conversion modified again to fix problems with the update3: when outputing zero it is correctly displaying "0", but when an empty string is received from the client it is not longer converted to "0"

Update5:
- tiletype(x,y) and levelobject.tiletype(x,y) return the tile type for the giving position, works with both old and new tileset and also npcs that use setshape2. Set the newtilesets=true option in the server options if you are using the new tileset format, or list the levels that use new tilesets with newtilesetlevels=...,.. On clientside only tiletype(x,y) for new tilesets is working, except you are using the latest version of v4, then you have the same functionality like on serverside.
- findlevel(name) returns the level object for the specified level name. Gmaps are one big level, so don't use the name of map part levels with this.
- levelobject.tiles[x,y] works now (instead of just tiles[x,y] from the current level)

Rick
04-02-2005, 08:50 PM
Yay! ;)

[edit]
The admin panel isn't letting me stop the gserver... :\

falco10291029
04-02-2005, 11:13 PM
I cant get on my admin panel because of ip....

Gambet
04-02-2005, 11:49 PM
Very nice update :).

Fry
04-02-2005, 11:52 PM
Looks good, these findweapon things could become useful.

Now if I'd just have VIP >:(

Admins
04-04-2005, 04:35 PM
I will also restart the servers later this week, just need to make sure there are no big problems with the new version of the npcserver.

Spark910
04-04-2005, 04:43 PM
I will also restart the servers later this week, just need to make sure there are no big problems with the new version of the npcserver.
There appears to be issues, frequent crashes. I logged 2 in GK Serveroptions for you, but there were 2-3 more that I didn't handle.

coreys
04-04-2005, 05:01 PM
There appears to be issues, frequent crashes. I logged 2 in GK Serveroptions for you, but there were 2-3 more that I didn't handle.

=O
What are all the issue's, are the frequent crashes the only thing?

Gambet
04-04-2005, 05:34 PM
There appears to be issues, frequent crashes. I logged 2 in GK Serveroptions for you, but there were 2-3 more that I didn't handle.


Also, all the Zone problems that it caused were really annoying.

Admins
04-04-2005, 08:18 PM
Graal Kingdoms is not using new server versions,
and on Zone it was not related to the new npcserver (problem with the playermovement script and a problem with the battlecontrol npc timeout stopping)

Gambet
04-04-2005, 09:06 PM
and on Zone it was not related to the new npcserver (problem with the playermovement script and a problem with the battlecontrol npc timeout stopping)


But things were working fine before the new update on the npc server.

Lance
04-05-2005, 09:39 AM
But things were working fine before the new update on the npc server.

post hoc ergo propter hoc etc

Admins
04-07-2005, 11:01 PM
The battleground control npc was stopping two times because it exceeded the loop limit (10000 iterations), when I get time I will try to fix the scripts. May be too many explosions at once or so.

p2p_Sir_Link
04-08-2005, 01:16 AM
All I know, is that after the update, my server is extremly laggy.

Admins
04-08-2005, 02:31 PM
All I know, is that after the update, my server is extremly laggy.

Which server?

Malinko
04-08-2005, 02:36 PM
Seems good to me.

Admins
04-11-2005, 04:49 PM
Added script line display if a script exceeds the loop limit, also speeded up the npcserver (see the first post to see the updates)

p2p_Sir_Link
04-12-2005, 02:09 AM
Which server?
Kalypso.

Admins
04-18-2005, 04:42 PM
New update for strlen() and player.join, read the first post for more information

Bartjuh1992
04-18-2005, 06:29 PM
Nice :)

contiga
04-18-2005, 06:45 PM
When will you make a script document with all the Gs2 commands? And will we be able to use Gs2 offline too?

Fry
04-18-2005, 06:51 PM
When will you make a script document with all the Gs2 commands? And will we be able to use Gs2 offline too?

There is a documentation in the Graal Wiki, if you want (http://ilfirin.org/graal/GScript).

Ajira
04-18-2005, 10:09 PM
New update for strlen() and player.join
I love you for this. ^_^

Admins
04-22-2005, 04:15 AM
When will you make a script document with all the Gs2 commands? And will we be able to use Gs2 offline too?

There will not be new scripting for offline mode, with the editor you can only do old scripting (which will still work in new engine but with limited functionality of course). But it is planned that there will be an online editor with built-in script editor (it can do syntaxhightlighting, already used on Graal3D servers).

TheJames
05-06-2005, 05:53 PM
Yay! ;)
The admin panel isn't letting me stop the gserver... :\

I cant get on my admin panel because of ip....


Same things here. I can't get on because of my IP. No one's fixed it. Also the Buttons on Admin Panel arn't working correctly.

Admins
05-06-2005, 09:59 PM
Same things here. I can't get on because of my IP. No one's fixed it. Also the Buttons on Admin Panel arn't working correctly.

Yes the buttons make problems, but the admin panel should work of your Admin-Playerworld account is working. Also most of the classic servers can be restarted now using the admin panel.

Matt
05-10-2005, 06:21 PM
Same things here. I can't get on because of my IP. No one's fixed it. Also the Buttons on Admin Panel arn't working correctly.

Some buttons aren't supposed to work for the Owners. Only the Graal Administration. Such as the accounts access in ADCP. If you need your IP fixed on your Playerworld ADCP set up a support ticket. An Administrator will read and fix your problem as soon as they can.It would be best to refer here:

http://forums.graalonline.com/forums/showthread.php?t=56199

hottstuff911
05-30-2005, 08:01 AM
Any globel nat or higher like STEFAN (my friend :D) can you teach me how to use gs2 because i work on a server that uses gs2 and most of my scripts dont work because it so i want to learn gs2 PLEASE.

KuJi
05-30-2005, 05:22 PM
I have a gscript2 question:

Gscript2 only works serverside ( for v2 )?

And:

Does it work in npcs that are serverside? (Local Npcs)

protagonist
05-30-2005, 05:41 PM
post hoc ergo propter hoc etc
Vos tendo narro English?

Ajira
05-30-2005, 06:14 PM
I have a gscript2 question:

Gscript2 only works serverside ( for v2 )?

And:

Does it work in npcs that are serverside? (Local Npcs)
Yes.