Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-17-2004, 03:37 AM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
toweapons/addweapon?

addweapon wont work for me at all, why why why?
toweapons works just fine with npc sever except when used clientside...
But yeah, plah plah, how do I get addweapon to effing work??


Oh and when I try to save classes RC says:
"Script *scriptname* saved (no npc with this class on the server)."
And wont display the file. Even tho there is an npc with that class on the server. Why oh why?

Bah.
Before I started my server I scripted everything I needed and then it turned out most of my stuff didnt work with npc server.
Argh.

So on a side note to that Im hiring a freaking scripter if anyone would care to help with a few simple (simple? maybe...) npcs.
  #2  
Old 06-17-2004, 04:14 AM
Malinko Malinko is offline
Unholy Nation
Join Date: Mar 2004
Location: Massachusetts, U.S.A.
Posts: 1,782
Malinko is on a distinguished road
Send a message via AIM to Malinko
addweapon = serverside.
toweapons = the devil.
  #3  
Old 06-17-2004, 04:45 AM
Xecutor Xecutor is offline
Former UN Manager
Join Date: Apr 2004
Posts: 117
Xecutor is on a distinguished road
You have to have weapons in your weapons list(sword icon) to use addweapon (it adds a weapon to someones inventory).
toweapons should not be used if you have an npcserver.
To get the class file, look in the folder scripts.
  #4  
Old 06-17-2004, 05:31 AM
matt8891 matt8891 is offline
Registered User
matt8891's Avatar
Join Date: Jul 2003
Location: New York
Posts: 0
matt8891 is on a distinguished road
Send a message via AIM to matt8891 Send a message via Yahoo to matt8891
If you want to use toweapons;(adds npc to NPC-Control) do this:

if (actionserverside)
{if (playertouchsme) toweapons;
}

If you want to use addweapons;(adds NPC thats already in NPC-Control to player attributes) do this:

//#CLIENTSIDE
{if (playertouchsme)
addweapon (weaponame)
}
  #5  
Old 06-17-2004, 05:38 AM
Duwul Duwul is offline
Registered User
Join Date: Nov 2003
Posts: 105
Duwul is on a distinguished road
Quote:
Originally Posted by matt8891
If you want to use toweapons;(adds npc to NPC-Control) do this:

if (actionserverside)
{if (playertouchsme) toweapons;
}

If you want to use addweapons;(adds NPC thats already in NPC-Control to player attributes) do this:

//#CLIENTSIDE
{if (playertouchsme)
addweapon (weaponame)
}
Erm, wtf?
addweapon only works serverside, and don't use toweapons at all =/
__________________
-Ajira
Liek, omigosh.
<3 DoomsDay.
  #6  
Old 06-17-2004, 09:41 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Do not use toweapons. It is deprecated and causes problems with the NPC-Server.

Use NC to add the weapon to the weapons database, then use the serverside command:
NPC Code:
addweapon weaponname;



LordVyse, a warning: Those who continually post bad advice in the scripting forum become masked from it.
  #7  
Old 06-17-2004, 05:36 PM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
Right... So all I need to do Is ad the weapon script to the npcs before using addweapon.

I feel like getting rid of npc server, I dont seem to need it for all that much...
  #8  
Old 06-17-2004, 05:42 PM
matt8891 matt8891 is offline
Registered User
matt8891's Avatar
Join Date: Jul 2003
Location: New York
Posts: 0
matt8891 is on a distinguished road
Send a message via AIM to matt8891 Send a message via Yahoo to matt8891
Quote:
Originally Posted by Lance
Do not use toweapons. It is deprecated and causes problems with the NPC-Server.

Use NC to add the weapon to the weapons database, then use the serverside command:
NPC Code:
addweapon weaponname;



LordVyse, a warning: Those who continually post bad advice in the scripting forum become masked from it.
I still dont understand why toweapons is bad to use....If its so BAD to use why hasnt anyone removed it from the Commands?
  #9  
Old 06-17-2004, 05:44 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
Because people still use it and Stefan does not want to break scripts.
  #10  
