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 04-04-2002, 02:31 PM
weddin00 weddin00 is offline
Registered User
Join Date: Jan 2002
Posts: 25
weddin00 is on a distinguished road
LaysignNpc,GraalClassic players no wat this is

Can some1 fix this script.it is supposed to when u use it copy yourself and u can leave a message overyour head.It can block doors and stuff. This 1 works but is random.I use it and it can pick any1 in the room to copy.
// NPC made by kyouto

if (playertouchsme) {toweapons Staff Sign
}
if (weaponfired) {
putnpc laysignerror.GIF,laysign_v2.txt,players[0].x,players[0].y+1

}

It looks messy and it needs a txt file to work so maybe some1 can fix it
__________________
To be the Man,you have to Beat the Man,and I am The Man!WOOOOOOO
Reply With Quote
  #2  
Old 04-04-2002, 03:20 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
-=Josey=-
Hmm, do you mean something like this?

NPC Code:
/* NPC made by Josey Hunt
The NPC in the level part. */
if (playertouchsme){
toweapons Test;
}
if (weaponfired){
putnpc laysignerror.GIF,laysign_v2.txt,players[0].x+1+vecx(playerdir)*2.5,players[0].y+1.5+vecy(playerdir)*2.5;
}
// Text file for the NPC
if (created){
showcharacter;
setcharprop #3,#3;
setcharprop #8,#8;
setcharprop #C0,#C0;
setcharprop #C1,#C1;
setcharprop #C2,#C2;
setcharprop #C3,#C3;
setcharprop #C4,#C4;
blockagain;
}


Something like this? I think that would make the NPC look like the player, not sure though, I hate non pay-to-play scripting....
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #3  
Old 04-04-2002, 09:00 PM
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
that would do it, just make a character and set his attributes just like the characters
__________________
[signature]insert here[/signature]
Reply With Quote
  #4  
Old 04-04-2002, 10:20 PM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
Quote:
Originally posted by joseyisleet
-=Josey=-
Hmm, do you mean something like this?

NPC Code:
/* NPC made by Josey Hunt
The NPC in the level part. */
if (playertouchsme){
toweapons Test;
}
if (weaponfired){
putnpc laysignerror.GIF,laysign_v2.txt,players[0].x+1+vecx(playerdir)*2.5,players[0].y+1.5+vecy(playerdir)*2.5;
}
// Text file for the NPC
if (created){
showcharacter;
setcharprop #3,#3;
setcharprop #8,#8;
setcharprop #C0,#C0;
setcharprop #C1,#C1;
setcharprop #C2,#C2;
setcharprop #C3,#C3;
setcharprop #C4,#C4;
blockagain;
}


Something like this? I think that would make the NPC look like the player, not sure though, I hate non pay-to-play scripting....
Unforunately that would automattically take it from the first person who entered the level (Or the leader), and since the person who is laying it does not specifically have to be the leader it might in fact take the wrong person.
If this is for this version, just make it do this instead:
NPC Code:
//The actual weapon, simple innit?
if (playertouchsme)
toweapons Sign Layer V2;
if (weaponfired)
putnpc laysignerror.GIF,laysign_v2.txt,playerx,playery;


