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.


All times are GMT +2. The time now is 03:02 PM.

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