Old 06-17-2004, 08:47 PM
Xecutor Xecutor is offline
Former UN Manager
Join Date: Apr 2004
Posts: 117
Xecutor is on a distinguished road
Having a serveroption to disable it like mentioned in some other thread would be cool.
  #11  
Old 06-17-2004, 09:16 PM
matt8891 matt8891 is offline
Registered User
matt8891's Avatar
Join Date: Jul 2003
Location: New York
Posts: 0
matt8891 is on a distinguished road
Send a message via AIM to matt8891 Send a message via Yahoo to matt8891
Quote:
Originally Posted by Xecutor
Having a serveroption to disable it like mentioned in some other thread would be cool.
Maybe someone could script that into NPC-Server.
  #12  
Old 06-17-2004, 10:03 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
I once suggested something like disablescriptcommands=toweapons,sendpm,...
  #13  
Old 06-18-2004, 06:16 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
About the class npc, you have to call the script (using the serverside command join) so it will show in the classes. If you have already called the script and it still does not show, so i have no clue.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
  #14  
Old 06-18-2004, 07:09 PM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
Quote:
Originally Posted by Salaisuus
Right... So all I need to do Is ad the weapon script to the npcs before using addweapon.

I feel like getting rid of npc server, I dont seem to need it for all that much...
Don't get rid of the npc server, you will find it very useful. Just get someone who can script to edit your npcs for use with the npc-server.
__________________
Former Global Scripting Team Member


  #15  
Old 06-18-2004, 09:57 PM
Malinko Malinko is offline
Unholy Nation
Join Date: Mar 2004
Location: Massachusetts, U.S.A.
Posts: 1,782
Malinko is on a distinguished road
Send a message via AIM to Malinko
Classic still uses toweapons right? Since they have no NPC Server. N-Pulse did use it til we converted it all.
  #16  
Old 06-18-2004, 09:58 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 Malinko
Classic still uses toweapons right? Since they have no NPC Server. N-Pulse did use it til we converted it all.
I think Classic get an NPC-Server, or its debug 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 /
  #17  
Old 06-19-2004, 12:02 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
addweapon never works for me. I have tried tons of things. i do exactly what u r supposed to
[/code]
if (actionserverside) {addweapon wepname;}
//#CLIENTSIDE
if (playertouchsme) {triggeraction 0,0,serverside,}
[\code]
yet it never works. I dont know what I am going to do for my server. also for some reason offline it dont even recognize addweapon. It says its not a valid command. And usually offline it knows online commands......
  #18  
Old 06-19-2004, 12:23 AM
Xecutor Xecutor is offline
Former UN Manager
Join Date: Apr 2004
Posts: 117
Xecutor is on a distinguished road
Since your a beginner, just try addweapon weaponname; serversided. Make sure you have the weapon in your weaponslist. The command is not recoginized offline because the offline client does not recognize some (if not all) commands that require an NPC server.
  #19  
Old 06-19-2004, 12:25 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
falco21954368743698340,
Having triggeraction trigger to an x and y of 0 should only be used in WEAPONS.

All serverside:
if (playertouchsme) { addweapon wepname; }
Clientside junk shouldn't be used if all your are doing is adding a weapon when the player touches it.

The "Test" button on the offline editor hasn't been updated in ages. Most new commands it has never heard of. addweapon will not work offline, because there is no offline NPC-Server.
__________________
Maniaman

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

  #20  
Old 06-19-2004, 01:33 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
thank you all for your help
  #21  
Old 06-19-2004, 01:38 AM
Ris Ris is offline
Registered User
Join Date: May 2004
Location: California,USA
Posts: 2
Ris is on a distinguished road
hmm well if you wanted to make it easyer on you then that instead of putting it on a level you could just put this in the Control-NPC thing just add
NPC Code:
if (!hasweapon(-narf narf)) addweapon -narf narf;

__________________
Experimenting~
  #22  
Old 06-19-2004, 01:57 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
Quote:
Originally Posted by Ris
NPC Code:
if (!hasweapon(-narf narf)) addweapon -narf narf;

Not good in the control npc for anything besides System NPCs
__________________
Maniaman

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

  #23  
