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 07-10-2002, 01:10 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
Arrays(tiles, direction, ext...)

Okay, I've seen a lot of scripts using arrays for direction and movement. I have never tried arrays, so i was wondering if anyone could help me with how to use them for things such as detecting tiles, such as grass tiles and using them for onwall detection.
Reply With Quote
  #2  
Old 07-12-2002, 06:47 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
Re: Arrays(tiles, direction, ext...)

Quote:
Originally posted by emortylone
Okay, I've seen a lot of scripts using arrays for direction and movement. I have never tried arrays, so i was wondering if anyone could help me with how to use them for things such as detecting tiles, such as grass tiles and using them for onwall detection.
You know that's a good idea.

I'll get back to you when I actually have time to do that.
(work // school)
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #3  
Old 07-14-2002, 05:29 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
NPC Code:

if (weaponfired){
setarray this.check_tiles,3;
setarray this.chang_tiles,3;
this.check_tiles = { 1652,1653,1668,1669};
this.chang_tiles = { 1802,1803,1818,1819};
for (this.t=0;this.t<64+64*64;this.t++){
for (j=0;j<arraylen(this.check_tiles);j++){
if (board[this.t]==this.check_tiles[j]){
board[this.t]=this.chang_tiles[j];
}elseif(board[this.t]==this.chang_tiles[j]){
board[this.t]=this.check_tiles[j];
}
}
}
updateboard 0,0,64,64;
}




This will work.... but only on half of the level.

don't ask me why I don't know. if you notice anything wrong with it tell me.

I would use x and y but that would require a 3 nested loops. That doesn't work for some reason.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
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:53 AM.


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