Help with custom objects

  • 7 Replies
  • 2543 Views
*

Offline Dandelion

  • 428
  • 0
  • Yay owls!
    • View Profile
Help with custom objects
« on: May 23, 2009, 21:14:38 »
I have 5 custom objects in a level I'm making that work perfectly, but one of them makes the game crash! >( I have attached it to my post. I'm using the latest version of KS, and the image is a .png, and the other custom objects work just fine! I have no idea why it's crashing. Help! :ohnoes:

Check out my tilesets!

*

Offline Pumpkinbot

  • 1134
  • 20
  • No terrain is too hard. Not even dragons.
    • View Profile
    • My DeviantART page
Re: Help with custom objects
« Reply #1 on: May 24, 2009, 00:02:53 »
Did you edit the World.ini file? If not, that's your problem.
Put this anywhere in the .ini file, preferably at the beginning.
Code: [Select]
[Custom Object X]
Image=
Init AnimSpeed=
Init AnimTo=
Init AnimFrom=
Init AnimLoopback=
Tile Width=
Tile Height=
Image tells what the name of the image in the Custom Objects folder is so it can find it. This is mandatory.
Init AnimSpeed tells how fast it goes. 100 is somewhat slow, while 300 is blazing fast. This isn't mandatory; it has a default speed.
Init AnimTo tells which frame to stop at. Remember that the first frame is 0, the second is 1, etc. Also mandatory.
Init AnimFrom tells which to start at. No matter what it starts at, it always loops back to 0 unless Init AnimLoopback is set. Default is 0.
Init AnimLoopback tells us what frame to loop back to. Once it reaches the frame specified by AnimTo, it loops back to the one set here. Default is 0.
Tile Width is not mandatory, but it's there for pictures bigger or smaller than 24 pixels. Default is 24.
Tile Height is the same as above, but vertical instead. Default is 24.
« Last Edit: May 24, 2009, 00:14:17 by Pumpkinbot »
A God, a Messiah, an Angel, a King, a Prince, and an All Terrain Vehicle.

*

Offline Dandelion

  • 428
  • 0
  • Yay owls!
    • View Profile
Re: Help with custom objects
« Reply #2 on: May 24, 2009, 01:27:01 »
Yes, I changed the .ini file. The problem isn't that it doesn't show up, it's that it makes the game freeze. I have objects in the level that work just fine, but when I add this one it freezes.

Check out my tilesets!

*

Offline googoogjoob

  • Forum Walrus
  • 823
  • 9
  • The Walrus is me.
    • View Profile
    • I have a LiveJournal. Yes. I do.
Re: Help with custom objects
« Reply #3 on: May 24, 2009, 06:45:00 »
Could you post the relevant lines from the world.ini file? A single typo might break it.
good bye

*

Offline Dandelion

  • 428
  • 0
  • Yay owls!
    • View Profile
Re: Help with custom objects
« Reply #4 on: May 24, 2009, 07:11:51 »
[Custom Object 7]
Image=blackminibouncer.png
Init AnimTo=15
Init AnimSpeed=500

The image is in the Custom Objects folder, and it's named blackminibouncer.png

Check out my tilesets!

*

Offline googoogjoob

  • Forum Walrus
  • 823
  • 9
  • The Walrus is me.
    • View Profile
    • I have a LiveJournal. Yes. I do.
Re: Help with custom objects
« Reply #5 on: May 24, 2009, 08:37:27 »
...using those exact same lines in the world.ini file, and using the same PNG attached to the first post, it works perfectly fine for me. :S

Presumably it only crashes when Juni enters a screen with the object on it. Is there anything else on the crash screen that could be messing with it?

I really can't think of anything that might cause a crash, either in-game or in the world file or wherever. :/
good bye

*

Offline Dandelion

  • 428
  • 0
  • Yay owls!
    • View Profile
Re: Help with custom objects
« Reply #6 on: May 24, 2009, 18:10:57 »
Okay, the planets aligned or something and it works now. Before, it was freezing if I had the objects ini. data in the ini. file, regardless of whether it was on screen or not. When I took the code out of the ini. file it stopped freezing, so I assumed it was the object. Maybe some other random thing was causing it to freeze, because it should have worked fine. :sigh:

Check out my tilesets!

Re: Help with custom objects
« Reply #7 on: May 25, 2009, 01:46:08 »
It's always the ini. During initialization, the game looks for data from the ini. If there's a problem, the game crashes. KS doesn't care if an object's there if there's no mention of it in the ini.
Lurk more.