Old 06-19-2004, 04:07 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
yeh this is for setlevel2 but for some reason i cant get it to work if not in a wepon?

things like

if (actionserverside) {setlevel2 theplace.nw,2234,7980}
//clientw/e
if (weaponfired) {triggeraction 0,0,serverside,wepon}



but something like

if (actionserverside) {setlevel2 theotherplace.nw,3,-10}
//#CLIENTSIDE
if (w/e) {triggeraction 0,0,serverside,}



wont work (i kno the x and y in both are not able to work)

anyone know why?
  #24  
Old 06-19-2004, 04:14 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
Use actual scripts instead of junk like "if (w/e)" and stuff and then I'll help.
__________________
Maniaman

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

  #25  
Old 06-19-2004, 04:18 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
OK

NPC Code:

if (actionserverside) {
setlevel2 class.nw,30,30}
//#CLIENTSIDE
if (command) {triggeraction 0,0,serverside,}


wont work
NPC Code:

if (actionserverside) {
setlevel2 class.nw,30,30}
//#CLIENTSIDE
if (weaponfired) {triggeraction 0,0,serverside,warper}



will
  #26  
Old 06-19-2004, 04:18 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 falco10291029
yeh this is for setlevel2 but for some reason i cant get it to work if not in a wepon?

things like

if (actionserverside) {setlevel2 theplace.nw,2234,7980}
//clientw/e
if (weaponfired) {triggeraction 0,0,serverside,wepon}



but something like

if (actionserverside) {setlevel2 theotherplace.nw,3,-10}
//#CLIENTSIDE
if (w/e) {triggeraction 0,0,serverside,}



wont work (i kno the x and y in both are not able to work)

