Graal Forums

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

bobp 07-28-2002 06:41 AM

NPC Scripting
 
I wanna learn how to script but I have no idea where to start. Could someone please tell me or help me out?

Python523 07-28-2002 06:50 AM

read the commands.rtf to learn the basic syntax's

Chaos0838 07-28-2002 08:21 AM

[Vlad]

Well start with if (playertouchesme) and (playerenters) flags and experiment with commands to see what they do.

Torankusu 07-28-2002 08:47 AM

Quote:

Originally posted by Chaos0838
[Vlad]

Well start with if (playertouchesme) and (playerenters) flags and experiment with commands to see what they do.

it's playertouchsme.

magicbud3344 07-28-2002 12:59 PM

i know like the basics if someone helps me a bit, like i can move stuff/slide and i can make it so you can sit on things XD none of that is hard but it is what i can do XD XD and i can make light2.png work 4 me XD

Poogle 07-29-2002 10:07 AM

Quote:

Originally posted by Torankusu
it's playertouchsme.
playertouchesme worked for me on my lapytop this morning.

Torankusu 07-29-2002 10:19 AM

Quote:

Originally posted by Poogle
playertouchesme worked for me on my lapytop this morning.
Obviously you didn't try touching it.

Try this script.
NPC Code:

// NPC made by Stefan Knorr
if (created) {
setimg door.png;
setshape 1,32,32;
}
if (playertouchesme) {
hide;
sleep 3;
show;
}


And play in the level, and touch it.
Nothing happens.

adam 07-29-2002 12:14 PM

find and read the Newbie Scripters Bible.

screen_name 07-29-2002 08:23 PM

how i started was the npcprogramming.doc that comes with graal, although outdated, it is a good beginner's guide

stomper_TK 08-02-2002 12:54 PM

NPC Code:
// NPC made by Stefan Knorr
if (created) {
setimg door.png;
setshape 1,32,32;
}
if (playertouchesme) {
hide;
sleep 3;
show;
}



Why did you put in "setshape 1,32,32" is that for serverside or sothing? Teach me..

Python523 08-02-2002 01:08 PM

because the npc server keeps no record of the shapes (blocking, etc) of NPCs

stomper_TK 08-02-2002 01:14 PM

Quote:

Originally posted by Python523
because the npc server keeps no record of the shapes (blocking, etc) of NPCs
How can one find out the shape of the object?

stomper_TK 08-02-2002 05:32 PM

Lets say I want to make a NPC that sells cans, but there is a limited supply of 30. Would I out this in the GScript?

NPC Code:
while (flag&&count<30)


adam 08-02-2002 07:16 PM

Quote:

Originally posted by stomper_TK
Lets say I want to make a NPC that sells cans, but there is a limited supply of 30. Would I out this in the GScript?

NPC Code:
while (flag&&count<30)





Suggestions: server.string or save[0]-save[9]


I think both would work.

stomper_TK 08-02-2002 08:02 PM

Lets say I go aquire a flag to open a door that needs a certin flag named "sam" to enter the door. Would this script work for the door?

NPC Code:
if (playertouchsme&&sam){hidelocal;sleep3;show
}



All times are GMT +2. The time now is 06:59 AM.

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