Author Topic: (Answered!) Need help with an error =(  (Read 5692 times)

riotpatriot

  • Seed
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
(Answered!) Need help with an error =(
« on: August 29, 2010, 01:30:23 AM »
What does it mean when it says: "Object reference not set to an instance of an object?"

I don't know which line I'm getting wrong. It worked on a simpler version of that map, but no matter how much I try it's not fixing that error. =(

Thanks in advance!

Edit: basically what I'm trying is to force the player's seeds to make a random tree when it has enough. It's working in the simpler map, but I don't understand why this map isn't. =(
« Last Edit: September 01, 2010, 11:24:57 PM by riotpatriot »

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Need help with an error =(
« Reply #1 on: August 29, 2010, 11:15:34 PM »
There should be a number in there somewhere, something like Resources/Maps/EufloriaZen01.lua:THE NUMBER SHOULD BE HERE:Object reference not set to an instance of an object? What's that number?

I'd say the error is in lines 114 - 145, possibly related to the fact that there is a colon in your function name. Don't know for certain though.

riotpatriot

  • Seed
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
Re: Need help with an error =(
« Reply #2 on: August 29, 2010, 11:42:07 PM »
I'm pretty sure it's not the colon in Auto:Dyson (are we on the same line?). It's the same in the other file.

And the error didn't specify which line. Which is why I'm really confuzzled. o_0
(I checked the console and they didn't give me any error, which is weird because usually when there's an error the console would record that too.)

Also attached is the smaller and working version. I'm trying to find out what went wrong where in my first try.  :-\

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: Need help with an error =(
« Reply #3 on: August 30, 2010, 12:08:55 AM »
Pffft. Dunno, sorry. Might be able to help if I look more, but someone else (read: annikk.exe) might be more help.

BTW, you might want to grow the first tree in LevelSetup(). Put s = a:AddDysonTree() in somewhere during asteroid creation, then use s:LevelUp() at least once. It doesn't use seedlings up.

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 14
  • Posts: 1,035
Re: Need help with an error =(
« Reply #4 on: August 30, 2010, 09:00:42 PM »
Your asteroid layout creates a broken nodemap where an asteroid (ID 0 in this case) cannot connect to any other asteroids. This would be OK usually as my AI routine causes asteroids in this situation to expand their send distance until they can send to any other asteroid, but there is a bug in the code that causes this routine to crash when there is only one asteroid in the "island". I'll fix that, but in the meantime you'll have to expand asteroid 0's send distance to include at least one other asteroid.

Looks like a nice level!

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Need help with an error =(
« Reply #5 on: September 01, 2010, 04:37:25 PM »
To expand a bit on what Alex said, you need to make sure that when you reach the end of function LevelSetup() all the asteroids are within range of each other (in terms of send distance).  If they're not, the level crashes with that error message you are seeing.

So what to do is, set the send distances to something enormous in LevelSetup, then at the beginning of LevelLogic, set them all to whatever you really want them to be.  That should solve your problems without the need to change your send distances.  Although, you may find you wish to adjust them anyway, if some of them are being left too far away to reach any other asteroids..... but it's a lot easier to work that out if you can visually see the level, ie it actually loads.  :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 1,809
Re: Need help with an error =(
« Reply #6 on: September 01, 2010, 04:38:22 PM »
Maybe I should make a guide to troubleshooting levels...  And figuring out what common error messages mean.

riotpatriot

  • Seed
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
Re: Need help with an error =(
« Reply #7 on: September 01, 2010, 11:24:35 PM »
So it's the out-of-reach send distances (esp roid 0) that's crashing the level? I see...

Thanks for you help Pilchard, Alex and Annikk! ;D I'll try to post the results of the fix attempt sometime next week; kinda bigged down by school now. Feh.

PS: if only there's a quick GUI for making asteroids (like how does one make circles in Flash from it's center) and adjusting range, ownership, etc ... (The map coding could be done after the program generates the roids into a LUA level)  :-\
« Last Edit: September 01, 2010, 11:30:26 PM by riotpatriot »

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 24
  • Posts: 932
  • Eufloria: Yes
Re: (Answered!) Need help with an error =(
« Reply #8 on: September 02, 2010, 01:04:22 AM »
Editors, list of:

DAFT (visual, can't find link, outputs to txt file)

EUCLiD (I made it, perfectly safe, no viruses, not visual. Might update sometime.)

Flowar (visual editor not released yet, but testers wanted)

as yet un-named (alpha release, visual editor)

Alex

  • Administrator
  • Ent
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 14
  • Posts: 1,035
Re: (Answered!) Need help with an error =(
« Reply #9 on: September 02, 2010, 04:12:11 AM »