[Solved]ArrayOutOfBoundsException
Moderator: Plugin Moderators
- Mayor Jeffrey IX
- TheoTown Cartographer
- Reactions:
- Posts: 988
- Joined: 05 Apr 2017, 16:48
- Location: Right here
- Plugins: Showcase Store
-
Platform
[Solved]ArrayOutOfBoundsException
Problem is as follows:
Plugin Error
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
Plugin Error
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
Or is it?
Using 295.
Using 295.
- Mayor Jeffrey IX
- TheoTown Cartographer
- Reactions:
- Posts: 988
- Joined: 05 Apr 2017, 16:48
- Location: Right here
- Plugins: Showcase Store
-
Platform
I have all seven frames (wr1, wr2, wr3, wr4, wr5, wr6, basewindmill).
Last edited by Mayor Jeffrey IX on 01 May 2017, 20:00, edited 1 time in total.
Or is it?
Using 295.
Using 295.
- Lobby
- Developer
- Reactions:
- Posts: 3705
- Joined: 26 Oct 2008, 12:34
- Plugins: Showcase Store
- Version: Beta
-
Platform
It would be a lot more easy if you could paste the code directly into the forum using the
Code: Select all
-tags. Also the error message tells you where it occurred, that might be helpful.
It's most likely that there's a mistake in your image names.
- Mayor Jeffrey IX
- TheoTown Cartographer
- Reactions:
- Posts: 988
- Joined: 05 Apr 2017, 16:48
- Location: Right here
- Plugins: Showcase Store
-
Platform
Code: Select all
[
{
"id": "wind_rotor01",
"type": "animation",
"frames": [
{"bmp": "wr1.png"},
{"bmp": "wr2.png"},
{"bmp": "wr3.png"},
{"bmp": "wr4.png"},
{"bmp": "wr5.png"},
{"bmp": "wr6.png"}
]
},
{
"id":"floatingwindturbine",
"width": 4,
"height": 4,
"frames": [{"bmp":"basewindturbine.png"}],
"type": "energy",
"needs water": true,
"needs land": false,
"power": 1000,
"draw ground":true,
"price": 8000,
"monthly price": 60,
"needs road": false,
"water": 0,
"influence noise": 35,
"animation":[{"id":"wind_rotor01","x":0,"y":-85}],
"requirement": {
"requirements":
[
{
"type": "HABITANT_COUNT",
"data": {
"count": 300
}
}
]
}
}
]
Or is it?
Using 295.
Using 295.
- Mayor Jeffrey IX
- TheoTown Cartographer
- Reactions:
- Posts: 988
- Joined: 05 Apr 2017, 16:48
- Location: Right here
- Plugins: Showcase Store
-
Platform
- BetterBear
- Inhabitant of a Galaxy Cluster
- Reactions:
- Posts: 2896
- Joined: 18 Apr 2017, 09:03
- Location: In a place you don't expect.
- Plugins: Showcase Store
- Version: Beta
-
Platform
I think because he wroteMayor Jeffrey IX wrote:So do you have an idea of what could be wrong?
Code: Select all
"type": HABITANT_COUNT,
Code: Select all
"type":"energy",
BEaRz ArE AmAZiNG. I Am FeElIng SlEepY..
- Josh
- Graphic designer
- Reactions:
- Posts: 2214
- Joined: 11 Mar 2017, 19:20
- Location: The Netherlands
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
Or do you mean how many habitants, than instead of
You need to do
Code: Select all
"type": "HABITANT_COUNT",
"data": {
"count": 300
Code: Select all
"habitans":300
- Mayor Jeffrey IX
- TheoTown Cartographer
- Reactions:
- Posts: 988
- Joined: 05 Apr 2017, 16:48
- Location: Right here
- Plugins: Showcase Store
-
Platform
@BetterBear
This
is a seperate line of code, and if you look at the top, you'll see
I know this works 'cause I've used this in other plugins.
@Lobby
Hmmm that's odd... not sure what could cause that.
This
Code: Select all
"requirement": {
"requirements":
[
{
"type":"HABITANT_COUNT",
"data": {
"count": 300
}
}
]
}
Code: Select all
"type": "energy",
@Lobby
Hmmm that's odd... not sure what could cause that.
Or is it?
Using 295.
Using 295.
- CommanderABab
- AB
- Reactions:
- Posts: 11109
- Joined: 07 Jun 2016, 21:12
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
- Mayor Jeffrey IX
- TheoTown Cartographer
- Reactions:
- Posts: 988
- Joined: 05 Apr 2017, 16:48
- Location: Right here
- Plugins: Showcase Store
-
Platform
- Mayor Jeffrey IX
- TheoTown Cartographer
- Reactions:
- Posts: 988
- Joined: 05 Apr 2017, 16:48
- Location: Right here
- Plugins: Showcase Store
-
Platform
- CommanderABab
- AB
- Reactions:
- Posts: 11109
- Joined: 07 Jun 2016, 21:12
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
- Mayor Jeffrey IX
- TheoTown Cartographer
- Reactions:
- Posts: 988
- Joined: 05 Apr 2017, 16:48
- Location: Right here
- Plugins: Showcase Store
-
Platform
- Mayor Jeffrey IX
- TheoTown Cartographer
- Reactions:
- Posts: 988
- Joined: 05 Apr 2017, 16:48
- Location: Right here
- Plugins: Showcase Store
-
Platform
I figured out the problem!
It turns out I need to put an actual number of frames.
For example:
I need to change this
to this
That count specifies how many frames there are.
It turns out I need to put an actual number of frames.
For example:
I need to change this
Code: Select all
[
{
"id": "wind_rotor01",
"type": "animation",
"frames": [
{"bmp": "wr1.png"},
{"bmp": "wr2.png"},
{"bmp": "wr3.png"},
{"bmp": "wr4.png"},
{"bmp": "wr5.png"},
{"bmp": "wr6.png"}
]
},
Code: Select all
[
{
"id": "wind_rotor01",
"type": "animation",
"count": 6,
"frames": [
{"bmp": "wr1.png"},
{"bmp": "wr2.png"},
{"bmp": "wr3.png"},
{"bmp": "wr4.png"},
{"bmp": "wr5.png"},
{"bmp": "wr6.png"}
]
},
Or is it?
Using 295.
Using 295.
- Mayor Jeffrey IX
- TheoTown Cartographer
- Reactions:
- Posts: 988
- Joined: 05 Apr 2017, 16:48
- Location: Right here
- Plugins: Showcase Store
-
Platform