Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-17-2005, 04:35 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Exclamation serverside keyname() problem

#k(float) seems to be working fine serverside in this class (after it adds a kart to the player, it tells them which keys they should press to accelerate/brake):

NPC Code:
  say2("
You now control a kart!

Press #k(5) to accelerate

and #k(4) to brake");



works. It properly displays which keys are set (traditionally) to S and D.

However, when I try to convert it to use keyname(float):

NPC Code:
  say2("
You now control a kart!

Press" SPC keyname(5) SPC "to accelerate

and" SPC keyname(4) SPC "to brake");
}



it returns 0 now and causes this error:

Quote:
GraalScript: Function keyname not found at line 15 of karthouses in script of npcs[302] (in level worldr-08.nw at pos (41, 52))
Any suggestions? Is there something I'm missing?
Reply With Quote
  #2  
Old 12-17-2005, 07:02 AM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
at least you see what i mean, its errors like these that cause me to mix gs1 and gs2. As we all know, gs2 is still under development. Mostly, but not completely functional. I look forward to when gs2 works fully they way the wiki says its supposed to work.
To whoever is the one person writing the wiki, good work so far. If many people are writing the wiki, how do you know what to put in there? What is your resource and credentials to add to the gs2 parts of the wiki?
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #3  
Old 12-17-2005, 08:33 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by prozac424242
at least you see what i mean, its errors like these that cause me to mix gs1 and gs2. As we all know, gs2 is still under development. Mostly, but not completely functional. I look forward to when gs2 works fully they way the wiki says its supposed to work.
To whoever is the one person writing the wiki, good work so far. If many people are writing the wiki, how do you know what to put in there? What is your resource and credentials to add to the gs2 parts of the wiki?
I'm not sure why you're posting that in this topic, but many people edit the wiki (you can too).
Reply With Quote
  #4  
Old 12-17-2005, 05:07 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
The new scripting engine is fully working, we are already using it on Graal Kingdoms, Zone, Era and Classic. I am helping for the wiki too.
About keyname(): it is a clientside-function, I have no idea why #k is working for you on serverside (and should not work since they keys are different for each client, otherwise we wouldn't need that function). The normal way is to save the keyname on clientside into some client. variable and then use that client. variable on serverside.
About say2: it is better to use the format() function, the code looks much more readable then, like format("Press %s to jump!", client.Akey)
Reply With Quote
  #5  
Old 12-18-2005, 06:28 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Stefan
The new scripting engine is fully working, we are already using it on Graal Kingdoms, Zone, Era and Classic. I am helping for the wiki too.
About keyname(): it is a clientside-function, I have no idea why #k is working for you on serverside (and should not work since they keys are different for each client, otherwise we wouldn't need that function). The normal way is to save the keyname on clientside into some client. variable and then use that client. variable on serverside.
About say2: it is better to use the format() function, the code looks much more readable then, like format("Press %s to jump!", client.Akey)
I think Lance is saying that #k() serverside returns the default keys, if that is the case, why use #k() serverside at all?

Also, that format() function brings back some fond C-memories
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #6  
Old 12-20-2005, 03:27 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Well we figured out the problem - in old scripting engine the #k thing is ignored on serverside, and if you pass it to the client with say2 then the client is filling the key name in once it displays the sign text.
In new scripting engine the server needs to compile the script, but doesn't provide the keyname functionality itself. So it only works in clientside scripts or if you just pass the text to the clientside (by using the new scripting version of say2 with say2("blabla #k")).
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:02 AM.


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