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 01-11-2004, 12:36 AM
Idrox0 Idrox0 is offline
Registered User
Join Date: Oct 2003
Posts: 66
Idrox0 is on a distinguished road
Question 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.
__________________
Reply With Quote
  #2  
Old 01-11-2004, 12:44 AM
Neoreno Neoreno is offline
Cerebrate
Neoreno's Avatar
Join Date: Aug 2001
Location: England
Posts: 1,663
Neoreno is on a distinguished road
Send a message via AIM to Neoreno
Use addweapon, not toweapons.

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

Quote:
Exitus Acta Probat: The Outcome Justifies the Deed.
Reply With Quote
  #3  
Old 01-11-2004, 01:07 AM
Idrox0 Idrox0 is offline
Registered User
Join Date: Oct 2003
Posts: 66
Idrox0 is on a distinguished road
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?
__________________
Reply With Quote
  #4  
Old 01-11-2004, 02:04 AM
xManiamaNx xManiamaNx is offline
Supreme Dictator
xManiamaNx's Avatar
Join Date: Nov 2002
Location: 127.0.0.1
Posts: 385
xManiamaNx is on a distinguished road
Send a message via MSN to xManiamaNx Send a message via Yahoo to xManiamaNx
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.
__________________
Maniaman

Play Maloria Now: [2.3] [3]
Maloria Website

Reply With Quote
  #5  
Old 01-11-2004, 02:12 AM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
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.
Reply With Quote
  #6  
Old 01-11-2004, 02:24 AM
wonderboysp2p wonderboysp2p is offline
Registered User
wonderboysp2p's Avatar
Join Date: Sep 2002
Location: -Wonderboy
Posts: 537
wonderboysp2p is on a distinguished road
Send a message via AIM to wonderboysp2p
never put CS in your thread title and not mention Counterstrike at all during your post.... you got me all excited :grrr:
__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #7  
Old 01-11-2004, 02:42 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by xManiamaNx
toweapons is only for offline use
*cough* Classic *cough*
We're special.
__________________
Kat
Reply With Quote
  #8  
Old 01-11-2004, 02:44 AM
Hevaricubed Hevaricubed is offline
Registered User
Join Date: Aug 2003
Posts: 262
Hevaricubed is on a distinguished road
Send a message via AIM to Hevaricubed Send a message via Yahoo to Hevaricubed
Not for long you hairy ingrates!

:D

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

"is your friend."
__________________
Reply With Quote
  #9  
Old 01-11-2004, 03:13 AM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
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
Reply With Quote
  #10  
Old 01-11-2004, 03:15 AM
DarkShadows_Legend DarkShadows_Legend is offline
Cult of the Winky
DarkShadows_Legend's Avatar
Join Date: Apr 2003
Location: Florida
Posts: 614
DarkShadows_Legend is on a distinguished road
Send a message via AIM to DarkShadows_Legend
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.
__________________
- Criminal X

"I rather be hated for being myself, than be liked for being what you like best. I go above the influence, not under." - Me
Reply With Quote
  #11  
Old 01-11-2004, 07:52 AM
Alexander Alexander is offline
Registered User
Join Date: Apr 2003
Location: California
Posts: 246
Alexander is on a distinguished road
Send a message via AIM to Alexander
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>,;

Reply With Quote
  #12  
Old 01-11-2004, 07:53 AM
Mykel Mykel is offline
:o
Mykel's Avatar
Join Date: May 2002
Location: Canton, Ohio.
Posts: 5,526
Mykel has a spectacular aura about
Send a message via AIM to Mykel Send a message via MSN to Mykel
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
Multiplayer-offline. *Remembers* Those were the fun days.
__________________
(Married to Skyld)
Reply With Quote
  #13  
Old 01-11-2004, 07:57 AM
dlang dlang is offline
Yoshi!
dlang's Avatar
Join Date: Oct 2002
Location: Houston, Texas
Posts: 406
dlang is on a distinguished road
Send a message via AIM to dlang Send a message via MSN to dlang
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.
__________________
Where do I take this pain of mine?
I run but it stays right by my side.
So tear me open, pour me out,
there's things inside that scream and shout.
And the pain still hates me, so hold me until it sleeps.

