Graal Forums

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

MrSmiles 01-12-2002 08:05 AM

teh Boat
 
1 Attachment(s)
Hi,
I recently posted the thread Boat Script and since have been ale to script my own. The problem is that the boat only stays in one level and will go over land... I need it to stay on water... can anyone help?

Cheers

MrSmiles :D

Python523 01-12-2002 08:08 AM

Use canwarp for the warping thing but it will only work with the NPC Server

MrSmiles 01-12-2002 08:09 AM

I used canwarp... :(

-MrSmiles (It will be on p2p server)

LiquidIce00 01-12-2002 09:40 AM

canwarp and all that doesnt work offline only online

plz dont rock my boat *rocks the boat*

Shard_IceFire 01-12-2002 10:27 AM

Re: teh Boat
 
(Sorry I can't help on this but) You guys seem to have forgotten the main part of his post:
Quote:

Originally posted by MrSmiles
I need it to stay on water... can anyone help?


LiquidIce00 01-12-2002 12:04 PM

if (onwater(x,y)) { blabla; }

Goboom 01-13-2002 09:53 AM

use attachplayertoobj....

Sennema 01-15-2002 08:33 AM

Just have it check for a non-water tile ahead of the boat (!onwater(x,y)) might work, but I haven't bothered to check. Then if there is land ahead of the boat, make it not move forward or stop or blow up or whatever.

Mrmicro 01-16-2002 04:01 AM

Graal2k1 cant manage to make there boats stay on water.. haha

AlexH 01-16-2002 04:25 AM

Quote:

Originally posted by Mrmicro
Graal2k1 cant manage to make there boats stay on water.. haha
the reason for that is that the boat is quite a large gfx and it reads the x and y co-ordinates of everything in graal from the top left corner of the gfx so thats what makes the NPC go a lil onto land

Mrmicro 01-16-2002 04:46 AM

Try this for it to stay off land



PHP Code:

    // Check for walls
    
setarray wall,6;
    for (
j=0j<6j++)
      
wall[j] = onwall(newx+this.walltest[i*12+j*2],
        
newy+this.walltest[i*12+j*2+1]);

    
// Test for walls in front;
    
if (wall[0]==true || wall[1]==true || wall[2]==true || wall[3]==true) { 


If it needs anything else tell me


All times are GMT +2. The time now is 10:50 PM.

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