Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Help making a chest like npc. (https://forums.graalonline.com/forums/showthread.php?t=73162)

colin012 03-30-2007 04:19 AM

Help making a chest like npc.
 
I can't seem to figure out how to make my npc function like a chest that gives you the gold sword. this is what I'v come up with so far:


NPC Code:
// NPC made by Pants
if (created) {
setimg goldchest.png;
}

//#CLIENTSIDE
if (playertouchsme) {
lay goldensword;
setimg goldchest_open.png;
destroy;
}




Thanks for your help I'm very new to this.


I also have it glowing so I want to make it stop glowing when It gives up the gold sword. Heres the script for the glow:

NPC Code:
// NPC made by Stefan Knorr
if (created) {
setimg light2.png;
dontblock;
}
//#CLIENTSIDE
if (playerenters) {
setcoloreffect 1,1,,0.25;
drawaslight;
}


Rapidwolve 03-30-2007 04:22 AM

Uhh, are you developing this off line or online?
PS: this is in the wrong forum =o

colin012 03-30-2007 04:25 AM

Quote:

Originally Posted by Rapidwolve (Post 1294473)
Uhh, are you developing this off line or online?
PS: this is in the wrong forum =o


Offline and what do you mean wrong fourm? I'm prety sure this is the gs2.

killerogue 03-30-2007 04:25 AM

AFABHSGJBOGSBGDSGSD


THIS IS THE GS2. TWO. TWO Forums.

What's with everyone doing GS1? It's so inneficient. :(

colin012 03-30-2007 04:27 AM

Quote:

Originally Posted by killerogue (Post 1294475)
AFABHSGJBOGSBGDSGSD


THIS IS THE GS2. TWO. TWO Forums.

What's with everyone doing GS1? It's so inneficient. :(

:cry: I don't know these things! How do you tell?

killerogue 03-30-2007 04:29 AM

Quote:

Originally Posted by killerogue (Post 1294475)
AFABHSGJBOGSBGDSGSD


THIS IS THE GS2. TWO. TWO Forums.

What's with everyone doing GS1? It's so inneficient. :(

PHP Code:

function onCreated() {

setimg"whateverimage.png" );
setshape1,32,32 );
seteffect0,0,0,);
drawaslight();
}

//#CLIENTSIDE

function onPlayerTouchesMe() {

showani("openaniblah");
addweapon("whatever weaponyyouwanttoadd");



E: You should take the time to read the wiki. You can learn alot of things and it shows you differences between GS1 and GS2. Also, GS2 you cannot use offline. You can only use Gs1 in the editor thanks. :] -> http://wiki.graal.net and http://wiki.graal.us for your use in learning. God speed.

kia345 03-30-2007 04:32 AM

Quote:

Originally Posted by killerogue (Post 1294475)
AFABHSGJBOGSBGDSGSD
What's with everyone doing GS1? It's so inneficient. :(

people dont want to change. i got into scripting, learned basic gs1, and refuse to learn gs2.

it may be 'innefficient' but scripting is like languages, english (or others) is your first, you struggle abit with your second (gs1) and you dont give a damn about your 3rd (gs2)

colin012 03-30-2007 04:32 AM

Quote:

Originally Posted by killerogue (Post 1294478)
PHP Code:

function onCreated() {

setimg"whateverimage.png" );
setshape1,32,32 );
seteffect0,0,0,);
drawaslight();
}

//#CLIENTSIDE

function onPlayerTouchesMe() {

showani("openaniblah");
addweapon("whatever weaponyyouwanttoadd");



E: You should take the time to read the wiki. You can learn alot of things and it shows you differences between GS1 and GS2. Also, GS2 you cannot use offline. You can only use Gs1 in the editor thanks. :] -> http://wiki.graal.net and http://wiki.graal.us for your use in learning. God speed.


It's not a weapon though. It's the fourth sword right after lizerd

killerogue 03-30-2007 04:42 AM

Quote:

Originally Posted by colin012 (Post 1294480)
It's not a weapon though. It's the fourth sword right after lizerd

>.>


player.swordimg = "Blah";

I think that's the correct syntaxing.

cbk1994 03-31-2007 02:34 PM

GS2 doesn't work offline.

killerogue 03-31-2007 06:54 PM

Quote:

Originally Posted by cbkbud (Post 1294948)
GS2 doesn't work offline.

I DEFINITELY DID NOT KNOW THAT!

cbk1994 03-31-2007 09:51 PM

Quote:

Originally Posted by colin012 (Post 1294474)
Offline

I assume he needs GS1? Or has someone hacked an NPC-Server to work offline? Didnt think so.

DustyPorViva 03-31-2007 10:11 PM

Gani's and parameters :)
Make a gani of a closed chest.
Make a gani of the chest opening with the item raising out of it, and the item being set by a parameter and make this gani setbackto the opened chest gani.
Make a gani of the opened chest.
And as far as gs1/2 goes... you posted in the gs2 forums but posted a gs1 script.
For setting the sword power there's a command for it,
PHP Code:

setsword sword4.png,4

I think that's it.

As for the chest code itself... in GS1 with gani's it'd be something like:
PHP Code:

//CLIENTSIDE
if (created||playerenters) {
  
setstring this.chest,chest_#L-#v(x)-#v(y);
  
if (strcontains(#s(this.chest),#s(client.openedchests))) setcharani chest_opened,;
  
else setcharani chest_closed,;
  
setstring this.itemimg,sword4icon.png;
}
if (
playertouchsme && !strcontains(#s(this.chest),#s(client.openedchests))) {
  
if (int(playerx+.5)==&& int(playery-1)==y) {
    
setcharani chest_open,#s(this.itemimg);
    
setsword sword4.png,4;
    
addstring client.openedchests,chest_#L-#v(x)-#v(y);
  
}


I don't know gs2 and I can't help with the serverside stuff, but that should be enough to help you in the general direction.


All times are GMT +2. The time now is 10:13 AM.

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