NPC Code:
//laysign_v2.txt
if (created) {
showcharacter;
for (i=0;i<playerscount;i++) {
if ((int(players[i].x)==int(x))&&(int(players[i].y)==int(y))&&(strlen(#a(i))>0) ChangeStuff();
}
}
if (playertouchsme) {
if (strequals(#a,#P5(-1))) ChangeStuff();
}
function ChangeStuff() {
setcharprop #3,#3(i);
setcharprop #8,#8(i);
setcharprop #C0,#C0(i);
setcharprop #C1,#C1(i);
setcharprop #C2,#C2(i);
setcharprop #C3,#C3(i);
setcharprop #C4,#C4(i);
setcharprop #P5,#a(i);
message #c(i);
}
if (playerchats&&strequals(#c,destroy)) {
//This needs to be written completely together, but the forum applies an automatic line break >.<
if (strequals(#g,GP)||strequals(#g,FAQ)||strequals(#g (LAT)||strequals(#g,GC)) destroy;
}

This should work perfectly, though since it's untested and I haven't really gotten much experience with non-P2P scripting it might not.
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #5  
Old 04-05-2002, 01:36 AM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
Quote:
Originally posted by Spanko
Unforunately that would automattically take it from the first person who entered the level (Or the leader), and since the person who is laying it does not specifically have to be the leader it might in fact take the wrong person.
If this is for this version, just make it do this instead:
NPC Code:
//The actual weapon, simple innit?
if (playertouchsme)
toweapons Sign Layer V2;
if (weaponfired)
putnpc laysignerror.GIF,laysign_v2.txt,playerx,playery;


NPC Code:
//laysign_v2.txt
if (created) {
showcharacter;
for (i=0;i<playerscount;i++) {
if ((int(players[i].x)==int(x))&&(int(players[i].y)==int(y))&&(strlen(#a(i))>0) ChangeStuff();
}
}
if (playertouchsme) {
if (strequals(#a,#P5(-1))) ChangeStuff();
}
function ChangeStuff() {
setcharprop #3,#3(i);
setcharprop #8,#8(i);
setcharprop #C0,#C0(i);
setcharprop #C1,#C1(i);
setcharprop #C2,#C2(i);
setcharprop #C3,#C3(i);
setcharprop #C4,#C4(i);
setcharprop #P5,#a(i);
message #c(i);
}
if (playerchats&&strequals(#c,destroy)) {
//This needs to be written completely together, but the forum applies an automatic line break >.<
if (strequals(#g,GP)||strequals(#g,FAQ)||strequals(#g (LAT)||strequals(#g,GC)) destroy;
}

This should work perfectly, though since it's untested and I haven't really gotten much experience with non-P2P scripting it might not.
A very good try dude, but however a few things
1) why use P5, why nut use a string or variable or some other means to make it purly non p2p
2) was gonna say not to use functions but then again lol USE THEM
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #6  
Old 04-05-2002, 05:46 AM
mikepg mikepg is offline
Registered User
Join Date: Nov 2001
Location: VA, USA
Posts: 501
mikepg is on a distinguished road
Send a message via AIM to mikepg Send a message via Yahoo to mikepg
umm

you can add a for loop
in the npc textfile do something like:
NPC Code:

if (created) {
showcharacter;
changeclothes();
}
function changeclothes() {
for (this.i=0; this.i<playerscount; this.i++ {
if (players[this.i].x=x && players[this.i].y=y) {
setcharprop #C2(-1),#C2(this.i);
return;
}
}
destroy;
}



for the setcharprop section, do all of the variables, not just C2, with what is in the '()'s left the same.
That should work, provided you are the only person standing there for the clothes part....as for the message...you'd have to be saying it when you fire the weapon, and add it in the function as well, or you'd have to make a big huge menu that wouldnt be worth the trouble.
__________________
~War Lord Mpg2
Bravo Online's Asst. Staff Manager

"Sittin by the tree, sippin eggnog, waitin on christmas gifts"
Reply With Quote
  #7  
Old 04-05-2002, 06:25 PM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
Re: umm

Quote:
Originally posted by neomaximus2k


A very good try dude, but however a few things
1) why use P5, why nut use a string or variable or some other means to make it purly non p2p
2) was gonna say not to use functions but then again lol USE THEM
Quite simply because P5 was the first string which stays stored and can make the NPC contain the value which occurs to me. Of course if you wuold know one which can be changed and makes no visible difference feel free to change it, or something.

Quote:
Originally posted by mikepg
you can add a for loop
in the npc textfile do something like:
NPC Code:

if (created) {
showcharacter;
changeclothes();
}
function changeclothes() {
for (this.i=0; this.i<playerscount; this.i++ {
if (players[this.i].x=x && players[this.i].y=y) {
setcharprop #C2(-1),#C2(this.i);
return;
}
}
destroy;
}



for the setcharprop section, do all of the variables, not just C2, with what is in the '()'s left the same.
That should work, provided you are the only person standing there for the clothes part....as for the message...you'd have to be saying it when you fire the weapon, and add it in the function as well, or you'd have to make a big huge menu that wouldnt be worth the trouble.
#C2(-1) is not necesarry for setcharprop, simply because setcharprop is always applied to the NPC which runs it.
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #8  
Old 04-06-2002, 12:38 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Is this P2P? If so, you should use putnpc2...I have been "discovering" P2P ad much as i can recently, and omi its leet...for example you could make a sign that is placed and contains the text that you typed...However I think Stefan should add a eval(string) command for if you have #b or line breaks so the sign it will recognize them...:-/. You could also just use [wraptext or #e()] and for commands to make signs work right. Very cool indeed...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
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 10:10 AM.


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