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 10-25-2001, 02:26 AM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
Arrays and tiles[x,y]

How would I go about making an array store multiple values for the tiles command?

For example, I tried something like this:
NPC Code:

if (weaponfired) {
this.tilesid= {2047,116};
if (tiles[playerx,playery]==this.tilesid) {
setplayerprop #c,this works;
}
}



Why does this not work? What is the proper way of doing this?
Reply With Quote
  #2  
Old 10-25-2001, 05:13 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
Re: Arrays and tiles[x,y]

Quote:
Originally posted by Thak2
How would I go about making an array store multiple values for the tiles command?

For example, I tried something like this:
NPC Code:

if (weaponfired) {
this.tilesid= {2047,116};
if (tiles[playerx,playery]==this.tilesid) {
setplayerprop #c,this works;
}
}



Why does this not work? What is the proper way of doing this?
if (this.tilesid=0) message this is right;
if (this.tilesid[0]=2047) message and so is this;
if (this.tilesid[1]=116) and this;
Reply With Quote
  #3  
Old 10-25-2001, 05:16 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
never tried the tiles-command before so I can't tell u the right way but this can't work because the array
this.tilesid is not seen as 2047,116
no every number in an array is seen as an single element

so this.tilesid[0] is 2047 and this.tilesid[1] is 116
__________________
No Webhost at the moment
Reply With Quote
  #4  
Old 10-25-2001, 06:17 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
NPC Code:

if (weaponfired) {
this.tilesid={2047,116};
if (tiles[playerx,playery] in this.tilesid) {
setplayerprop #c,this works;
}
}


That will make it work.
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #5  
Old 10-25-2001, 07:58 AM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
Thanks Boco, works quite good now.
Reply With Quote
  #6  
Old 10-26-2001, 03:39 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
ok where did tiles[x,y] come from? and why didn't you tell me?

Signed,
Rogue Shadow
Reply With Quote
  #7  
Old 10-26-2001, 04:00 AM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
new stuff to replace board[STUDIP NUMBERS ERE]
Reply With Quote
  #8  
Old 10-26-2001, 04:02 AM
Aknts Aknts is offline
Level Designer
Aknts's Avatar
Join Date: Apr 2001
Location: USofA
Posts: 3,340
Aknts will become famous soon enough
Send a message via AIM to Aknts
Thak what tiles are those supposed to be?
__________________
Reply With Quote
  #9  
Old 10-26-2001, 04:13 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
Talking

Some special top secret tiles, never seen before better then everything else ;D
__________________
No Webhost at the moment
Reply With Quote
  #10  
Old 10-26-2001, 04:44 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
Quote:
Originally posted by Saga2001
ok where did tiles[x,y] come from? and why didn't you tell me?

Signed,
Rogue Shadow
introduced in 2.1
Reply With Quote
  #11  
Old 10-26-2001, 06:55 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by btedji


introduced in 2.1
lol that explains it I don't have 2.1

and I have no clue where to get it.

I keep hearing about it. and how everyone knows about it.

but I don't know where to get it
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
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 12:45 PM.


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