---------------
Reply With Quote
  #14  
Old 01-11-2004, 09:37 AM
Idrox0 Idrox0 is offline
Registered User
Join Date: Oct 2003
Posts: 66
Idrox0 is on a distinguished road
*sighs* I guess client/serverside stuff is just too much for me. At this rate, I'm never going to learn anything about it...
__________________
Reply With Quote
  #15  
Old 01-11-2004, 11:14 AM
dlang dlang is offline
Yoshi!
dlang's Avatar
Join Date: Oct 2002
Location: Houston, Texas
Posts: 406
dlang is on a distinguished road
Send a message via AIM to dlang Send a message via MSN to dlang
I learned how to script as much as I can by picking any script I got my hands on apart
__________________
Where do I take this pain of mine?
I run but it stays right by my side.
So tear me open, pour me out,
there's things inside that scream and shout.
And the pain still hates me, so hold me until it sleeps.

---------------
Reply With Quote
  #16  
Old 01-11-2004, 03:47 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
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.
Reply With Quote
  #17  
Old 01-11-2004, 08:47 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
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.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #18  
Old 01-11-2004, 09:39 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
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...
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #19  
Old 01-11-2004, 10:37 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
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.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #20  
Old 01-11-2004, 10:38 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
If you're going to use code tags please indent.
Reply With Quote
  #21  
Old 01-11-2004, 10:46 PM
DarkShadows_Legend DarkShadows_Legend is offline
Cult of the Winky
DarkShadows_Legend's Avatar
Join Date: Apr 2003
Location: Florida
Posts: 614
DarkShadows_Legend is on a distinguished road
Send a message via AIM to DarkShadows_Legend
Unhappy 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.
__________________
- Criminal X

"I rather be hated for being myself, than be liked for being what you like best. I go above the influence, not under." - Me
Reply With Quote
  #22  
Old 01-12-2004, 01:31 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally posted by xManiamaNx
toweapons is only for offline use.
..Or for servers wich don't have an NPC-Server.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #23  
Old 01-12-2004, 01:54 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Quote:
Originally posted by osrs
..Or for servers wich don't have an NPC-Server.
...which is why I posted what I did.
__________________
Kat
Reply With Quote
  #24  
Old 01-12-2004, 02:20 AM
Idrox0 Idrox0 is offline
Registered User
Join Date: Oct 2003
Posts: 66
Idrox0 is on a distinguished road
I can use => if I want to, because it doesn't seem to present any problem.
__________________
Reply With Quote
  #25  
Old 01-12-2004, 03:04 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally posted by -Ramirez-

...which is why I posted what I did.
I probably didn't read your post, sorry.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #26  
Old 01-12-2004, 05:03 PM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
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
__________________
Kat
Reply With Quote
  #27  
Old 01-12-2004, 05:56 PM
Hevaricubed Hevaricubed is offline
Registered User
Join Date: Aug 2003
Posts: 262
Hevaricubed is on a distinguished road
Send a message via AIM to Hevaricubed Send a message via Yahoo to Hevaricubed
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.
__________________
Reply With Quote
  #28  
Old 01-12-2004, 06:06 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
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.
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #29  
Old 01-12-2004, 06:12 PM
Hevaricubed Hevaricubed is offline
Registered User
Join Date: Aug 2003
Posts: 262
Hevaricubed is on a distinguished road
Send a message via AIM to Hevaricubed Send a message via Yahoo to Hevaricubed
Quote:
Originally posted by GoZelda
To the batmobile, r0bin!
Oh you are so going down tigger *****.
__________________
Reply With Quote
  #30  
Old 01-12-2004, 09:36 PM
zell12 zell12 is offline
Gone
zell12's Avatar
Join Date: Jun 2001
Location: Alberta, Canada
Posts: 8,541
zell12 has a spectacular aura about
Send a message via ICQ to zell12 Send a message via AIM to zell12 Send a message via MSN to zell12
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.
__________________
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 11:50 PM.


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