Graal Forums

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

ownerofbabylon 08-13-2001 07:05 PM

Onwall
 
I feel like an idiot but I just saw a post on why onwall would work and that made me think about somthing. Can someone explain to me how onwall works?

SkooL 08-13-2001 07:57 PM

if (onwall(x,y)) {thestuffgoeshere;} So if the NPCs x and y coordinates are on a wall/tile that cannot be walked on...the things in the brackets occur.

ownerofbabylon 08-13-2001 11:01 PM

Ok, the main thing i have a problem with is how would you get a whole area like that? Sorta make a block of the x and y. So say you wanted somthing to happen when a whole certain area was touched?

Xaviar 08-13-2001 11:12 PM

Quote:

Originally posted by ownerofbabylon
Ok, the main thing i have a problem with is how would you get a whole area like that? Sorta make a block of the x and y. So say you wanted somthing to happen when a whole certain area was touched?
I dont understand...Are you looking for a certain area? Or are you just checking to see if a large chunk of land is onwall?

LiquidIce00 08-14-2001 12:28 AM

I suggest you use
!onwall(x,y) to do player onwall..
player onwall kinda bothers me to make and to explain..
I dont have any examples . i had some but i dont know where it ended up..
I suggest you make an array with like .25,.5,.75,1,1.25 and then just the values for the x,y . and theres a tutorial by Ace too that explains well which tiles Graal checks for the player..

ownerofbabylon 08-14-2001 01:58 AM

say for mining or fishing u just want the weapon to fire on a certain block of area. Thats what I mean

LiquidIce00 08-14-2001 02:11 AM

Quote:

Originally posted by ownerofbabylon
say for mining or fishing u just want the weapon to fire on a certain block of area. Thats what I mean
if you just wnat like fishing in the water then you use board..
if you want mining but like on a npc u made then use triggeraction or callnpc+testnpc..

here is a code for board[] on water =)

NPC Code:

this.x=int(playerx+1.5+(vecx(playerdir)*3));
this.y=int(playery+2+(vecy(playerdir)*3));
this.canfish=board[this.x+(64*this.y)];
if (this.canfish=322) { fish code here }



322 is the index of the water tile(the swimmable one)

Xaviar 08-14-2001 02:13 AM

Quote:

Originally posted by ownerofbabylon
say for mining or fishing u just want the weapon to fire on a certain block of area. Thats what I mean
Well for that you jus wanna use board[index] to tilecheck....someone check my figures on this cause I dont got my notes on hand, and I almost never use board...but it goes like this (I think)

board[x + y*64] = bx + by*16

x and y are is the loc you want to check, and bx and by are the x and y values of the tile it returns (on the tileboard on the bottom right of the level editor)...I forget the math too...but you can use a formula to pull bx and by out of the responce it gives you...
(someone post the math?)

Xaviar 08-14-2001 02:14 AM

Gah...or just do what liquidice said and add em up for when you check it =/ Course...if its water your checking..jus use onwater

LiquidIce00 08-14-2001 02:23 AM

Quote:

Originally posted by Xaviar
Gah...or just do what liquidice said and add em up for when you check it =/ Course...if its water your checking..jus use onwater
yeah onwater is easier ..
but that u can use for other stuff


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

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