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
  #81  
Old 03-15-2010, 05:08 AM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
Quote:
Originally Posted by jkldogg View Post
Thank you all for your concern. I will now begin learning to script, I found a good guide. I hope I can be as good as you guys one day. I look up to: Chris Vimes, Switch, and salesman. I view them as good scripters. (Sorry Jerret, i've never seen you script.)

http://www.gs2.graalstudios.com/index.php?page=basic
To answer your question directly, add enablefeatures(allfeatures - 4); to your Inventory script.

To expand upon what they said, the post I wrote containing the bitflags + enablefeatures function should have been enough for you to figure it out on your own if you were to look up bitflags on Google.
Reply With Quote
  #82  
Old 03-16-2010, 12:38 AM
jkldogg jkldogg is offline
J.Rollin (killaz)
jkldogg's Avatar
Join Date: Feb 2010
Location: USA
Posts: 675
jkldogg can only hope to improve
Send a message via AIM to jkldogg Send a message via MSN to jkldogg
scripting is so hard
__________________

PSN: jkldogg



The best post ever made on the graal forums.
After playing Graal Online for many years, JKL decides to make a forum account. Isn't life funny?
Reply With Quote
  #83  
Old 03-16-2010, 01:20 AM
Imperialistic Imperialistic is offline
graal player lord
Imperialistic's Avatar
Join Date: Apr 2007
Location: Florida
Posts: 1,094
Imperialistic is a jewel in the roughImperialistic is a jewel in the rough
Jerret is a great scripter, and very helpful to others willing to learn. I have alot of respect for him and Chris Vimes.
__________________
" It's been swell, but the swelling's gone down. "
Reply With Quote
  #84  
Old 04-02-2010, 05:05 AM
jkldogg jkldogg is offline
J.Rollin (killaz)
jkldogg's Avatar
Join Date: Feb 2010
Location: USA
Posts: 675
jkldogg can only hope to improve
Send a message via AIM to jkldogg Send a message via MSN to jkldogg
Spar

tried to make a spar, help from cody

Where's the problem?

PHP Code:
function onPlayerChats() {
  if (
player.chat==":in") {
    if (
clientr.inspar==false) {
      if (
serverr.sparp<2) {
        
clientr.inspar true;
        
serverr.sparp += 1;
        
player.chat "";
        
setlevel2 vega_spar.nw,32.25,21.5);
      }else
          
player.chat "Therearepeopletheinsparalready";
    }else
        
player.chat "";
  }elseif (
player.chat=="ut") {
    if (
clientr.inspar==true) {
      
serverr.sparp -= 1;
      
clientr.inspar false;
      
player.chat "";
      
setlevel2 vega_spar.nw,8.5,46);
    }else
        
player.chat "";
  }

__________________

PSN: jkldogg



The best post ever made on the graal forums.
After playing Graal Online for many years, JKL decides to make a forum account. Isn't life funny?
Reply With Quote
  #85  
Old 04-02-2010, 12:20 PM
Imperialistic Imperialistic is offline
graal player lord
Imperialistic's Avatar
Join Date: Apr 2007
Location: Florida
Posts: 1,094
Imperialistic is a jewel in the roughImperialistic is a jewel in the rough
First off, you should really format your script better.
Try reading this:
http://forums.graalonline.com/forums...ad.php?t=61805
__________________
" It's been swell, but the swelling's gone down. "
Reply With Quote
  #86  
Old 04-02-2010, 03:40 PM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Quote:
Originally Posted by jkldogg View Post
tried to make a spar, help from cody

Where's the problem?
It'd help if you told us how it isn't working.

