Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-30-2007, 04:19 AM
colin012 colin012 is offline
That never happened...
colin012's Avatar
Join Date: Feb 2006
Location: Under your bed.....
Posts: 321
colin012 is on a distinguished road
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;
}

__________________
Dude! It's a skirt...
Quote:
Originally Posted by Elizabeth View Post
Good lord it looks potent...
Reply With Quote
  #2  
Old 03-30-2007, 04:22 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Uhh, are you developing this off line or online?
PS: this is in the wrong forum =o
Reply With Quote
  #3  
Old 03-30-2007, 04:25 AM
colin012 colin012 is offline
That never happened...
colin012's Avatar
Join Date: Feb 2006
Location: Under your bed.....
Posts: 321
colin012 is on a distinguished road
Quote:
Originally Posted by Rapidwolve View Post
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.
__________________
Dude! It's a skirt...
Quote:
Originally Posted by Elizabeth View Post
Good lord it looks potent...
Reply With Quote
  #4  
Old 03-30-2007, 04: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
AFABHSGJBOGSBGDSGSD


THIS IS THE GS2. TWO. TWO Forums.

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


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
  #5  
Old 03-30-2007, 04:27 AM
colin012 colin012 is offline
That never happened...
colin012's Avatar
Join Date: Feb 2006
Location: Under your bed.....
Posts: 321
colin012 is on a distinguished road
Quote:
Originally Posted by killerogue View Post
AFABHSGJBOGSBGDSGSD


THIS IS THE GS2. TWO. TWO Forums.

What's with everyone doing GS1? It's so inneficient.
I don't know these things! How do you tell?
__________________
Dude! It's a skirt...
Quote:
Originally Posted by Elizabeth View Post
Good lord it looks potent...
Reply With Quote
  #6  
Old 03-30-2007, 04:29 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
Quote:
Originally Posted by killerogue View Post
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.
__________________


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
  #7  
Old 03-30-2007, 04:32 AM
kia345 kia345 is offline
z0rbi 4 life 🤘
kia345's Avatar
Join Date: Dec 2006
Location: delteria
Posts: 6,737
kia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond repute
Quote:
Originally Posted by killerogue View Post
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)
__________________
pojo
Reply With Quote
  #8  
Old 03-30-2007, 04:32 AM
colin012 colin012 is offline
That never happened...
colin012's Avatar
Join Date: Feb 2006
Location: Under your bed.....
Posts: 321
colin012 is on a distinguished road
Quote:
Originally Posted by killerogue View Post
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
__________________
Dude! It's a skirt...
Quote:
Originally Posted by Elizabeth View Post
Good lord it looks potent...
Reply With Quote
  #9  
Old 03-30-2007, 04:42 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
Quote:
Originally Posted by colin012 View Post
It's not a weapon though. It's the fourth sword right after lizerd
>.>


player.swordimg = "Blah";

I think that's the correct syntaxing.
__________________


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 03-31-2007, 02:34 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
GS2 doesn't work offline.
__________________
Reply With Quote
  #11  
Old 03-31-2007, 06:54 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 cbkbud View Post
GS2 doesn't work offline.
I DEFINITELY DID NOT KNOW THAT!
__________________


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
  #12  
Old 03-31-2007, 09:51 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by colin012 View Post
Offline
I assume he needs GS1? Or has someone hacked an NPC-Server to work offline? Didnt think so.
__________________
Reply With Quote
  #13  
Old 03-31-2007, 10:11 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
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.
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 11:56 PM.


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