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 09-30-2006, 11:46 PM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Cool my door broke X.x

PHP Code:
// NPC made by theHAWKER
if (created) {
blockagain;
}
if (
compsdead) {
  
hide;
  
dontblock;
  
show;

its so simple but it wont work... anyone know how to fix this? ^.^
__________________
**FLIP OUT**
Reply With Quote
  #2  
Old 10-01-2006, 02:28 AM
Luigi203 Luigi203 is offline
Hamma Time
Luigi203's Avatar
Join Date: Mar 2003
Location: North East PA
Posts: 285
Luigi203 is on a distinguished road
Send a message via AIM to Luigi203
Besides the fact that compsdead is a flag, and just putting if (compsdead) with no event will do nothing, but in the same instant that the npc hides, it just reappears again. Try using the sleep command, although it won't be the best thing to use later on.
__________________


CAUTION
Reply With Quote
  #3  
Old 10-01-2006, 02:50 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Why is this in the GS2 forum? And if I recall correctly, its "compusdead".
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #4  
Old 10-01-2006, 02:58 AM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
Quote:
Originally Posted by xXziroXx
Why is this in the GS2 forum?
It can be here now.

PHP Code:
//#CLIENTSIDE

//This part will make the NPC automatically block for the character. You'll want this to be clientside, unless you're wanting the door to be opened for every person at once.
function onCreated(){
  
blockagain;
  
show;
}

//This will check to see if the player has killed all of the NPCs. However, I'd urge you to try something harder, like a key requirement or something similar.
function onCompusdead(){
  
dontblock;
  
hide;

Also, here's an example door that uses multiple keys to open:
PHP Code:
//#CLIENTSIDE

//This function is used on the actual door itself. The door requires 7 keys to unlock. That's pretty ridiculous, but it's also hilarious.
function onCreated()
{
  if(
doorkeys==7)
   {
    
dontblock;
    
hide;
   }
  else
   {
    
block;
    
show;
   }
}

//Call this function on every Key NPC you make that corresponds with this door. This should not be used in conjunction with the above code.

//#CLIENTSIDE

function onPlayertouchsme()
{
  
//Add whatever function you use to add stuff to your inventory / mudlib here.
  
doorkeys+=1;
  
destroy;


Last edited by Draenin; 10-01-2006 at 03:26 AM..
Reply With Quote
  #5  
Old 10-03-2006, 12:38 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Quote:
Originally Posted by Draenin View Post
PHP Code:
//#CLIENTSIDE

//This part will make the NPC automatically block for the character. You'll want this to be clientside, unless you're wanting the door to be opened for every person at once.
function onCreated(){
  
blockagain;
  
show;
}

//This will check to see if the player has killed all of the NPCs. However, I'd urge you to try something harder, like a key requirement or something similar.
function onCompusdead(){
  
dontblock;
  
hide;

i tryed this and i killed the grey soldier and the door just stayed there.... and i couldn't walk through it x.x
__________________
**FLIP OUT**
Reply With Quote
  #6  
Old 10-03-2006, 12:45 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
douse that mean it only works on a server? because im trying it on a surver!
__________________
**FLIP OUT**
Reply With Quote
  #7  
Old 10-03-2006, 02:15 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Errr, sorry, I ment; it only works online. And if it doesnt work, I dunno.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #8  
Old 10-03-2006, 02:29 AM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
I've not actually had the opportunity to test what I wrote yet, but there's not really anything wrong with that script. However, if you continue to have problems, try confining it to a single function with if and else statements. And like Ziro said, it needs to be changed from //#CLIENTSIDE to //#SERVERSIDE.
Reply With Quote
  #9  
Old 10-03-2006, 02:43 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Draenin View Post
I've not actually had the opportunity to test what I wrote yet, but there's not really anything wrong with that script. However, if you continue to have problems, try confining it to a single function with if and else statements. And like Ziro said, it needs to be changed from //#CLIENTSIDE to //#SERVERSIDE.

Rofl, theres no such thing as //#SERVERSIDE.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #10  
Old 10-03-2006, 02:52 AM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
Yeah, but he doesn't know that.
Reply With Quote
  #11  
Old 10-03-2006, 04:29 PM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
am i sapost to be killing the npc people? because im killing the baddys...

and i tryed surverside but i din't work x.x
__________________
**FLIP OUT**
Reply With Quote
  #12  
Old 10-03-2006, 04:51 PM
Luigi203 Luigi203 is offline
Hamma Time
Luigi203's Avatar
Join Date: Mar 2003
Location: North East PA
Posts: 285
Luigi203 is on a distinguished road
Send a message via AIM to Luigi203
Quote:
Originally Posted by xXziroXx View Post
Rofl, theres no such thing as //#SERVERSIDE.
Of course there is. //#SERVERSIDE will be read as a comment, and will have the same effect as not using a //#CLIENTSIDE directive.
__________________


CAUTION
Reply With Quote
  #13  
Old 10-03-2006, 05:40 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Luigi203 View Post
Of course there is. //#SERVERSIDE will be read as a comment, and will have the same effect as not using a //#CLIENTSIDE directive.
Yes, but it has no special function, its just a comment. Wich means, there is no such thing.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #14  
Old 10-03-2006, 11:07 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Eww noobs.. there's no wait between hide; dontblock; and show;.. use sleep 3; before show; again.
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #15  
Old 10-04-2006, 12:45 PM
The Evil Within The Evil Within is offline
I'm Not Chance...Really
The Evil Within's Avatar
Join Date: Aug 2004
Location: Coral Springs, Florida
Posts: 65
The Evil Within is on a distinguished road
Send a message via AIM to The Evil Within
If you're trying it on a server with GS2 enabled.

NPC Code:

//#CLIENTSIDE
function onCreated() {
show();
}

function onCompusDead() {
hide();
sleep(2);
show();
}



The graphic should automatically block which means the blockagain command really isn't needed so long as there is never a dontblock command (which also isn't needed due to the fact that once an image is hidden it shouldn't block you). HOWEVER due to the fact that some players like to delete images to bypass the the doors and get straight to the link you may want to set the shape of the image and insert the dontblock and blockagain commands.


Just incase you're working on a server that for some odd reason is scripting in GS1 instead of GS2 (All new servers should be scripting in GS2, it is much more efficient and there are tons of new features so if you are scripting in GS1 then I suggest you talk to the manager of your server and have him start converting the scripts you guys have already done into GS2) then here:

NPC Code:

if (created) {
show;
}

if (compusdead) {
hide;
sleep 2;
show;
}

__________________
-CMercy

Delteria Forums
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 12:43 AM.


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