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 02-16-2009, 11:56 PM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
is player.equip(float) the same as setstring clientr.equipped_id,#v(float); ?

Yeah, I don't get MUD functions at all, and asking the wiki just gives me a bunch of old advertisements for Kingdoms. (THANKS! -_-)

Basically, that system NPC I inherited does
PHP Code:
if (clientr.equipped_id != NULLunequipItem(temp.pl);
  
  
temp.item temp.pl.getItem(temp.id);
  
  if (
temp.item[3] == "ammo") {
    return;
  }
  
  
temp.pl.equip(temp.id);
  
  
temp.pl.triggerclient("gui"this.name"equip"); 
Then seems to expect the equip command to cause

PHP Code:
clientr.equipped[3] == "gun"
setshootparams(clientr.equipped[5]); 
etc; it's easy enough to
PHP Code:
    temp.tyid=clientr.equipped_id 0;
    
temp.tokens clientr.(@"item_"@tyid).tokenize(); 
instead, but I don't understand player.equip(float) enough to trust a workaround - should I just be saying, right after player.equip, to tokenize and assign
PHP Code:
clientr.equipped[5]=temp.tokens[5
? (or even tidier),perhaps
PHP Code:
clientr.equipped=clientr.(@"item_"@tyid).tokenize(); 
?)
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #2  
Old 02-17-2009, 12:03 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
The wiki doesn't neccesarily advertise Kingdoms functions. They are built directly into the NPC-Server (hard-coded; it makes it rather hard for Kingdoms staff to change them because Stefan is the only one who can, and then he has to update the NPC-Server).

"player.equip()" is not a built-in function. Can you please post the code for that function?

It's usually best to use player functions whenever possible, by the way. That way, if you ever need to change something, it's easy to. Plus you can make sure that all code is done correctly.
__________________
Reply With Quote
  #3  
Old 02-17-2009, 12:22 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
That's just it - player.equip() doesn't seem to exist Anywhere. It goes "An NPC calls
PHP Code:
      temp.pl findplayerbycommunityname(params[1]);
      
PlayerSystem.equip(temp.plparams[2]); 
;
playersystem has
PHP Code:
public function equipItem(temp.pltemp.id) {
  if (
clientr.equipped_id != NULLunequipItem(temp.pl);
  
  
temp.item temp.pl.getItem(temp.id);
  
  if (
temp.item[3] == "ammo") {
    return;
  }
  
  
temp.pl.equip(temp.id);
  
  
temp.pl.triggerclient("gui"this.name"equip");

and all it seems to do is set clientr.equipped_id - but that might be the Custom Inventory doing that, and maybe player.equip() does nothing at all. I'm trying to talk the server in question's owner into ditching the whole half-baked mess in favor of something I understand, but 1) that's how Classic stagnated, 2) he's never frelling ON, and 3) he's apparently still in a swoon over the concept of having Custom Everything.

Me, I just wanna shoot me some zombies.
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #4  
Old 02-17-2009, 12:29 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I would create a class with an equip function in it, join it to the player, and simply have it call the player system weapon where that function is located; it looks like that is what it's meant to do anyway.
__________________
Reply With Quote
  #5  
Old 02-17-2009, 12:37 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Huh. You can join a class to a player? I wonder if that's what's happening...what does that look like?

Narf, right you are brain, there it is, thanks. :-D

Still, I have no idea where it's Joined; there's a class player_functions that has equip(float), and it calls item_fonctions(sic)'s getItem(float) - which doesn't get called, because somewhere it's disjointed...

Am I just looking for somewhere up the tree, join player_functions; join item_functions; ?

No, apparently item_functions is just Joined automatically somewhere...-_-

At least fixing the name typo fixed a lot of the problems...
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233

Last edited by Tyhm; 02-17-2009 at 01:25 AM..
Reply With Quote
  #6  
Old 02-17-2009, 02:54 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Try player.join("player_functions") when the player logs on (from serverside).
__________________
Reply With Quote
  #7  
Old 02-17-2009, 02:59 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
It must be hiding in one of these weapons...ah well, it's fixed now anyway. :-D
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #8  
Old 02-17-2009, 04:59 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Tyhm View Post
It must be hiding in one of these weapons...ah well, it's fixed now anyway. :-D
/scriptscan all insertnameofclasshere



Also, the equip function etc. remind me an awful lot of the one I scripted and released in the code library.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #9  
Old 02-17-2009, 05:10 PM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
It probably was. Codein made half a system NPC and quit, and the last I heard from Insomnia's manager he insisted I use it rather than throw it out and build something myself. :-P
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
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 11:08 PM.


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