Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   LaysignNpc,GraalClassic players no wat this is (https://forums.graalonline.com/forums/showthread.php?t=26955)

weddin00 04-04-2002 02:31 PM

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

joseyisleet 04-04-2002 03:20 PM

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

screen_name 04-04-2002 09:00 PM

that would do it, just make a character and set his attributes just like the characters

Spanko 04-04-2002 10:20 PM

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.

neomaximus2k 04-05-2002 01:36 AM

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

mikepg 04-05-2002 05:46 AM

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.

Spanko 04-05-2002 06:25 PM

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

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.

Saga2001 04-06-2002 12:38 AM

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


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

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