Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   PlayerWorlds Main Forum (https://forums.graalonline.com/forums/forumdisplay.php?f=15)
-   -   NPC Server scripting (https://forums.graalonline.com/forums/showthread.php?t=15935)

bo0ey 11-01-2001 01:51 PM

NPC Server scripting
 
How would I make an NPC so that if you touch it, your rupees go up by 1? And this script should work with the NPC Server

wark2 11-01-2001 10:56 PM

if (playertouchsme) {
playerrupees=playerrupees+1;
}

------- SO EASY --------

Petey84 11-02-2001 01:54 AM

Shakaku:
eer wrong section Booey, and i think it's the same as without npc server

Poogle 11-02-2001 03:46 AM

Or this
 
Id sont thikn this is what you want but try..

if (playettouchsme){
lay2 greenrupee, playerx, playery
}
i use that for a level where ppl are moving arounsd alot but also getting money

BocoC 11-02-2001 06:24 AM

Wrong section, but, you would need to do a triggeraction to the control-npc which adds or subracts money from the player:

NPC Code:

Give player 3 Gralats
if (something) {
triggeraction 0,0,serverGralat,#a,3;
}

Take away 3 Gralats from player
if (something) {
triggeraction 0,0,serverGralat,#a,-3;
}

Control-NPC:
if (actionserverGralat) {
with (getplayer(#p(0))) {
playerrupees+=strtofloat(#p(1));
}
}


LiquidIce00 11-02-2001 08:14 AM

yah it has to be server sided.

Slaktmaster 11-02-2001 08:27 AM

playertouchsme works fine

LiquidIce00 11-02-2001 08:30 AM

Quote:

Originally posted by Slaktmaster
playertouchsme works fine
not if its clientsided

Nishoku 11-02-2001 08:48 AM

Quote:

Originally posted by LiquidIce00


not if its clientsided

-Uses playertouchsme..
So I guess i'm a n00b

Poogle 11-02-2001 08:55 AM

Re: Or this
 
Quote:

Originally posted by Poogle
Id sont thikn this is what you want but try..
i use that for a level where ppl are moving arounsd alot but also getting money

Gosh I screwed up typing there!
I dont think this is what you want but try.. is what i meant

wark2 11-02-2001 10:31 PM

gosh! i thought i was a talented scripter, i use playertouchsme and playerrupees=playerrupees+(), you guys are so complicated!

Slaktmaster 11-02-2001 11:16 PM

playertouchsme works server-side but you have to use setshape first. so ha and poo on you.

Xaviar 11-03-2001 04:05 AM

This is why non-P2P is fun :D Much less confusing..

Loriel 11-03-2001 05:50 AM

The *real* NPC Server way to do it :)
NPC Code:
if (created) {
showcharacter;
setcharprop #3,head19.png;
setcharprop #C0,orange;
setcharprop #C1,gray;
setcharprop #C2,gray;
setcharprop #C3,brown;
setcharprop #C4,black;
setcharprop #2,izludeshield.png;
setcharprop #n,Stefan;
shieldpower = 1;
dir = 2;
ap = 100;
x += 0.5;
}
if (playertouchsme) {
dir = (playerdir+1)%4;
putnpc2 x+vecx(dir)*3,y+vecy(dir)*3,{
if (created) {
showcharacter;
setani gralat,1;
}
if (playertouchsme) {
playerrupees ++;
destroy;
}
};
message Here you are, greedy person!;
sleep 3;
dir = (dir+1)%4;
message;
}


A NPC that just increases your Gralat count would be really unrealistic :(
Totally off topic: Hmm, it would be cool if the code-Vb tag would format your script the same way the debugger on Graal does...

Slaktmaster 11-03-2001 06:16 AM

Thanks for that one Loriel, I never knew that you could use that #4 for setting the NPC direction. :)

BocoC 11-03-2001 06:25 AM

Quote:

Originally posted by Loriel
The *real* NPC Server way to do it :)
NPC Code:
if (created) {
showcharacter;
setcharprop #3,head19.png;
setcharprop #C0,orange;
setcharprop #C1,gray;
setcharprop #C2,gray;
setcharprop #C3,brown;
setcharprop #C4,black;
setcharprop #2,izludeshield.png;
setcharprop #n,Stefan;
shieldpower = 1;
dir = 2;
ap = 100;
x += 0.5;
}
if (playertouchsme) {
dir = (playerdir+1)%4;
putnpc2 x+vecx(dir)*3,y+vecy(dir)*3,{
if (created) {
showcharacter;
setani gralat,1;
}
if (playertouchsme) {
playerrupees ++;
destroy;
}
};
message Here you are, greedy person!;
sleep 3;
dir = (dir+1)%4;
message;
}


A NPC that just increases your Gralat count would be really unrealistic :(
Totally off topic: Hmm, it would be cool if the code-Vb tag would format your script the same way the debugger on Graal does...

That is an interesting script. But I use my way if I want to take money away in a clientside script.

JinZero 11-05-2001 08:55 AM

B00ey, I really doubt that you can make a server, or a good level for that matter.

royce 11-05-2001 09:50 AM

Jin, Why in the hell do u always like to find trouble at the end of threads?

JinZero 11-05-2001 12:43 PM

Quote:

Originally posted by royce
Jin, Why in the hell do u always like to find trouble at the end of threads?
Dunno :confused:

6Burning6Church6 11-06-2001 09:04 AM

Re: NPC Server scripting
 
Quote:

Originally posted by bo0ey
How would I make an NPC so that if you touch it, your rupees go up by 1? And this script should work with the NPC Server
Hi,
We Graalians post this kind of stuff in NPC Server forum!


All times are GMT +2. The time now is 03:43 PM.

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