Graal Forums  

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

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-13-2004, 08:25 PM
MegaSizzler MegaSizzler is offline
Registered User
Join Date: Jul 2004
Posts: 26
MegaSizzler is on a distinguished road
Exclamation Door Scripts

Ok. This is an EMERGENCY!Does someone know how to make it when you say a password a door opens and b4 you say the password if you touch it it will say like...Wats the password? And do you know how when you defeat all the baddies a key will appear and you can take it and go through the door? PLEASE HELP ME! If you don't issed: well we can go through that later
  #2  
Old 07-13-2004, 08:58 PM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
This really should be in the scripting forum.
But whatever.

However, I will not give you the whole script.
Rather a psuedocode for it.
Essentially, it is like this.
NPC Code:

if (created) {
Initialize Variables,etc;
}
if (Player says the right thing) {
Set the door to be unlocked;
Or if they say the thing to close
Set the door to locked;
}
if (playertouchsme) {
if (Check if Open) {
Open;
}
if not open
Display message;
}


There.
Something like that, but with real code instead.
I could just give you the script, but you don't learn like that, you'll end up a much better scripter if you experiment and find what works and what doesn't.

Hint: Don't use if (playersays(stuff)) ever!
__________________
  #3  
Old 07-13-2004, 09:08 PM
MegaSizzler MegaSizzler is offline
Registered User
Join Date: Jul 2004
Posts: 26
MegaSizzler is on a distinguished road
I Despise You! I Am Very Bad With Scripts! Please!! I Am Begging! I Don't Know How They Work! Waaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!


And ummm what I wrote there was for 2 scripts... Wheres the other "hint"
  #4  
Old 07-13-2004, 09:12 PM
Damix2 Damix2 is offline
RED SQUARE CLUB
Join Date: Nov 2003
Location: NY-what's better?
Posts: 3,577
Damix2 will become famous soon enough
Quote:
Originally Posted by MegaSizzler
I Despise You! I Am Very Bad With Scripts! Please!! I Am Begging! I Don't Know How They Work! Waaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!


And ummm what I wrote there was for 2 scripts... Wheres the other "hint"

Way to be ungrateful idiot

The scripts you are asking for a preety simple, read the Newbie Scripters bible (link anyone?) even though it is outdated, you should still be able to script those 2 things.

eep
__________________
  #5  
Old 07-13-2004, 09:13 PM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
The other hint?
Don't make a server that needs a script that detects when you kill all the lame baddies in some horribly tiled level to just go to yet another horrible looking room to slay some more baddies until you get to the "Boss" which is really just an npc that uses putexplosion and shoots balls at you.

Sheesh, people these days.
I do you a favor by actually helping you, and yet you just message me on AIM and say you hate me and that I'm mean.
So, stated above, is me being "mean."

In the way I see it, I would be insulting your intelligence to just give you the script.
It'd be like saying "Sorry, but your too incompetent to handle this, so I'll do it for you!"
Sorry for trying to help you, I won't let it happen again.
__________________
  #6  
Old 07-13-2004, 09:13 PM
MegaSizzler MegaSizzler is offline
Registered User
Join Date: Jul 2004
Posts: 26
MegaSizzler is on a distinguished road
yeah but...but... WAAAAA. Listen I am sorry for being ungrateful but I really stink at scripts. I DO NOT UNDERSTAND THEM! IF its such a simple script can't u just give it to me?

I am sorry... I over reacted... . I just can't do scripts. Its the one thing I can't do... I am sorry.

Last edited by MegaSizzler; 07-13-2004 at 09:24 PM..
  #7  
Old 07-13-2004, 09:14 PM
MegaSizzler MegaSizzler is offline
Registered User
Join Date: Jul 2004
Posts: 26
MegaSizzler is on a distinguished road
Angry

Thanks........ A............ Hole.............. Lot..............!


PLEASE JUST TELL ME!
  #8  
Old 07-13-2004, 09:16 PM
Damix2 Damix2 is offline
RED SQUARE CLUB
Join Date: Nov 2003
Location: NY-what's better?
Posts: 3,577
Damix2 will become famous soon enough
Quote:
Originally Posted by MegaSizzler
yeah but...but... WAAAAA. Listen I am sorry for being ungrateful but I really stink at scripts. I DO NOT UNDERSTAND THEM! IF its such a simple script can't u just give it to me?
What would be the point of that? If you don't learn to script yourself you will be here tomorrow asking for more scripts. I doubt you even tried to script these doors.

After you have exhausted ALL methods of trying to do it yourself only then should you ask for help, you can post on the forums (The NPC forums next time) or into the #gscript channel on mIRC, there are people there willing to help you (HELP not do it for you)



eep
__________________
  #9  
Old 07-13-2004, 09:18 PM
MegaSizzler MegaSizzler is offline
Registered User
Join Date: Jul 2004
Posts: 26
MegaSizzler is on a distinguished road
What Does This Have To Do With An Npc!!
  #10  
Old 07-13-2004, 09:19 PM
Damix2 Damix2 is offline
RED SQUARE CLUB
Join Date: Nov 2003
Location: NY-what's better?
Posts: 3,577
Damix2 will become famous soon enough
Quote:
Originally Posted by MegaSizzler
What Does This Have To Do With An Npc!!
Why do you Type Like This?

Don't you understand we are not going to give it to you, I know you are new to the forums but sheeh we only said it like 5 times.

eep
__________________
  #11  
Old 07-13-2004, 09:20 PM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
Read my edited post above.
I pretty much told you why I didn't want to give you the script.

