Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Drop items (https://forums.graalonline.com/forums/showthread.php?t=36541)

Dragona2002 08-24-2002 06:23 PM

Drop items
 
i wanna know how i can make an NPC that will ad somthing to ur drop items (sword,shield,rupees etc)
so i can drop it i just cant figure it out :grrr:

amonrabr 08-25-2002 12:33 AM

You cant.. just if you make a script to do it, as

..... "
if(keypressed&&keydown(4)&&keydown(5)){this.mode=1 ;}
if(this.mode==1){/* showimg the image until you press something */ if(keypressed){if (keydown(6)){/* drop it*/} else /* hide the image*/}} "...


You could make a system as.. if you press S+A they are the normal items, but if you press S+D they are yours

emortylone 08-25-2002 12:35 AM

Yes, I think it is about IMPOSSIBLE. You can try and do the S+A thing... but then again it will either A) Overwrite the existing ones or B) just totally fux up =/
---Shifter

screen_name 08-25-2002 09:45 AM

you'll have to rewrite the current system, i suggest a gani with all the droppable items as sprites, then use a counter

Amagius 08-25-2002 10:18 AM

I like the S+D Idea without having an NPC, but only if you had patience to add the extra for the NPCServer. If it was an NPC, it's look ugly to have it, but it would be easier.

screen_name 08-25-2002 10:56 AM

it could be a hidden npc, heck include it in system, which should be your first thought anyways

Amagius 08-25-2002 11:27 AM

A Hidden NPC would work.

prozac424242 08-25-2002 12:19 PM

well theres another way...
 
I once added this to a weapon, but for ocnsistency you'd have to add it to all your wepaons;
(im just giving the algorithm here)

if the player wants to drop the weapon Green Goo
The player says 'drop green goo'

The weapon npc in the players inventory is triggered that
and then does the following:
putnpc image name of the weapon, file name of a text file that is exactly the same as the weapon (you have to have a text file on the server/in your folder that you keep up to date for all dorpable weapons) , player vecx/vecy vars so it plops in front of the player.

setplayerprop #c,;

destroy the weapon so it is out of the players inventory
and is there on the screen for that player, or another player, to pick up.

If you plan to do this online be sure you trust your staff.
putnpc was not the most secure command when i was Sanstrata owner. ANyone with file upload to your levels folder
could change that text file to hack and cheat
unless they made it more secure in the past few months.

But there is one way to do it .... have fun and good luck

Python523 08-25-2002 12:22 PM

Re: well theres another way...
 
Quote:

Originally posted by prozac424242
I once added this to a weapon, but for ocnsistency you'd have to add it to all your wepaons;
(im just giving the algorithm here)

if the player wants to drop the weapon Green Goo
The player says 'drop green goo'

The weapon npc in the players inventory is triggered that
and then does the following:
putnpc image name of the weapon, file name of a text file that is exactly the same as the weapon (you have to have a text file on the server/in your folder that you keep up to date for all dorpable weapons) , player vecx/vecy vars so it plops in front of the player.

setplayerprop #c,;

destroy the weapon so it is out of the players inventory
and is there on the screen for that player, or another player, to pick up.

If you plan to do this online be sure you trust your staff.
putnpc was not the most secure command when i was Sanstrata owner. ANyone with file upload to your levels folder
could change that text file to hack and cheat
unless they made it more secure in the past few months.

But there is one way to do it .... have fun and good luck

hes talking about the DEFAULT thing built into graal where you press s+a to drop items

Dragona2002 08-25-2002 03:14 PM

o.O difficult i c i like prozacs idea and nice weapon name
Green goo XD

screen_name 08-25-2002 03:31 PM

You don't want to do it prozac's way.

He needs to catch up on some serverside scripting

NPC Code:

