Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Door Scripts (https://forums.graalonline.com/forums/showthread.php?t=53745)

MegaSizzler 07-13-2004 08:25 PM

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 :pissed: well we can go through that later :D

Silver Knight 07-13-2004 08:58 PM

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!

MegaSizzler 07-13-2004 09:08 PM

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"

Damix2 07-13-2004 09:12 PM

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

Silver Knight 07-13-2004 09:13 PM

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.

MegaSizzler 07-13-2004 09:13 PM

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.

MegaSizzler 07-13-2004 09:14 PM

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


PLEASE JUST TELL ME!

Damix2 07-13-2004 09:16 PM

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

MegaSizzler 07-13-2004 09:18 PM

What Does This Have To Do With An Npc!!

Damix2 07-13-2004 09:19 PM

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

Silver Knight 07-13-2004 09:20 PM

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?)

MegaSizzler 07-13-2004 09:21 PM

Well.....How do I know what to do with da hint? How do I no where its complete and where its not???

Damix2 07-13-2004 09:22 PM

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

MegaSizzler 07-13-2004 09:24 PM

Read my edited script

Silver Knight 07-13-2004 09:26 PM

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
}


MegaSizzler 07-13-2004 09:29 PM

Ok. Thanks. I still don't understand anything. But what was that thing one of you said about a Newbie Bible Creating thingie?

Silver Knight 07-13-2004 09:32 PM

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.

haunter 07-13-2004 09:34 PM

Get the hell out of my house *punts to scripting*

You kids get to deal with this now.

Damix2 07-13-2004 09:35 PM

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*

Silver Knight 07-13-2004 09:38 PM

While your here, MegaSizzler, take a gander at the coding standards set forth by the great Kaimetsu.

MegaSizzler 07-13-2004 09:39 PM

Info for what? No one can read the scripts while playing the game..

Damix2 07-13-2004 09:40 PM

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

Silver Knight 07-13-2004 09:41 PM

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.

MegaSizzler 07-13-2004 09:43 PM

ohhhhhhhhh. Thanks!

Damix2 07-13-2004 09:44 PM

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

Loriel 07-13-2004 09:58 PM

No more thread!


All times are GMT +2. The time now is 02:24 AM.

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