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 10-06-2010, 08:16 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
/reset npc NAME

It would be nice if you could reset DbNPC's via script

with a NPC.reset();

or if you could do

sendToRc( "/reset npc" @ NPC);
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #2  
Old 10-06-2010, 08:25 PM
cbkbud cbkbud is offline
Chris Vimes' Brother
cbkbud's Avatar
Join Date: Aug 2008
Posts: 5
cbkbud is on a distinguished road
Why?
__________________
Reply With Quote
  #3  
Old 10-06-2010, 08:44 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
I have certain scripting needs...
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #4  
Old 10-06-2010, 08:58 PM
cbkbud cbkbud is offline
Chris Vimes' Brother
cbkbud's Avatar
Join Date: Aug 2008
Posts: 5
cbkbud is on a distinguished road
Quote:
Originally Posted by MrOmega View Post
I have certain scripting needs...
Explain. You're probably doing it wrong if you require this.
__________________
Reply With Quote
  #5  
Old 10-06-2010, 09:05 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
I'm using an NPC as a main plot point for my server. It goes to another room and some vars change. Both client and server sides. My current work around is a lot parts of the script setting all the vars back to what they were when I created the NPC, (warpto() and all that) it just be a lot easier if I could just reset the NPC via script. This is more so for convenience.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #6  
Old 10-06-2010, 09:37 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
when you're doing a levelnpc in a DBNPC for easier testing, you often have to reset it because of clientside scripting to make the function "onCreated" to be called, therefor, i agree with this idea.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #7  
Old 10-06-2010, 09:53 PM
cbkbud cbkbud is offline
Chris Vimes' Brother
cbkbud's Avatar
Join Date: Aug 2008
Posts: 5
cbkbud is on a distinguished road
Quote:
Originally Posted by MrOmega View Post
I'm using an NPC as a main plot point for my server. It goes to another room and some vars change. Both client and server sides. My current work around is a lot parts of the script setting all the vars back to what they were when I created the NPC, (warpto() and all that) it just be a lot easier if I could just reset the NPC via script. This is more so for convenience.
You should just set variables in an init function.
__________________
Reply With Quote
  #8  
Old 10-06-2010, 11:50 PM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Yeah but the convenience of .reset() seems more practical.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #9  
Old 10-07-2010, 12:46 AM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
You can store all your variables in a new object..

Like this.state = new TStaticVar();

Then declare all the variables as such:

this.state.health = 10;

Then when you need to clear all the variables, you can do:

this.state = null;

and then simply initialize it again.
Reply With Quote
  #10  
Old 10-07-2010, 01:29 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by MrOmega View Post
Yeah but the convenience of .reset() seems more practical.
And also entirely destructive :monocle: Just save your important variables in an easy-to-destroy TStaticVar, or find a way to do what you are doing without constantly having to reset it.
__________________
Skyld
Reply With Quote
  #11  
Old 10-07-2010, 03:07 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Quote:
Originally Posted by Skyld View Post
And also entirely destructive :monocle: Just save your important variables in an easy-to-destroy TStaticVar, or find a way to do what you are doing without constantly having to reset it.
That's what I'm currently doing. I'd just like a command to do it via script.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #12  
Old 10-07-2010, 03:29 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by MrOmega View Post
That's what I'm currently doing. I'd just like a command to do it via script.
make a utlity class, and join it to the npc, now all the npcs you want to have the reset function will have it.
__________________
Quote:
Reply With Quote
  #13  
Old 10-07-2010, 03:58 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
Quote:
Originally Posted by fowlplay4 View Post
make a utlity class, and join it to the npc, now all the npcs you want to have the reset function will have it.
How would thaty reseting a NPC like when reseting via RC?
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
Reply With Quote
  #14  
Old 10-07-2010, 04:05 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
onRCChat()
in the Control-NPC then you can do /npc reset whatever
Reply With Quote
  #15  
Old 10-07-2010, 05:51 AM
MrOmega MrOmega is offline
One More Time
MrOmega's Avatar
Join Date: Aug 2010
Location: TN, USA
Posts: 631
MrOmega is an unknown quantity at this point
Send a message via AIM to MrOmega Send a message via MSN to MrOmega Send a message via Yahoo to MrOmega
O_o I have to try this tomorrow, never heard of it.
__________________
Time is the fire in which we burn...
Up, Up, Down, Down, Left, Right, Left, Right, B, A, Select, Start! Now I got 99 LIVES!!!
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 06:56 PM.


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