if (playerchats && strequals(#c,drop purple nurple)) {
removeweapon purple nurple;
putnpc2 playerx+1.5+vecx(playerdir)*2,playery+2+vecy(playe rdir)*2 {
if (created) {
setshape 0,32,32;
setimg purplenurple.png;
}
if (playertouchsme) {
addweapon purple nurple;
destroy;
}
};
}


Dragona2002 08-25-2002 09:15 PM

well thx screen !

another question (i will never end = P)

how do i make a NPC that if u drop an Gold Gralat
(or red,blue,green)
it will make an gani of the gralat instead of dropping it and if touch it....u will get ur rupees though.... just like Bravo and G2k1
etc..

prozac424242 08-25-2002 09:22 PM

new commands?
 
Whered you get those new commands?
removeweapon is not found when i run it though Graal and click Test, causes an error.
Putnpc2 is not in newfeatures2001 or newfeatures2002,
where did you get it?

I started scripting in graal 1.28 and was a big mover for getting Stefan to add functions, how do you keep up on the latest unpublished commands?

And I never had and currently do not have an npc server to work with, and therefore no reason to be informed of serverside stuff...
unless y'all tell me...

Especialy since i'd like to add them to my NPC Command Search Engine (linked below) and bring that up to date!

emortylone 08-25-2002 11:18 PM

Ah Prozac, it is ALL thanks to the wonders of the NPC Server. Stefan didn't include support for NPC Server commands into the level editor =/ He should though, it gets VERY annyoing elsewise :( But if you'd like, I think I've got some tutorials or something, or I could explain a bit to you if you'd like. You won't find the commands listed anywhere. Good explanation btw ScreeN Name, that is how I would've suggested it if you hadn't already ;) but he wanted A+S stuff, not that, that was easy to do though =P
---Shifter

AlexH 08-26-2002 12:03 AM

Re: new commands?
 
Quote:

Originally posted by prozac424242
Whered you get those new commands?
removeweapon is not found when i run it though Graal and click Test, causes an error.
Putnpc2 is not in newfeatures2001 or newfeatures2002,
where did you get it?

I started scripting in graal 1.28 and was a big mover for getting Stefan to add functions, how do you keep up on the latest unpublished commands?

And I never had and currently do not have an npc server to work with, and therefore no reason to be informed of serverside stuff...
unless y'all tell me...

Especialy since i'd like to add them to my NPC Command Search Engine (linked below) and bring that up to date!

Need NPC Server tha's why your getting the error message.
And the command bits like you would find arein the NPC Server document with the somewhat older commands fr it.

prozac424242 08-26-2002 12:46 AM

aha!
 
me finds the Search button at the top of this page useful..
enter 'scriptign documentation'


http://forums.graal2001.com/forums/a...?postid=503471

there is the list as of this march of all commands, enterd by Stefan

*goes to update npc search engine*

Dragona2002 08-26-2002 03:03 AM

More commands X.x

Dragona2002 08-26-2002 05:05 PM

another question (i will never end = P)

how do i make a NPC that if u drop an Gold Gralat
(or red,blue,green)
it will make an gani of the gralat instead of dropping it and if touch it....u will get ur rupees though.... just like Bravo and G2k1
etc..

X.x

Aruchinjiru 08-26-2002 05:28 PM

Re: new commands?
 
Quote:

Originally posted by prozac424242
Whered you get those new commands?
removeweapon is not found when i run it though Graal and click Test, causes an error.
Putnpc2 is not in newfeatures2001 or newfeatures2002,
where did you get it?

I started scripting in graal 1.28 and was a big mover for getting Stefan to add functions, how do you keep up on the latest unpublished commands?

And I never had and currently do not have an npc server to work with, and therefore no reason to be informed of serverside stuff...
unless y'all tell me...

Especialy since i'd like to add them to my NPC Command Search Engine (linked below) and bring that up to date!

Here you go. Don't ask me where I got it, I don't really remember but I have had it for atleast a month now.

This is the updated commands.rtf file. If someone has a problem with me uploading this then delete the post because I'm not sure if I'm even supposed to have it. x_x

Updated and color coated Commands.rtf

When the page loads go to file and click saveas and save it to your desktop or graal directory.

Note: This document includes serverside commands, clientside only commands and commands that only work on 2k1 or 2k2 due to they are the only ones with .GMAPs

If this document is illegal to have then I am sorry, it was given to me but I forget who gave it to me. (it shouldn't be anyway, its just a updated commands.rtf which needs to be put up really bad anyway)

Dragona2002 08-26-2002 05:53 PM

-_- man i need my question aswered and you just talk thru ,me and go on with an own treath in a treath bout my questions X.x

Aruchinjiru 08-27-2002 02:46 AM

Quote:

Originally posted by Dragona2002
-_- man i need my question aswered and you just talk thru ,me and go on with an own treath in a treath bout my questions X.x
heh, I simply replied to someones post in this thread.

prozac424242 08-27-2002 05:11 AM

thanks!
 
Hey thanks for the file,
i overwrote the c:\graal\commands.rtf
and now i have it in the gscripting commands list box! U R B AWESOME!

screen_name 08-27-2002 06:48 AM

lol

You really should learn how to serverside script. It's much easier. :P

emortylone 08-27-2002 10:48 PM

LOL, I am looking @ it now... I was actually working on my own new version of commands.rtf that has like if commands sorted, better explanations and such, but if it's good then there isn't a point in me finishing =P Here is PART of the code you're looking for, I made it a few weeks ago when someone asked me how to have it detect when a gold rupee is dropped. I won't give you the full script (I'm not THAT nice!) but you should be able to find some way to modify it:
[code]
if (created)
{ this.money=playerrupees;
timeout=0.25;
}
if (timeout)
{ if (playerrupees=this.money+100)
{ actions; //this is where you put in what you want to happen
}
timeout=0.25;
}
---Shifter

screen_name 08-28-2002 02:52 AM

Quote:

Originally posted by emortylone
LOL, I am looking @ it now... I was actually working on my own new version of commands.rtf that has like if commands sorted, better explanations and such, but if it's good then there isn't a point in me finishing =P Here is PART of the code you're looking for, I made it a few weeks ago when someone asked me how to have it detect when a gold rupee is dropped. I won't give you the full script (I'm not THAT nice!) but you should be able to find some way to modify it:
[code]
if (created)
{ this.money=playerrupees;
timeout=0.25;
}
if (timeout)
{ if (playerrupees=this.money+100)
{ actions; //this is where you put in what you want to happen
}
timeout=0.25;
}
---Shifter

please tell me thats not how you script. X.x



ps. i pmed stefan about your account shifter, he said that it looks fine, X.x

Aruchinjiru 08-28-2002 03:19 AM

Re: thanks!
 
Quote:

Originally posted by prozac424242
Hey thanks for the file,
i overwrote the c:\graal\commands.rtf
and now i have it in the gscripting commands list box! U R B AWESOME!

Your welcome. I just want to share what I have with everyone. I think I may send it to Stefan or Unix for the next Graal version or something so that a updated version of the commands.rtf will be out for everyone. :)

emortylone 08-28-2002 07:04 AM

LOL, I know a few things that were missing, some things you didn't know how to correctly use, and some things that were mislabled, but good job. HELL NO, I do NOT EVER script like that! It is just when I'm in school, in a rush, or don't give a crap or are annoyed that I just throw together coding =P
---Shifter

Dragona2002 08-31-2002 03:19 AM

i want the bestest Comands.RTF with server side incl ....

i already printed the normal 1 and prozacs 1 XD

-darkrazor-


All times are GMT +2. The time now is 05:22 PM.

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