Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-01-2001, 11:44 AM
Guest
Posts: n/a
help me out will ya...(boards)

yes hi....uhmm... with the boards where you change tiles...
with updateboard etc...how do you know what tile has what id????
i mean it takes me hours to find the right tile i want...
please help me out, and please do not spam this topic...
Reply With Quote
  #2  
Old 08-01-2001, 05:23 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Basically, you can get a tile's id by doing this:
board[x+y*64]
In which x and y are the x and y positions of the tile in the level
However if you want to know the ID of a tile to replace it with you use the following calculation:
tilex+tiley*16
tilex and tiley are displayed under he location from which you normally select tiles in the editor if you hold your mouse over a tile.
updateboard then needs to be done after any tile changes to make it visible, although the changes can only be seen by the player who is "running" the script.
__________________

Reply With Quote
  #3  
Old 08-01-2001, 10:37 PM
Guest
Posts: n/a
thank you,
I was looking for that (tilex+tiley*16)
Reply With Quote
  #4  
Old 08-02-2001, 07:38 AM
Guest
Posts: n/a
I got another question about this...
is it possible that you can add something in the code to let more tiles change without pasting everytime

board[blabla]=blabla;
updateboard blabla;?

please help me out cause I'm annoying myself as hell of all that pasting
maybe i didn't saw something...but thats cause its 2:42 am so please do not think i'm asking something stupid...
thank you
Reply With Quote
  #5  
Old 08-02-2001, 07:53 AM
Guest
Posts: n/a
nm
i also just can use variables like this.x and this.y
...
Reply With Quote
  #6  
Old 08-02-2001, 08:35 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
what do you mean ?
you can run a function ..
but the code would be like

board[x+64*y]=tilex+16*tiley;
updateboard x,y,1,1;

or whatever...
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #7  
Old 08-02-2001, 09:20 AM
Guest
Posts: n/a
i know that liquid
but i mean i wanted to know if i can change more tiles in one code so i don't have to copy and paste a million times
but now i tried this and it worked

board[this.x+this.y*64]=tilex+tiley*16;
updateboard this.x,this.y,1,1;

now add a timeout out and stuff and you're done...
please correct me if i'm wrong..
Reply With Quote
  #8  
Old 08-02-2001, 09:35 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
put this on a playertouchme or weaponfired
updateboard HouseGround;
Reply With Quote
  #9  
Old 08-02-2001, 09:36 AM
Poogle Poogle is offline
Registered User
Poogle's Avatar
Join Date: Jun 2001
Posts: 2,471
Poogle is on a distinguished road
oh yeah! add x and y to player(x and y)
Reply With Quote
  #10  
Old 08-02-2001, 01:25 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by thotijn2
i know that liquid
but i mean i wanted to know if i can change more tiles in one code so i don't have to copy and paste a million times
but now i tried this and it worked

board[this.x+this.y*64]=tilex+tiley*16;
updateboard this.x,this.y,1,1;

now add a timeout out and stuff and you're done...
please correct me if i'm wrong..
I would just make a function and call it netime i need to change something
like I would make

NPC Code:

this.tilex=20;
this.tiley=18;
this.x=10;
this.y=30;
replacetile();

function replacetile() {
board[this.x+this.y*64]=this.tilex+this.tiley*16;
updateboard this.x,this.y,1,1;
}

__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
Reply


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 01:39 AM.


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