anyone know why?
You keep confusing yourself. Try reading this or the moderators will not be happy with you; (http://forums.graal2001.com/forums/s...ad.php?t=53241)

Your triggeraction is missing the weapon name and the parameter. (if there is no parameter, just let it empty). Something similiar to:

NPC Code:

if(actionserverside){
setlevel2 level.nw,30,30;
}

//#CLIENTSIDE

if(weaponfired){
triggeraction 0,0,serverside,WARPER,;
}



Make sure to replace WARPER by the name of the weapon; also you're missing the ; in the end of every execution line.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
  #27  
Old 06-19-2004, 04:19 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
i mean it doesnt work if its not a wepon, what do you do then?
  #28  
Old 06-19-2004, 04:23 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
Since it's not a weapon you are triggering the action to the x of 0 and y of 0, not the npc's x and y. Also, end EVERY command with a ;
__________________
Maniaman

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

  #29  
Old 06-19-2004, 04:24 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 falco10291029
i mean it doesnt work if its not a wepon, what do you do then?
If it is a local npc (npc on level) just use setlevel2 serverside too.

NPC Code:

if(playertouchsme){
setlevel2 level.nw,30,30;
}

//#CLIENTSIDE

if(created) setimg block.png;




Is that what you're looking for?
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
  #30  
Old 06-19-2004, 04:27 AM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
ok so for a command thats not a weapon itll look like:

NPC Code:

if (actionserverside) setlevel2 class.nw,30,30;
//#CLIENTSIDE
if (flag) {triggeraction x,y,serverside,}

  #31  
Old 06-19-2004, 04:55 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 falco10291029
ok so for a command thats not a weapon itll look like:

NPC Code:

if (actionserverside) setlevel2 class.nw,30,30;
//#CLIENTSIDE
if (flag) {triggeraction x,y,serverside,}

You don't really need to use triggeraction in every script. Read my last post.

Note: You did not use ; in the end of the execution line again.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
  #32  
Old 06-19-2004, 06:36 AM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
Quote:
Don't get rid of the npc server, you will find it very useful. Just get someone who can script to edit your npcs for use with the npc-server.
I wish.
Everyday I have people popping on my server asking for staff pos.
When ever I aks them if they can script they, for some reason, say "yes".
While I have come to notice they actually mean "No".

I wonder if I get flamed or something if I try to hire someone from these forums?
  #33  
Old 06-19-2004, 06:55 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
Welcome to Graal where a majority of the population act like stupid idiots, and will say they can do satuff that they really cant do just for power
__________________
Maniaman

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

  #34  
Old 06-19-2004, 05:04 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Lol ok then i have a question, what flags will work serverside?

i know the following flags work:

playertouchsme

action-action-

seems a bit lacking, what others work serverside without using a triggeraction??
  #35  
Old 06-19-2004, 05:33 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 falco10291029
Lol ok then i have a question, what flags will work serverside?

i know the following flags work:

playertouchsme

action-action-
You will learn that while scripting; testing and fixing scripts is a good way. I would lose alot of time telling you what work serverside and what work clientside. (sounds and some images like gui's and personal systems are always good to keep on clientside)

Quote:
Originally Posted by falco10291029
seems a bit lacking, what others work serverside without using a triggeraction??
Triggeraction won't solve all your problems, you can do many things without use triggeraction.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
  #36  
Old 06-19-2004, 06:26 PM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Quote:
Originally Posted by falco10291029
Lol ok then i have a question, what flags will work serverside?

i know the following flags work:

playertouchsme

action-action-

seems a bit lacking, what others work serverside without using a triggeraction??
Most things work both clientside and serverside. Because there is no actual creation of the NPC serverside, you can not do if (created) on the serverside, which is why most people call a triggeraction if (created) to perform the function serversided. The list of things that work both serverside and clientside is much larger than the list that won't work on one or the other, and it's best that you play with these things for yourself rather than ask people. Just go through, test the action and have it to sendtorc, simple as that. While we are generally very knowledgable at scripting, there are a million other things we focus on and have lives, so it's not always easy to remember a list of things that won't work, as most of them are easy enough to figure out. There are always multiple ways to perform the same task, so just play around with some scripts (don't EVER put timeout of .1 serverside or I will revoke this statement, lol) and you will have much better results than asking us a hundred questions.
-Projectshifter
__________________
Who has time for life these days?
  #37  
Old 06-19-2004, 07:53 PM
falco10291029 falco10291029 is offline
BEst User EVER!
Join Date: Apr 2004
Posts: 1,186
falco10291029 is on a distinguished road
Ok thaniks i thought that the list was very small since if i didnt put the //#CLIENTSIDE most scripts i made didnt work but thank you also one other thing, whats the command for if the person clicks with the left mouse? i thought it was if (leftmousebutton) but that never works
  #38  
Old 06-19-2004, 08:18 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 falco10291029
Ok thaniks i thought that the list was very small since if i didnt put the //#CLIENTSIDE most scripts i made didnt work but thank you also one other thing, whats the command for if the person clicks with the left mouse? i thought it was if (leftmousebutton) but that never works
Like what ProjectShifter said, there are many ways to do things on scripting, your question is a proof of that, because you can do it like this:
NPC Code:

if(mousedown && leftmousebutton){
setplayerprop #c,You used the left mouse button!;
}



Or even like this:
NPC Code:

if(mousedown && strequals(#p(0),left)){
setplayerprop #c,You used the left mouse button!;
}



You just forgot to use mousedown.
I think you should start from basic stuff, it is not that hard but is not that easy too for beginners.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
  #39  
Old 06-19-2004, 09:24 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Projectshifter
Because there is no actual creation of the NPC serverside, you can not do if (created) on the serverside, which is why most people call a triggeraction if (created) to perform the function serversided.
Uh. You're thinking of weapons. You can obviously use the created event in other NPCs...
  #40  
Old 06-19-2004, 10:38 PM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Quote:
Originally Posted by Lance
Uh. You're thinking of weapons. You can obviously use the created event in other NPCs...
Heh, Lance just called me out on Debug about this =p Yes, it was in reference to weapons, as if you add a putnpc2 or so, that is created, database NPCs are created and such. Weapons were the topic (hence toweapons/addweapon being the subject), and weapons are not actually created serverside. Other than weapons, other NPCs can be created serverside, weapons are the only exception to this.
-Projectshifter
__________________
Who has time for life these days?
Closed Thread


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 09:08 PM.


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