Graal Forums

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

Timpan3 08-25-2002 12:48 AM

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..

emortylone 08-25-2002 12:49 AM

ROLLS! Sorry... he he.
NPC Code:

if (created)
{ dir=0;}

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


---Shifter

Spark910 08-25-2002 01:05 AM

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

Python523 08-25-2002 01:09 AM

you both have horrible script formatting

emortylone 08-25-2002 01:25 AM

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

Spark910 08-25-2002 02:03 AM

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

Timpan3 08-25-2002 02:26 AM

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 =/

amonrabr 08-25-2002 02:45 AM

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

Rogpog 08-25-2002 03:33 AM

...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. :D

emortylone 08-25-2002 07:52 AM

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

Python523 08-25-2002 08:07 AM

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 %?

emortylone 08-25-2002 09:20 AM

Close this thread, pointless x.X
---Shifter

screen_name 08-25-2002 09:50 AM

Quote:

Originally posted by Python523
you both have horrible script formatting
amen to that brother :)

emortylone 08-25-2002 11:08 PM

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


All times are GMT +2. The time now is 09:11 PM.

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