Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-17-2007, 06:48 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Question Boat ride...

Im making a boat system, but my script wont work can someone help me out:
PHP Code:
// NPC made by Join my guild Elite Mafia!
//#CLIENTSIDE
if (created) {
time 10;
}
if (
playerenters) {
time 10;
timeout .1;
}
if (
timeout) {
time -= 1;
timeout 2;
}
if (
time <=0) {
message T.T;
setlevel2 graallegacy_h04.nw,11,31;
scheduleevent(1,"Sailing","idle");
}
function 
onSailing() {
setlevel2 graallegacy_h04.nw,11,31;

i got the "scheduleevent(1,"Sailing","idle");" out of the "GBaddy" script (just to let you know...)
__________________
**FLIP OUT**
Reply With Quote
  #2  
Old 04-17-2007, 07:25 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
*sigh*

You shouldn't take bits and pieces out of other scripts. Because nine times out of ten if you're ripping lines you have no clue what it does and you think it will work because you've looked it up on the wiki.

I say, WTF are you doing? I don't even script GS1 but I still know enough to know none of that makes any sense.

To have a boat travel a certain pathway requires, I would say, math of a medium intelligence level.
__________________


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
  #3  
Old 04-17-2007, 08:24 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
If this is done on a server, setlevel2() won't work clientside, only serverside. If this is done offline, scheduleevent() won't work since it isn't available for GS1.
Reply With Quote
  #4  
Old 04-17-2007, 04:00 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by theHAWKER View Post
Im making a boat system, but my script wont work can someone help me out:
PHP Code:
// NPC made by Join my guild Elite Mafia!
//#CLIENTSIDE
if (created) {
time 10;
}
if (
playerenters) {
time 10;
timeout .1;
}
if (
timeout) {
time -= 1;
timeout 2;
}
if (
time <=0) {
message T.T;
setlevel2 graallegacy_h04.nw,11,31;
scheduleevent(1,"Sailing","idle");
}
function 
onSailing() {
setlevel2 graallegacy_h04.nw,11,31;

i got the "scheduleevent(1,"Sailing","idle");" out of the "GBaddy" script (just to let you know...)
The schedule event in this situation seems very unneccessary, since you are warping at the end of sailing already..

You have a conditional outside of an event, which may be the reason its not triggering. if (time <= 0) is not an event, it is a conditional. nothing triggers that logic when it happens, so its a toss up to the engine if it gets called or not.

PHP Code:
//#CLIENTSIDE
if (created) { // This EVENT happens when the npc is created
  
time 10;
}

if (
playerenters) { // This EVENT happens when the player enters.
  
time 10;
  
timeout .1;
}

if (
timeout) { // This EVENT happens when timeout reaches 0
  
time -= 1;
  if (
time <=0) { // This CONDITIONAL doesn't have anything trigger it
                 // so you have to test it inside an event, for example, timeout
    
message T.T;
    
setlevel2 graallegacy_h04.nw,11,31;
  }
  
timeout 2;

__________________
Reply With Quote
  #5  
Old 04-17-2007, 04:31 PM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
That script you sent kristi wont work
your script dosen't do anything...
So i changed it up, but it only says "T.T"
PHP Code:
// NPC made by Join my guild Elite Mafia!
//#CLIENTSIDE
if (created) {
  
time 10;
}

if (
playerenters) {
  
time 10;
  
timeout .1;
}

if (
timeout) {
  
time -= 1;
  
timeout .1;
  if (
time <= 0) {
set sailing;
  }
}
if (
sailing) {
    
message T.T;
    
setlevel2 graallegacy_h04.nw,11,31;

__________________
**FLIP OUT**
Reply With Quote
  #6  
Old 04-17-2007, 04:50 PM
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
Maybe try explaining what you want this to do? Because I think you're really making this more complicated than it needs to be, if I'm assuming right about what you're doing.
Reply With Quote
  #7  
Old 04-17-2007, 06:26 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
Hawker, are you trying the script ONLINE or OFFLINE?
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #8  
Old 04-17-2007, 07:08 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by theHAWKER View Post
That script you sent kristi wont work
your script dosen't do anything...
So i changed it up, but it only says "T.T"
PHP Code:
// NPC made by Join my guild Elite Mafia!
//#CLIENTSIDE
if (created) {
  
time 10;
}

if (
playerenters) {
  
time 10;
  
timeout .1;
}

if (
timeout) {
  
time -= 1;
  
timeout .1;
  if (
time <= 0) {
set sailing;
  }
}
if (
sailing) {
    
message T.T;
    
setlevel2 graallegacy_h04.nw,11,31;

sailing isnt an event, its a conditional, the way i did it was correct.

it doesnt work because youre probably doing it online, setlevel2 doesnt work clientside online.
__________________
Reply With Quote
  #9  
Old 04-17-2007, 08:08 PM
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 theHAWKER View Post
That script you sent kristi wont work
your script dosen't do anything...
So i changed it up, but it only says "T.T"
Dude, some general words of wisdom from a friend, Learn how to script first before you start trying to script everything complicated. Not a word for word quote as I forgot the exact words. But, meh, get's the point across.

All of GS1 is basically deprecated, how do you find:

setstring this.stuff,#c(blah)

easier than,

this.stuff = "blah";

I just don't get it....
__________________


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-17-2007, 09:05 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by killerogue View Post
Dude, some general words of wisdom from a friend, Learn how to script first before you start trying to script everything complicated. Not a word for word quote as I forgot the exact words. But, meh, get's the point across.

All of GS1 is basically deprecated, how do you find:

setstring this.stuff,#c(blah)

easier than,

this.stuff = "blah";

I just don't get it....
setstring this.stuff,#c(blah)?

That's basically doing this in GS2:
this.stuff = players[blah].chat;

Perhaps you just mean to write:
setstring this.stuff,blah;
__________________
Do it with a DON!
Reply With Quote
  #11  
Old 04-18-2007, 04:15 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Quote:
Originally Posted by xXziroXx View Post
Hawker, are you trying the script ONLINE or OFFLINE?
Im Doing this on a server.

Quote:
Originally Posted by DustyPorViva View Post
Maybe try explaining what you want this to do? Because I think you're really making this more complicated than it needs to be, if I'm assuming right about what you're doing.
So basicly: i have a level on the gmap where you have to win a ticket to enter, then you go in this boat(which is in a normal "nw" file) when you wait for 20 sconds or so untill you arive at your destionation, which is another level on the gmap.
__________________
**FLIP OUT**
Reply With Quote
  #12  
Old 04-18-2007, 04:57 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
So why not do it simple and do something like...
NPC Code:
if (playerenters) timeout=20;
if (timeout) setlevel2 blahblah.nw,x,y;


EDIT: don't forget, you might want to warp them to the gmap instead(if that's where you're warping them) and thus, you need to find the gmap coordinates. Also, setlevel2 is serverside, not clientside.
Reply With Quote
  #13  
Old 04-18-2007, 05:31 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
None of thies scripts work >
ive figured out that you cant have timeouts/sleeps in the same script that has "setlevel"
would there be another way to pause a script for a couple seconds?
__________________
**FLIP OUT**
Reply With Quote
  #14  
Old 04-18-2007, 05:33 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
If you're doing this online it's going to get confusing (as only GS1 is).

But I'm pretty sure some triggeractions and clientsides are involved here.
__________________


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
  #15  
Old 04-18-2007, 05:48 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
If it's online, then you should probably have a setlevel script added into your database NPC, and triggeraction 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 02:17 PM.


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