Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-02-2007, 12:47 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Running Scripts from Text Files

I was thinking, is there a way to run a script from a text file? Like having the script in a text file, then loading the text file into a class then joining the class?

Or something similar to that?
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #2  
Old 04-02-2007, 12:58 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
As far as I know, the classes are text files.
Reply With Quote
  #3  
Old 04-02-2007, 01:11 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
I mean like uploading:

blahscript.txt

The create a weapon, "-Test".

Then using loadlines and it will read everything in the text file and run it in the "-Test" NPC.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #4  
Old 04-02-2007, 01:24 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Would need eval().
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #5  
Old 04-02-2007, 03:42 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
all weapons/Classes/DB are .txt files
__________________
Deep into the Darkness peering...
Reply With Quote
  #6  
Old 04-02-2007, 04:13 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by Angel_Light View Post
all weapons/Classes/DB are .txt files
Not what I mean,


I mean having a text file, like,

"test.txt" in levels.

Then in a script named: "-TestScript"

Load the text from the .txt file and run everything in the text file as a script in the "-TestScript" weapon.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #7  
Old 04-02-2007, 04:17 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Isn't putnpc's 2nd param the name of a text file which contains the script for that NPC?

Though it will only work for level NPCs.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #8  
Old 04-02-2007, 05:52 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by JkWhoSaysNi View Post
Isn't putnpc's 2nd param the name of a text file which contains the script for that NPC?

Though it will only work for level NPCs.
And you could use a TStaticVar to create a static reference to the object, but it would be a lot of hassle.
__________________
Reply With Quote
  #9  
Old 04-02-2007, 06:00 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Yeah, but I mean as far as a Databased and everything, it would be nice to have them all aptly named text files, like:

"Pointandclick.txt" containing a script for the movement system.

Then open a weapon named, "-Movement".

As a command name, something like, "runtextasscript("textfilename")".

It would read all the contents of the text file and run the contents as script using the "-Movement" Weapon NPC.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #10  
Old 04-02-2007, 06:13 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Question answered in future improvements. Nevermind.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #11  
Old 04-02-2007, 06:27 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
If you're not using the default Graal Q Menu then don't name your weapons with anything but letter characters and numbers in them. That way you can reference the object name without funky stuff.
__________________
Reply With Quote
  #12  
Old 04-02-2007, 08:56 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Inverness View Post
And you could use a TStaticVar to create a static reference to the object, but it would be a lot of hassle.
Dangit, Inver. Avatar had me confused for a good 2 seconds or so.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #13  
Old 04-02-2007, 09:01 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by killerogue View Post
Yeah, but I mean as far as a Databased and everything, it would be nice to have them all aptly named text files, like:

"Pointandclick.txt" containing a script for the movement system.

Then open a weapon named, "-Movement".

As a command name, something like, "runtextasscript("textfilename")".

It would read all the contents of the text file and run the contents as script using the "-Movement" Weapon NPC.
I don't really see the point of that though. It's basically replacing text files with more text files. -Movement will work just fine containing the script for the movement system. Plus, if you don't like seeing weapon scripts getting too big, you can always use classes.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #14  
Old 04-02-2007, 08:48 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Hotrian made a GUI Window editor, in which when you save a Gui Control, it saves as a weapon text file. I still don't know how he made that Gui editor x.x
Reply With Quote
  #15  
Old 04-02-2007, 10:29 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Invern >:O Thought you were Yen XD Oh wait are you trying to save a file then load it later?
__________________
Deep into the Darkness peering...
Reply With Quote
  #16  
Old 04-03-2007, 12:03 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Rapidwolve View Post
Hotrian made a GUI Window editor, in which when you save a Gui Control, it saves as a weapon text file. I still don't know how he made that Gui editor x.x
Probably a damn big script . Stefan released a gui maker as well as did Novo.
Reply With Quote
  #17  
Old 04-03-2007, 12:06 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 Twinny View Post
Probably a damn big script . Stefan released a gui maker as well as did Novo.
I think I posted an improved version of Stefan's GUI editor a while ago.
__________________
Skyld
Reply With Quote
  #18  
Old 04-03-2007, 12:17 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
GS2 GUIs have got to be the easiest to handle. If people need a GUI Editor for GS2 GUIs, I can just imagine how they managed in GS1, when they had to make everything custom x-x
Reply With Quote
  #19  
Old 04-03-2007, 12:20 AM
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
A new improved version of the Gui Editor is in the making, will be added to the scripted RC once done.
Reply With Quote
  #20  
Old 04-03-2007, 03:19 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
add that to your list stefan for stuff in production
__________________
Deep into the Darkness peering...
Reply With Quote
  #21  
Old 04-04-2007, 04:54 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by napo_p2p View Post
Dangit, Inver. Avatar had me confused for a good 2 seconds or so.
I thought I was Yen when I first posted with this. Did the double-take and everything.
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 12:22 PM.


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