Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-17-2006, 07:55 PM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
board update help

I almost have this down,
its purpose: to hit bushes just like a sword does.

Problems:
>the bush does not grow back (online)
>the update of the board overwrites the tiles surrounding the board- such as if the bush is near part of a tree, it may take a chunk of tree out to put the removed-bush tile.

HTML Code:
//#CLIENTSIDE
if (weaponfired)
{
 playersprite=33;
 freezeplayer .2;
 putx=playerx+1.5+vecx(playerdir)*2;
 puty=playery+1.5+vecy(playerdir)*2;

 putx = int(putx/2)*2;
 puty = int(puty/2)*2;
 isbush=0;
 for (i=0; i<2; i++) for (j=0; j<2; j++)
  {
    b = board[putx+i+64*(puty+j)];
    bx = b % 16;
    by = int(b / 16);
   //detect bush tiles
    if ((bx==2&&by==0)||
        (bx==2&&by==1)||
        (bx==3&&by==0)||
        (bx==3&&by==1)){
     isbush = 1;
    }
  }

if (isbush==1)
 {
  board[putx+64*puty] = 5+42*16;
  board[putx+1+64*puty] = 6+42*16;
  board[putx+64*(puty+1)] = 5+43*16;
  board[putx+1+64*(puty+1)] = 6+43*16;
  //put bush removed tiles on the level
  updateboard putx,puty,2,2;
  putleaps 0,putx,puty;
 }

}
Any help with getting the board update tiles to be placed correctly would be great please.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:20 PM.


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