Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Need CS/SS help! (https://forums.graalonline.com/forums/showthread.php?t=50316)

Idrox0 01-11-2004 12:36 AM

Need CS/SS help!
 
I just want info on client/serverside, because I STILL don't get it. So, I want a VERY good scripter(like Kai) to change this example script to one that would work on an NPC server.
NPC Code:

if (playertouchsme) {
toweapons 4-Way Bow;
hide;
}
if (weaponfired) {
if (playerdarts=>4) {
shootarrow 0;
shootarrow 1;
shootarrow 2;
shootarrow 3;
playerdarts-=4;
}
}



I apologize for the relatively long script, I'm just making as simple as possible, not that you can't handle it, though.

Neoreno 01-11-2004 12:44 AM

Use addweapon, not toweapons.

And the entire weaponfired block can go clientside. Don't ask for full scripts.

Idrox0 01-11-2004 01:07 AM

Well geez! I'm asking for help! Every single way I try to get it, I don't understand it! Oh, and exactly what is the difference between addweapons and toweapons?

xManiamaNx 01-11-2004 02:04 AM

toweapons is only for offline use. If used online it will disconnect the player, with a message to rc: "accountname added a weapon (hacker?)"

addweapon is for use with an NPC-Server. Add the weapon to the NPC Weapon List and use addweapon.

haunter 01-11-2004 02:12 AM

The if (playertouchsme) part has to go in an NPC in a level... The if (weaponfired) part goes in the weapon's database on your NPC sever... And you can't use toweapons, as had been said before.

wonderboysp2p 01-11-2004 02:24 AM

never put CS in your thread title and not mention Counterstrike at all during your post.... you got me all excited :grrr:

-Ramirez- 01-11-2004 02:42 AM

Quote:

Originally posted by xManiamaNx
toweapons is only for offline use
*cough* Classic *cough*
We're special. :)

Hevaricubed 01-11-2004 02:44 AM

Not for long you hairy ingrates!

:D

for (i=0;i<4;i++;) {
shootarrow i;
}

"is your friend."

Loriel 01-11-2004 03:13 AM

I guess the use of toweapons here is justified as I doubt that the original poster has NC access anywhere... ?

Quote:

Originally posted by -Ramirez-
*cough* Classic *cough*
We're special. :)

Classic is like multiplayer-offline :p

DarkShadows_Legend 01-11-2004 03:15 AM

Re: Need CS/SS help!
 
Quote:

Originally posted by Idrox0
I just want info on client/serverside, because I STILL don't get it. So, I want a VERY good scripter(like Kai) to change this example script to one that would work on an NPC server.
NPC Code:

if (playertouchsme) {
toweapons 4-Way Bow;
hide;
}
if (weaponfired) {
if (playerdarts=>4) {
shootarrow 0;
shootarrow 1;
shootarrow 2;
shootarrow 3;
playerdarts-=4;
}
}



I apologize for the relatively long script, I'm just making as simple as possible, not that you can't handle it, though.

For online play you will need to put a NPC into a level with addweapon instead of toweapons and it must be serverside.

Everything under //#CLIENTSIDE is clientside and everything above it is serverside.

example:
NPC Code:

if(playertouchsme)
addweapon your weapon;


--

Your weapon script will go into the weapons database and will have to be clientside.

NPC Code:

//#CLIENTSIDE
if(weaponfired && playerdarts >= 4){
for(i = 0; i < 4; i ++)
shootarrow i;
triggeraction 0,0,serverdarts,sub,4; // *1 (refer to notes below)
}

/* *\
Notes:
1. triggers an action to the control.
Inside the control there will be a section that will say
if(actionserverdarts){
if(strequals(#p(0),sub))
playerdarts -= strtofloat(#p(1));
}
}
You will have to modify your script to work.



There are other ways to subtract arrows other than the example I provided. What you may need is that old npcserver.doc
Search the forums and you should be able to find it.

Alexander 01-11-2004 07:52 AM

Why link removing darts to Control-NPC x-x. It's more organized to have it with the weapon instead.
NPC Code:

if (actionserverside) playerdarts--;
//#CLIENTSIDE
if (weaponfired) triggeraction 0,0,serverside,<replace with weapon name>,;


Mykel 01-11-2004 07:53 AM

Quote:

Originally posted by Loriel
I guess the use of toweapons here is justified as I doubt that the original poster has NC access anywhere... ?


Classic is like multiplayer-offline :p

Multiplayer-offline. *Remembers* Those were the fun days. :)

dlang 01-11-2004 07:57 AM

Quote:

Originally posted by wonderboysp2p
never put CS in your thread title and not mention Counterstrike at all during your post.... you got me all excited :grrr:
#1. LMAO

#2. This is an NPC forum. Not the CS Forums.

Idrox0 01-11-2004 09:37 AM

*sighs* I guess client/serverside stuff is just too much for me. At this rate, I'm never going to learn anything about it...

dlang 01-11-2004 11:14 AM

I learned how to script as much as I can by picking any script I got my hands on apart :)

Loriel 01-11-2004 03:47 PM

Re: Re: Need CS/SS help!
 
Quote:

Originally posted by DarkShadows_Legend
I am pretty sure that playerdarts can be edited clientside; and either way, your serversided changing mechanism would have the same effect as allowing it clientside.
Also, I think I remember that when a clientside NPC does shootarrow, the NPC server automatically decrements the playerdarts variable accordingly.

adam 01-11-2004 08:47 PM

Re: Re: Need CS/SS help!
 
Quote:

Originally posted by DarkShadows_Legend


/* *\
Notes:
1. triggers an action to the control.
Inside the control there will be a section that will say
if(actionserverdarts){
if(strequals(#p(0),sub))
playerdarts -= strtofloat(#p(1));
}
}
[/code]

*slaps*

Don't do that. Teach how to do it in the weapon. It's a great deal more secure.

Let me help.

NPC Code:

if (actionserverside){
if (strequals(#p(0),fired)){
playerdarts -= 4;
}
}
//#CLIENTSIDE

if (weaponfired){
triggeraction 0,0,serverside,weaponname,fired;
}



pointless if loriel is correct. But it is important for all the other stuff you can't edit clientside.

GoZelda 01-11-2004 09:39 PM

Re: Need CS/SS help!
 
Quote:

Originally posted by Idrox0
I just want info on client/serverside, because I STILL don't get it. So, I want a VERY good scripter(like Kai) to change this example script to one that would work on an NPC server.
NPC Code:

if (playertouchsme) {
toweapons 4-Way Bow;
hide;
}
if (weaponfired) {
if (playerdarts=>4) {
shootarrow 0;
shootarrow 1;
shootarrow 2;
shootarrow 3;
playerdarts-=4;
}
}



I apologize for the relatively long script, I'm just making as simple as possible, not that you can't handle it, though.

Use >= and not => o.o;
NPC Code:

//#CLIENTSIDE
if (playertouchsme){
addweapon 4-Way Bow;
destroy;
}



NPC Code:

if (actionserverside){
if (strequals(#p(0),bow)){
if (strequals(#p(1),4way)){
//shoot stuff
}
}
}
//#CLIENTSIDE
if (weaponfired){
if (playerdarts>=4){
triggeraction 0,0,serverside,bow,4way;
}
}


Not familiar with NPCserver neither, so...

adam 01-11-2004 10:37 PM

Re: Re: Need CS/SS help!
 
Quote:

Originally posted by GoZelda

Not familiar with NPCserver neither, so...

Well don't confuse the poor boy!
If he uses that he's definitly gonna have problems.

Python523 01-11-2004 10:38 PM

If you're going to use code tags please indent.

DarkShadows_Legend 01-11-2004 10:46 PM

Re: Re: Re: Need CS/SS help!
 
Quote:

Originally posted by Loriel

I am pretty sure that playerdarts can be edited clientside; and either way, your serversided changing mechanism would have the same effect as allowing it clientside.
Also, I think I remember that when a clientside NPC does shootarrow, the NPC server automatically decrements the playerdarts variable accordingly.

On Frolic and End of Ages the players arrows never reduced. They would go down, but then it would go back to being the same. They only reduced when I did it serverside, and yeah I'm sorry about the thing with the Cnpc.
I probably confused the hell out of the guy. :(

I'll test to see if it works clientside again.

osrs 01-12-2004 01:31 AM

Quote:

Originally posted by xManiamaNx
toweapons is only for offline use.
..Or for servers wich don't have an NPC-Server.

-Ramirez- 01-12-2004 01:54 AM

Quote:

Originally posted by osrs
..Or for servers wich don't have an NPC-Server.
...which is why I posted what I did. ;)

Idrox0 01-12-2004 02:20 AM

I can use => if I want to, because it doesn't seem to present any problem.

osrs 01-12-2004 03:04 PM

Quote:

Originally posted by -Ramirez-

...which is why I posted what I did. ;)

I probably didn't read your post, sorry. :)

-Ramirez- 01-12-2004 05:03 PM

Quote:

Originally posted by osrs
I probably didn't read your post, sorry. :)
No big deal. I was just stating the obvious, like everyone else likes to do. :P

Hevaricubed 01-12-2004 05:56 PM

Quote:

Originally posted by Idrox0
I can use => if I want to, because it doesn't seem to present any problem.
but.. >= is bigger or equals.. and <= is smaller or equals...... and... my little accounting brain is so hard-wired that it explodes at the mere thought of doing it your way.

GoZelda 01-12-2004 06:06 PM

To the batmobile, r0bin!

Lance got angry when i posted the wrong way in a tutorial ^^
It's easy to remember: >= looks like an ebil face.

Hevaricubed 01-12-2004 06:12 PM

Quote:

Originally posted by GoZelda
To the batmobile, r0bin!
Oh you are so going down tigger *****.

zell12 01-12-2004 09:36 PM

Quote:

Originally posted by wonderboysp2p
never put CS in your thread title and not mention Counterstrike at all during your post.... you got me all excited :grrr:
I got all worked up too. :(


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

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