PHP Code:
//#CLIENTSIDE
if (created) {
addtiledef revernia_tileset.png}
1
}
The problem is that your addtiledef statement is wrong.
PHP Code:
//#CLIENTSIDE
if (created) {
addtiledef revernia_tileset.png, #L, 0;
}
As Soala said, you can replace #L with the name of the level or the level start (such as revernia_ if all your levels start with revernia_), or leave it blank if you want it to apply to all levels.
If the tileset is a 'type 1' tileset you will need to change the '0' at the end to a '1'. Type 0 tilesets are laid out like pics1.png whereas type 2 tilesets are laid out like Era's, GK's, etc.
You should delete the script before uploading to a server. The GS2 equivalent (for online use) is:
PHP Code:
//#CLIENTSIDE
function onCreated() {
addTileDef("revernia_tileset.png", this.level.name, 0);
}
Quote:
Originally Posted by Soala
1: You're using GS1! Use GS2!
2:Your code is wrong!
Hint:
//#CLIENTSIDE
function onCreated() {
addtiledef revernia_tileset.png,#L,1;
}
#L can be replaced by the level name but will do if you try it on one level in offline editor
1 being the type of the tileset. I guess you're going for the organized type, if it was made on a template such as pics1.png, then the type is 0.
|
Please stop giving scripting advice. Your intentions may be true, but you're doing a lot more damage than good.
He said he was using the offline editor, so he needs to use GS1.
In addition, the "hint" you gave was even worse than the original snippet he provided in that it combines GS1 and GS2.