And yes, trial and error is how you learn.
It's how I learned ages ago, and it's how other people should learn.
Through trial and error you'll discover ways that work, ways that don't, and in the process you will expand your knowledge of this scripting language.

Oh, and everything has to do with NPCs.
This is a script that would go in an NPC, and thus, would allow the player to interact with it.

Edit: If your honestly willing to learn, we will teach you.
As the saying goes:
"If you give a man a fish, you feed him for a day. If you teach a man to fish, you feed him for life." (Not sure if that's the actual correct wording, but you get the point, right?)
__________________
  #12  
Old 07-13-2004, 09:21 PM
MegaSizzler MegaSizzler is offline
Registered User
Join Date: Jul 2004
Posts: 26
MegaSizzler is on a distinguished road
Well.....How do I know what to do with da hint? How do I no where its complete and where its not???
  #13  
Old 07-13-2004, 09:22 PM
Damix2 Damix2 is offline
RED SQUARE CLUB
Join Date: Nov 2003
Location: NY-what's better?
Posts: 3,577
Damix2 will become famous soon enough
Quote:
Originally Posted by MegaSizzler
Well.....How do I know what to do with da hint? How do I no where its complete and where its not???

Its fairly obvious.

or

maybe you should just quit trying to make whatever you are trying to make.

eep
__________________
  #14  
Old 07-13-2004, 09:24 PM
MegaSizzler MegaSizzler is offline
Registered User
Join Date: Jul 2004
Posts: 26
MegaSizzler is on a distinguished road
Read my edited script
  #15  
Old 07-13-2004, 09:26 PM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
Well, I'll give you the some commands you need to do the script.
It's up to you to find out how to use them.
Comments behind a // are not read by the script, so you can put info in there.
NPC Code:

if (created) //When the NPC is first made.

if (playertouchsme) //When the player touches the NPC

if (playerchats) { //The Player Says Something
if (strequals(#c,TheWordToOpenTheDoor) //The player says a specific thing/
if (strequals(#c,TheWordToCloseTheDoor) //Ditto
}

__________________
  #16  
Old 07-13-2004, 09:29 PM
MegaSizzler MegaSizzler is offline
Registered User
Join Date: Jul 2004
Posts: 26
MegaSizzler is on a distinguished road
Ok. Thanks. I still don't understand anything. But what was that thing one of you said about a Newbie Bible Creating thingie?
  #17  
Old 07-13-2004, 09:32 PM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
The Newbie Scripter Bible.
It is a tutorial on Graal's scripting language.
Do a search on the forum and you should be able to find a link.
In the meantime, there is a file in your main graal folder called npcprogramming or something. That should come in handy and should be able to teach you some basic commands.
__________________
  #18  
Old 07-13-2004, 09:34 PM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
Get the hell out of my house *punts to scripting*

You kids get to deal with this now.
  #19  
Old 07-13-2004, 09:35 PM
Damix2 Damix2 is offline
RED SQUARE CLUB
Join Date: Nov 2003
Location: NY-what's better?
Posts: 3,577
Damix2 will become famous soon enough
Quote:
Originally Posted by haunter
Get the hell out of my house *punts to scripting*

You kids get to deal with this now.

You should have locked it first =D they won't like it here *peers around*
__________________
  #20  
Old 07-13-2004, 09:38 PM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
While your here, MegaSizzler, take a gander at the coding standards set forth by the great Kaimetsu.
__________________
  #21  
Old 07-13-2004, 09:39 PM
MegaSizzler MegaSizzler is offline
Registered User
Join Date: Jul 2004
Posts: 26
MegaSizzler is on a distinguished road
Info for what? No one can read the scripts while playing the game..
  #22  
Old 07-13-2004, 09:40 PM
Damix2 Damix2 is offline
RED SQUARE CLUB
Join Date: Nov 2003
Location: NY-what's better?
Posts: 3,577
Damix2 will become famous soon enough
Quote:
Originally Posted by MegaSizzler
Info for what? No one can read the scripts while playing the game..

Try using the quote button so we know who in bloody hell you are talking to!

eep
__________________
  #23  
Old 07-13-2004, 09:41 PM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
Nonono.
I didn't mean read by the player.
The NPC won't read that part, and thus won't think it's a command.
Those // are for putting comments in the script like
Ex:
this.speed=2 //Change this number to increase or decrease speed.

See, they are for other scripters so that they can understand your script, and help you fix any bugs in it, etc, with less hassle.

Edit:
/* and */ Work to block of a large section of code. Like in the following example:
NPC Code:
/* Hello and welcome to my script!
It may be buggy, but atleast it is well commented!
*/



I think this may be going over you head, so please do read Kaimetsu's Coding Standards and read through your npcprogramming file.
__________________
  #24  
Old 07-13-2004, 09:43 PM
MegaSizzler MegaSizzler is offline
Registered User
Join Date: Jul 2004
Posts: 26
MegaSizzler is on a distinguished road
ohhhhhhhhh. Thanks!
  #25  
Old 07-13-2004, 09:44 PM
Damix2 Damix2 is offline
RED SQUARE CLUB
Join Date: Nov 2003
Location: NY-what's better?
Posts: 3,577
Damix2 will become famous soon enough
Quote:
Originally Posted by MegaSizzler
ohhhhhhhhh. Thanks!

I'm suprised you have enough sense to follow the thread here but not be able to do this script
__________________
  #26  
Old 07-13-2004, 09:58 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
No more thread!
Closed Thread


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 01:53 AM.


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