Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Laying a custom item (https://forums.graalonline.com/forums/showthread.php?t=18991)

LordMatt 12-16-2001 03:53 AM

Laying a custom item
 
Can someone help me with laying a custom item, I just want it where if (weaponfired) it lays a custom npc at ur x and y with all the scripting in it. Can someone help?

Torankusu 12-16-2001 03:55 AM

if (weaponfired)
{ putnpc imagename.png/gif,text/scriptfile.txt,playerx,playery;
}

Knight_Vincent 12-16-2001 05:13 AM

Hmm,

Now for a better example.

NPC Code:

//NPC made by Lord Vincent

if (playertouchsme) {
toweapons Example;
}

if (weaponfired) {
putnpc example.gif,example.txt,playerx+1,playery+1;
}


mikepg 12-16-2001 05:33 AM

umm
 
btw: the example.txt has to have regular NPC coding in it, just as if you typed it in graal.

So, in the text file, you might want to have...

if (playerenters) {message Hi; sleep 1; message bye; sleep 2; destroy;
}


if you have a .txt file of your homework for science class, chances are, it wont work, lol.

Python523 12-16-2001 05:48 AM

Quote:

Originally posted by Knight_Vincent
Hmm,

Now for a better example.

NPC Code:

//NPC made by Lord Vincent

if (playertouchsme) {
toweapons Example;
}

if (weaponfired) {
putnpc example.gif,example.txt,playerx=1,playery=1;
}


I think it's
putnpc example.gif,example.txt,1,1;
no playerx='s or playery='s in it

Torankusu 12-16-2001 05:50 AM

Quote:

Originally posted by Python523

I think it's
putnpc example.gif,example.txt,1,1;
no playerx='s or playery='s in it

You need playerx/y, or else it'll go to the coordinates listed in the level.
e.x:

putnpc door.gif,door.txt,30,30;
That will show the door image at the 30,30 coordinates of the level.

AlexH 12-16-2001 05:51 AM

know whats so funny about your "better" example?
its wrong
it should be

NPC Code:

if (playertouchsme) {
toweapons Example;
}

if (weaponfired) {
putnpc example.gif,example.txt,playerx+1,playery+1;
}



+ not =

entravial 12-16-2001 05:52 AM

~AlphaFlame~

But not playerx/y=... you don't set a value inside a putnpc command =/

Python523 12-16-2001 05:54 AM

Quote:

Originally posted by Torankusu
You need playerx/y, or else it'll go to the coordinates listed in the level.
e.x:

putnpc door.gif,door.txt,30,30;
That will show the door image at the 30,30 coordinates of the level.


But if you want it to be there then
putnpc door.gif,door.txt,30,30;
if the right way

AlexH 12-16-2001 05:57 AM

it is

putnpc img,txtfile,x,y

so putnpc door.gif,door.txt,30,30;
would put a door at 30,30 and toran rightfully said

and putnpc example.gif,example.txt,playerx+1,playery+1;
as i said would put an example npc at playerx+1 and playery+1

Python523 12-16-2001 05:58 AM

Quote:

Originally posted by AlexH
it is

putnpc img,txtfile,x,y

so putnpc door.gif,door.txt,30,30;
would put a door at 30,30 and toran rightfully said

and putnpc example.gif,example.txt,playerx+1,playery+1;
as i said would put an example npc at playerx+1 and playery+1


I think we all know what it does and how it works but we're confusing each other by explaining it the wrong way

AlexH 12-16-2001 06:00 AM

Quote:

Originally posted by Python523

[COLOR=red][FONT=New Times Roman]
I think we all know what it does and how it works but we're confusing each other by explaining it the wrong way

no ones explaing it the wrong way besides the guy who said the bit about playerx=1,playery=1

kp_p2p 12-16-2001 06:21 AM

errr
 
btw in the txt, it would be better if it was if(created) not if(playerenters).

Torankusu 12-16-2001 06:45 AM

Quote:

Originally posted by Python523

But if you want it to be there then
putnpc door.gif,door.txt,30,30;
if the right way

I know, but it isn't the right way when the person that started this thread asked for the playerx and playery.

royce 12-16-2001 08:06 AM

this is probably for andor so use putnpc2 and you dont need the test i dont think.....i am pretty sure, thats the advantage


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

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