Not sure if this will fix it, but try formatting the setlevel2 lines like this:
PHP Code:
setlevel2("vega_spar.nw",32.25,21.5); 
It would have been valid GS1, but you had a ) without a matching (.
Reply With Quote
  #87  
Old 04-02-2010, 04:53 PM
Liberated Liberated is offline
not doing alot
Liberated's Avatar
Join Date: Feb 2008
Posts: 1,366
Liberated has a spectacular aura about
Quote:
Originally Posted by DrakilorP2P View Post
It'd help if you told us how it isn't working.

Not sure if this will fix it, but try formatting the setlevel2 lines like this:
PHP Code:
setlevel2("vega_spar.nw",32.25,21.5); 
It would have been valid GS1, but you had a ) without a matching (.
Yeah, this is what the RC fixer also told me.

For the rest the script doesn't seem quite finished yet.
What happeneds if you die, from what i understand your server will be a modern one, and i'd asume you'd be warped to a hospital or a base of somesort.
But the script doesn't give any solution for this.
I'd suggest running a timeout that checks if the player is still within the spar room.

so something like
PHP Code:
function onTimeOut()
{
  if(
player.level != "vega_spar.nw")
  {
    
clientr.inspar false;
    
serverr.sparp -= 1;
  }
  else if(
player.<= this.edgex)
  {
    
clientr.inspar false;
    
serverr.sparp -= 1;
  }
  else if(
player.<= this.edgey)
  {
    
clientr.inspar false;
    
serverr.sparp -= 1;
  }
  else
  {
    
setTimer(.05);
  }

i know this probably isn't the most efficient script, or if it's even working, i typed it in here. But it should show what i mean.
__________________
Quote:
Originally Posted by Tigairius View Post
I promise when I get rich I'll send you an iPhone. I'll send everyone an iPhone.
Reply With Quote
  #88  
Old 04-02-2010, 08:59 PM
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
Quote:
Originally Posted by Liberated View Post
if(player.level.name != "vega_spar.nw")
And you really wouldn't need or want a timeout for that.
__________________
Reply With Quote
  #89  
Old 04-03-2010, 06:22 AM
jkldogg jkldogg is offline
J.Rollin (killaz)
jkldogg's Avatar
Join Date: Feb 2010
Location: USA
Posts: 675
jkldogg can only hope to improve
Send a message via AIM to jkldogg Send a message via MSN to jkldogg
The problem is when i say ":in" it doesn't warp you in.
__________________

PSN: jkldogg



The best post ever made on the graal forums.
After playing Graal Online for many years, JKL decides to make a forum account. Isn't life funny?
Reply With Quote
  #90  
Old 04-03-2010, 08:03 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 jkldogg View Post
The problem is when i say ":in" it doesn't warp you in.
Did you update the script any? If you followed Drakilor's tip to fix it should be fine.
__________________
Quote:
Reply With Quote
  #91  
Old 04-03-2010, 09:57 AM
jkldogg jkldogg is offline
J.Rollin (killaz)
jkldogg's Avatar
Join Date: Feb 2010
Location: USA
Posts: 675
jkldogg can only hope to improve
Send a message via AIM to jkldogg Send a message via MSN to jkldogg
Quote:
Originally Posted by DrakilorP2P View Post
It'd help if you told us how it isn't working.

Not sure if this will fix it, but try formatting the setlevel2 lines like this:
PHP Code:
setlevel2("vega_spar.nw",32.25,21.5); 
It would have been valid GS1, but you had a ) without a matching (.
Quote:
Originally Posted by fowlplay4 View Post
Did you update the script any? If you followed Drakilor's tip to fix it should be fine.
Yes, i fixed the set levels and went in game and said :in and it didn't work.

Graal Editor gave me this error when I clicked Test

PHP Code:
ErrorExpected format setlevel2 string,real,real
__________________

PSN: jkldogg



The best post ever made on the graal forums.
After playing Graal Online for many years, JKL decides to make a forum account. Isn't life funny?
Reply With Quote
  #92  
Old 04-03-2010, 10:02 AM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by jkldogg View Post
Yes, i fixed the set levels and went in game and said :in and it didn't work.

Graal Editor gave me this error when I clicked Test

PHP Code:
ErrorExpected format setlevel2 string,real,real
Could you post your updated script?
Reply With Quote
  #93  
Old 04-03-2010, 10:13 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by jkldogg View Post
Graal Editor
You have to test this online. GS2 doesn't work offline.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #94  
Old 04-03-2010, 10:43 AM
jkldogg jkldogg is offline
J.Rollin (killaz)
jkldogg's Avatar
Join Date: Feb 2010
Location: USA
Posts: 675
jkldogg can only hope to improve
Send a message via AIM to jkldogg Send a message via MSN to jkldogg
Codein

PHP Code:
function onPlayerChats() {
  if (
player.chat==":in") {
    if (
clientr.inspar==false) {
      if (
serverr.sparp<2) {
        
clientr.inspar true;
        
serverr.sparp += 1;
        
player.chat "";
        
setlevel2("vega_spar.nw",32.25,21.5);
      }else
          
player.chat "Therearepeopletheinsparalready";
    }else
        
player.chat "";
  }elseif (
player.chat=="ut") {
    if (
clientr.inspar==true) {
      
serverr.sparp -= 1;
      
clientr.inspar false;
      
player.chat "";
      
setlevel2("vega_spar.nw",32.25,21.5);
    }else
        
player.chat "";
  }


Switch How, a weapon?
__________________

PSN: jkldogg



The best post ever made on the graal forums.
After playing Graal Online for many years, JKL decides to make a forum account. Isn't life funny?
Reply With Quote
  #95  
Old 04-03-2010, 10:55 AM
FaLLChiLD FaLLChiLD is offline
fcmrcy
Join Date: Nov 2004
Posts: 258
FaLLChiLD has a spectacular aura aboutFaLLChiLD has a spectacular aura about
Send a message via AIM to FaLLChiLD
Sorry...but this thread is blowing my f*#&ing mind, lol!
Reply With Quote
  #96  
Old 04-03-2010, 12:26 PM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Quote:
Originally Posted by jkldogg View Post
Switch How, a weapon?
You can just put it in an NPC in the level.
Reply With Quote
  #97  
Old 04-03-2010, 01:04 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by jkldogg View Post
Switch How, a weapon?
A level NPC would be best, like Drakilor said. Also, if this is going right in the same level that the spar area is in, you might as well use player.x and player.y instead of setlevel2(), since that may be easier to read.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #98  
Old 04-03-2010, 04:54 PM
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
I believe it might be related due to the lack of the player prefix, or conflict with local systems.

Try this level script:

PHP Code:
function onPlayerChats() {
  if (
player.chat == "testwarp") {
    
player.setlevel2("onlinestartlocal.nw"3030);
    
player.chat "Warped!";
  }

__________________
Quote:
Reply With Quote
  #99  
Old 04-04-2010, 03:35 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by fowlplay4 View Post
I believe it might be related due to the lack of the player prefix, or conflict with local systems.
Since the player triggers the onPlayerChat() event, you don't need to use the player prefix, at least I haven't had to, though it is good practice to do so.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #100  
Old 04-04-2010, 07:38 AM
jkldogg jkldogg is offline
J.Rollin (killaz)
jkldogg's Avatar
Join Date: Feb 2010
Location: USA
Posts: 675
jkldogg can only hope to improve
Send a message via AIM to jkldogg Send a message via MSN to jkldogg
Quote:
Originally Posted by fowlplay4 View Post
I believe it might be related due to the lack of the player prefix, or conflict with local systems.

Try this level script:

PHP Code:
function onPlayerChats() {
  if (
player.chat == "testwarp") {
    
player.setlevel2("onlinestartlocal.nw"3030);
    
player.chat "Warped!";
  }

This Worked, but i'm scrapping that spar system that i made, it sucks.
__________________

PSN: jkldogg



The best post ever made on the graal forums.
After playing Graal Online for many years, JKL decides to make a forum account. Isn't life funny?
Reply With Quote
  #101  
Old 04-04-2010, 12:15 PM
Liberated Liberated is offline
not doing alot
Liberated's Avatar
Join Date: Feb 2008
Posts: 1,366
Liberated has a spectacular aura about
Quote:
Originally Posted by cbk1994 View Post
And you really wouldn't need or want a timeout for that.
No? Then in what way can you constantly check if the player is still in the level?

edit:
Ah im assuming you mean onPlayerLeaves()?
__________________
Quote:
Originally Posted by Tigairius View Post
I promise when I get rich I'll send you an iPhone. I'll send everyone an iPhone.
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:45 PM.


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