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 05-25-2004, 04:50 AM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
How to drop items?

This works fine ofline for me,
but what do I need to do to make it work with npc server?

if (strtofloat(#s(client.stuff)) >=1) {
if (playerchats && strequals(#c,drop)) {
putnpc potion.gif,bpotion.txt,playerx,playery;
setplayerprop #c,Dropped;
sleep 0.1;
setstring client.stuff, #v(strtofloat(#s(client.stuff))-1);
}

Also should the npc txt. file be saved to levels/scripts or am I a complete idiot?
Reply With Quote
  #2  
Old 05-25-2004, 05:38 AM
EsCanavi EsCanavi is offline
No Longer Graalian.
EsCanavi's Avatar
Join Date: Oct 2003
Location: ..:: Lassomption/Quebec/Canada ]::...
Posts: 214
EsCanavi is on a distinguished road
Send a message via AIM to EsCanavi Send a message via MSN to EsCanavi
script it serverside with

triggeraction 0,0,serverside,npcname,param1,p2,p3,p4...etc...

and a if ( actionserverside )
if ( strequals( #p(1),drop )

putnpc2 playerx,playery,{ script or class like join thiscalss;};

etc... well not sure about the syntax of #p(1) havent scripter far a while of course..
__________________
:: Free Gift... 40$ ::
:: WrsHosting ::
:: Need a webhost, contact me ( free ) 99.9% Online ::
Contact me: [email protected] (msn|mailbox)
Reply With Quote
  #3  
Old 05-25-2004, 05:44 AM
DIABLO2099 DIABLO2099 is offline
Registered User
Join Date: Sep 2002
Location: New York
Posts: 290
DIABLO2099 is on a distinguished road
The document is placed where the level is. (same folder)
__________________
-Former UnholyNation Server Manager.

Call me Xecutor.
Reply With Quote
  #4  
Old 05-25-2004, 06:07 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
putnpc is deprecated. Don't use it.

Sigh.

Oh, and Es - the first argument sent is read as #p(0) serverside.

I'll further note that what Es described is the script of a weapon.
Reply With Quote
  #5  
Old 05-25-2004, 08:16 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Yes, if you want it for a non-NPCW (non-weapon) then have it something like:

NPC Code:
if (created) setshape 1,1,1;
if (actionblah) {
putnpc2 x,y,{script;};
}
//#CLIENTSIDE
if (playertouchsme) triggeraction x,y,blah,param0,param1,param2,ect...;


That is just an example though ;
You can tweak it how you want (for the script part I suggest just having the script a one line command called "join classname;" and then put your script of the npc you drop into a class called "classname")

[EDIT]
Quote:
Originally Posted by Salaisuus
Also should the npc txt. file be saved to levels/scripts or am I a complete idiot?
The scripts folder is just the folder where classes are stored and should only be used for BACKUP perposes (sp?).
IF putnpc where to be used (which it shouldn't be) you would save it in a folder with the levels folder (or levels it self) and then put into the folder options: "file *.txt"
Or if it was in a sub folder in levels: "file subfoldername/*.txt"
Notice you DON'T include the levels/ part as everything in folder ops automaticly includes that for you
[/EDIT]
__________________
Do it with a DON!
Reply With Quote
  #6  
Old 05-25-2004, 08:20 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
Quote:
Originally Posted by zokemon
playertouchesme
playertouchsme

Also, you're telling him to join 'classname' and to make a class called 'callname'. These should not be differently named...

Edit: Thank you for fixing. ^_^
Reply With Quote
  #7  
Old 05-25-2004, 08:22 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Lance
playertouchsme

Also, you're telling him to join 'classname' and to make a class called 'callname'. These should not be differently named...
That is what we call "typos"
__________________
Do it with a DON!
Reply With Quote
  #8  
Old 05-25-2004, 08:23 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
Quote:
Originally Posted by zokemon
That is what we call "typos"
I know, but the average newbie scripter who searches for help does not.
Reply With Quote
  #9  
Old 05-25-2004, 06:42 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally Posted by zokemon
That is what we call "typos"

Hehe. It's a paradox typo. It's wrong either way.
Reply With Quote
  #10  
Old 05-26-2004, 03:52 AM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
Eh eh eh?

Whats the

if ( strequals( #p(1),drop )

part for exactly?

I cant get it to work, I cant get anything to work. You people confuse me.
Reply With Quote
  #11  
Old 05-26-2004, 03:40 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 Salaisuus
Also should the npc txt. file be saved to levels/scripts or am I a complete idiot?
Option 2 sir.
__________________
"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
  #12  
Old 05-26-2004, 05:36 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
First learn to walk before trying to run, buddy.
__________________
"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
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 09:24 AM.


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