| Mirage Source http://miragesource.net/forums/ |
|
| Array http://miragesource.net/forums/viewtopic.php?f=201&t=1673 |
Page 1 of 2 |
| Author: | Boo [ Tue Apr 17, 2007 2:33 am ] |
| Post subject: | Array |
Can someone help me, whats an array? I've tried to rip over Arrows but when I click Run, it highlights 'Map' and says Expected Array... If x >= 0 And x <= MAX_MAPX Then If y >= 0 And y <= MAX_MAPY Then If Map(GetPlayerMap(MyIndex)).Tile(x, y).Type = TILE_TYPE_BLOCKED Then Player(Index).Arrow(z).Arrow = 0 End If End If End If |
|
| Author: | Lea [ Tue Apr 17, 2007 3:22 am ] |
| Post subject: | |
An array is like a stack of boxes. You determine the height of the stack when you declare the array. When you do Array(0) it would be the bottom of the stack, when you pick Array(1) it's the next up, array(100) would be the 100'th stack. It's just a bunch of variables under the same name, seperated by numbers. |
|
| Author: | Spodi [ Tue Apr 17, 2007 3:29 am ] |
| Post subject: | |
Take this for example: Code: Dim i(1 to 3) As Integer i(1) = 100 i(2) = 50 i(3) = 25 Code: Dim i1 as integer dim i2 as integer dim i3 as integer i1 = 100 i2 = 50 i3 = 25 Exact same code. Except for with arrays, you can perform bulk operations. Code: dim i(1 to 10000) as long
dim j as long For j = lbound(i) to ubound(i) i(j) = j \ i + i next j Now try doing THAT without arrays. |
|
| Author: | Boo [ Tue Apr 17, 2007 9:48 pm ] |
| Post subject: | |
alright thankyou, i'll try and fix my bug |
|
| Author: | Matt [ Wed Apr 18, 2007 12:56 pm ] |
| Post subject: | |
If you're trying to rip the ranged weapons system from ES, you truly are an idiot. There is a tut floating around for this, by me, using the ES system. If it's not on the forums, it IS on Robin's and Cruel's back up of them. So ask them. |
|
| Author: | Da Undead [ Thu Apr 19, 2007 11:21 pm ] |
| Post subject: | |
| Author: | Rian [ Fri Apr 20, 2007 12:20 am ] |
| Post subject: | |
Try searching the forums, they're around someone. I don't have much time to look myself right now, I'm at work |
|
| Author: | JokeofWeek [ Fri Apr 20, 2007 12:48 am ] |
| Post subject: | |
If you're on the client, Map isn't an array |
|
| Author: | Rian [ Fri Apr 20, 2007 12:56 am ] |
| Post subject: | |
It is in Elysium though, I think. |
|
| Author: | JokeofWeek [ Fri Apr 20, 2007 1:48 am ] |
| Post subject: | |
Sonire wrote: It is in Elysium though, I think.
Exactly, which is why he's getting this error. On Elysium, Map is an Array, but not on Mirage Source, thus the error |
|
| Author: | Da Undead [ Fri Apr 20, 2007 2:09 am ] |
| Post subject: | |
;( oh well, deleted the whole thing from the source... But i searched forums and couldnt find any arrow/bow tuts :\ |
|
| Author: | Rian [ Fri Apr 20, 2007 2:16 am ] |
| Post subject: | |
Don't look for the tut, look for the Tutorial Database hosted by Robin and Cruel |
|
| Author: | Da Undead [ Fri Apr 20, 2007 2:20 am ] |
| Post subject: | |
oh hmm k |
|
| Author: | JokeofWeek [ Fri Apr 20, 2007 2:31 am ] |
| Post subject: | |
Da Undead wrote: oh hmm k
You know, you could've just changed the line to : Code: If Map.Tile(x, y).Type = TILE_TYPE_BLOCKED Then
|
|
| Author: | Da Undead [ Fri Apr 20, 2007 4:32 am ] |
| Post subject: | |
gah tolate >.> xD |
|
| Page 1 of 2 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|