Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-25-2002, 12:48 AM
Timpan3 Timpan3 is offline
Registered User
Timpan3's Avatar
Join Date: Apr 2002
Location: Stockholm, Sweden.
Posts: 969
Timpan3 is on a distinguished road
Send a message via AIM to Timpan3
How to ?

Ok heres the deal, my npc is standing in the direction "up" and i want my NPC to (when (playertouchsme)) change direction to south and say 1;

Please Help..
__________________

Rate Fairly :O
1 2 3 4 5
- AIM : HoOLiGaN4LyFe
- Email : [email protected]
- Nick : Kosma
- Server : Classic/Frolic
- Current Jobs : Malhangaia LAT
Reply With Quote
  #2  
Old 08-25-2002, 12:49 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
ROLLS! Sorry... he he.
NPC Code:

if (created)
{ dir=0;}

if (playertouchsme)
{ dir=2;
message 1;
}


---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #3  
Old 08-25-2002, 01:05 AM
Spark910 Spark910 is offline
Ex-Graal Global
Spark910's Avatar
Join Date: Oct 2001
Location: England
Posts: 10,892
Spark910 has a spectacular aura about
Quote:
Originally posted by emortylone
ROLLS! Sorry... he he.
NPC Code:

if (created)
{ dir=0;}

if (playertouchsme)
{ dir=2;
message 1;
}


---Shifter
I think he wanted this code, you've done Message and Im sure its say, the NPC will prbally be a Man who when you touch him says ''Oh hello'' or ''Dont jump up on my like that'' So script I think you need it:

NPC Code:

if (created)
{ dir=0;}

if (playertouchsme)
{ dir=2;
say 1;
}



Please note the first sign is 0, Make sure you have the correct number of sign or it wont work or will say wrong message
Reply With Quote
  #4  
Old 08-25-2002, 01:09 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
you both have horrible script formatting
Reply With Quote
  #5  
Old 08-25-2002, 01:25 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
LOL, I just threw that code together, I didn't care what it looked like. I NEVER EVER EVER script like that x.X
---Shifter
P.S. He said have it say 1 =P
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #6  
Old 08-25-2002, 02:03 AM
Spark910 Spark910 is offline
Ex-Graal Global
Spark910's Avatar
Join Date: Oct 2001
Location: England
Posts: 10,892
Spark910 has a spectacular aura about
Quote:
Originally posted by emortylone
LOL, I just threw that code together, I didn't care what it looked like. I NEVER EVER EVER script like that x.X
---Shifter
P.S. He said have it say 1 =P
---Shifter
I know but I think he knows basic script so Say is signs,

Well either way, He has both scripts whateva he ment. =D
Reply With Quote
  #7  
Old 08-25-2002, 02:26 AM
Timpan3 Timpan3 is offline
Registered User
Timpan3's Avatar
Join Date: Apr 2002
Location: Stockholm, Sweden.
Posts: 969
Timpan3 is on a distinguished road
Send a message via AIM to Timpan3
I meant say as in the NPC reading from sign nr 1 , as in say <signindex>;

Eh the code if kinda buggy, when i enter the room, he says the stuff without me having to touch him =/
__________________

Rate Fairly :O
1 2 3 4 5
- AIM : HoOLiGaN4LyFe
- Email : [email protected]
- Nick : Kosma
- Server : Classic/Frolic
- Current Jobs : Malhangaia LAT
Reply With Quote
  #8  
Old 08-25-2002, 02:45 AM
amonrabr amonrabr is offline
Scripter
Join Date: Nov 2001
Location: Brazil
Posts: 374
amonrabr is on a distinguished road
Re: How to ?

Quote:
Originally posted by Timpan3
Ok heres the deal, my npc is standing in the direction "up" and i want my NPC to (when (playertouchsme)) change direction to south and say 1;

Please Help..
well.. the beeeest way to make something alitlle bit better is..
if(playertouchsme){dir=(playerdir+2)%4;}

but if you wanna make this... Use sleep to the npc turn before say something.... it starts with dir equal 0 and when you touch it it changes to 2.. I think you know that.. rofl
Reply With Quote
  #9  
Old 08-25-2002, 03:33 AM
Rogpog Rogpog is offline
Registered User
Join Date: May 2002
Posts: 15
Rogpog is on a distinguished road
...or maybe you can do this?

NPC Code:

if (created||playerendsreading){
showcharacter;
// input character properties;
dir=0;
}
if (playertouchsme){
dir=2;
say2 <Insert NPC text here.>
}



lol, all of this for a simple sign script.
Reply With Quote
  #10  
Old 08-25-2002, 07:52 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
I still think my way was the simplest, but if he wants to do say2, just use say <signindex> and it should work just fine! or if you FEEL it has to be complicated:
NPC Code:

if (created)
{ this.touch=0;
timeout=0.5;
}

if (playertouchsme)
{ this.touch=this.touch+2;
say <sign index>;
}

if (timeout)
{ dir=this.touch;
timeout=0.5;
}


I don't even care if it works, the first way is too easy, and it is about POINTLESS for us to explain this 100 times over.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #11  
Old 08-25-2002, 08:07 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Re: Re: Re: How to ?

Quote:
Originally posted by Kaimetsu


Horribly inefficient
how is using % so inefficent? I remember you saying something about % being inefficient in other posts but I'm curious, why are you against the usage of %?
Reply With Quote
  #12  
Old 08-25-2002, 09:20 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Close this thread, pointless x.X
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #13  
Old 08-25-2002, 09:50 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
Quote:
Originally posted by Python523
you both have horrible script formatting
amen to that brother
__________________
[signature]insert here[/signature]
Reply With Quote
  #14  
Old 08-25-2002, 11:08 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Did I not make it clear I didn't care what that looked like because it was a stupid pointless script? Look @ my other's... not bad. And really, why the hell would it matter as long as you can read it and it works?? If put:
NPC Code:

if (created)
{ for (i=0;i<allplayerscount;i++)
{ with (allplayers[i])
{ if (strequals(#a,Accname))
{ setplayerprop #n,#a (Guild);
}
}
}
}


not quite pretty @ ALL but you can somewhat read it, and it works. If you space things out, there shouldn't be a problem. So if you don't like my scripting style, then stfu and don't read it!
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
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 01:04 PM.


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