Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-06-2003, 11:52 PM
GrowlZ1010 GrowlZ1010 is offline
defunct
Join Date: May 2002
Posts: 187
GrowlZ1010 is on a distinguished road
Command for class NPCs: "rename"

NPC Code:

rename newname;



Since classes can be accessed with the getnpc statement and their cryptic NPCServer internal code number - usually looking something like localnpc_growlzblank_14777372_0 - shouldn't it be possible to rename them to something coherent? For example, giving a NPC a serial number:

NPC Code:

rename Sign #v(this.serial);



You could then do with (getnpc(Sign 2210)) instead of having to use something obscure like localnpc_signtest_33712039_4. This way, scripts could write their serial number to a string list on a DB NPC (no more having class NPCs somebody else laid but that you can't locate), and the database could even send them information about other class NPCs.
Reply With Quote
  #2  
Old 06-06-2003, 11:56 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Class NPCs? Using getnpc to get classes? Wha? Classes are just chunks of code, they can't exist independently.
__________________
Reply With Quote
  #3  
Old 06-06-2003, 11:59 PM
GrowlZ1010 GrowlZ1010 is offline
defunct
Join Date: May 2002
Posts: 187
GrowlZ1010 is on a distinguished road
Quote:
Originally posted by Kaimetsu
Class NPCs? Using getnpc to get classes? Wha? Classes are just chunks of code, they can't exist independently.
I should probably have clarified that I meant NPCs created by joining a class.
Reply With Quote
  #4  
Old 06-07-2003, 12:07 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Are you talking about those created via putnpc2?
__________________
Reply With Quote
  #5  
Old 06-07-2003, 12:12 AM
GrowlZ1010 GrowlZ1010 is offline
defunct
Join Date: May 2002
Posts: 187
GrowlZ1010 is on a distinguished road
Quote:
Originally posted by Kaimetsu
Are you talking about those created via putnpc2?
Yup.

A NPC created with putnpc2 is stored with a long and complicated internal ID string as pointed out in my first post. I'm suggesting a way to change that string to something sensible, like a serial number to call the NPC by.

For example, here's a weapon script that gets one of my Drone NPCs (created with putnpc2) - temporary NPCs that can be used to block rooms etc. and have unique ID numbers - and gives it new text; however, at the moment, there's no way of getting the NPC's ID string without using the NPC-Control, and to get its string with that requires you to know where it is!

NPC Code:

if (actionserverside){
setstring this.reply,Couldn't find the NPC;
with (getnpc(localnpc_growlzblank_14777372_0)){
setstring this.msg,ZIYEHOY!;
setstring thiso.reply,Gottum, sir!;
}
setplayerprop #c,(#s(this.reply));
}
//#CLIENTSIDE
if (weaponfired) triggeraction 0,0,serverside,TempTest;

Reply With Quote
  #6  
Old 06-07-2003, 12:33 AM
TripleE TripleE is offline
Down with GK Corruption
Join Date: Jun 2003
Posts: 1,005
TripleE is on a distinguished road
Quote:
Originally posted by GrowlZ1010
Yup.

A NPC created with putnpc2 is stored with a long and complicated internal ID string as pointed out in my first post. I'm suggesting a way to change that string to something sensible, like a serial number to call the NPC by.

For example, here's a weapon script that gets one of my Drone NPCs (created with putnpc2) - temporary NPCs that can be used to block rooms etc. and have unique ID numbers - and gives it new text; however, at the moment, there's no way of getting the NPC's ID string without using the NPC-Control, and to get its string with that requires you to know where it is!

NPC Code:

if (actionserverside){
setstring this.reply,Couldn't find the NPC;
with (getnpc(localnpc_growlzblank_14777372_0)){
setstring this.msg,ZIYEHOY!;
setstring thiso.reply,Gottum, sir!;
}
setplayerprop #c,(#s(this.reply));
}
//#CLIENTSIDE
if (weaponfired) triggeraction 0,0,serverside,TempTest;

That's pretty clever to think up. I guess it would also be easier to find stuff,because you wouldnt need to remember all those serial sting numbers. Nice Growlz
Reply With Quote
  #7  
Old 06-07-2003, 03:25 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by GrowlZ1010
Yup.

A NPC created with putnpc2 is stored with a long and complicated internal ID string as pointed out in my first post. I'm suggesting a way to change that string to something sensible, like a serial number to call the NPC by.

For example, here's a weapon script that gets one of my Drone NPCs (created with putnpc2) - temporary NPCs that can be used to block rooms etc. and have unique ID numbers - and gives it new text; however, at the moment, there's no way of getting the NPC's ID string without using the NPC-Control, and to get its string with that requires you to know where it is!

NPC Code:

if (actionserverside){
setstring this.reply,Couldn't find the NPC;
with (getnpc(localnpc_growlzblank_14777372_0)){
setstring this.msg,ZIYEHOY!;
setstring thiso.reply,Gottum, sir!;
}
setplayerprop #c,(#s(this.reply));
}
//#CLIENTSIDE
if (weaponfired) triggeraction 0,0,serverside,TempTest;

with (getnpc(localnpc_growlzblank_14777372_0))

you can actually do that? o_O never knew
and stefan said he is going to make a way to convert putnpc2 npcs to DB NPCs (on the npc list) and a way to rename them when I asked him about this a week ago, need to remind him to do it
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:07 AM.


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