Pages: [1] 2
  Print  
Author Topic: How to edit the editor  (Read 1801 times)
Delver
Bean
*
Posts: 161



View Profile Email
« on: January 06, 2010, 09:33:45 PM »

Thanks to Darkness3313 we can now edit the editor propely  Smiley

The key is the 3 script:

scrCreateTile
scrCreateTileobj
scrSetCurserTile

and the object:

oLevelEditor

If you want to add say oMetalBlock to the editor; first open oLevelEditor, open Create, here we see the blockArray from 0 to 23, so simply add:

blockArray[22] = "4"; // Temple
blockArray[23] = "l"; // Lava
blockArray[24] = "Z"; // MetalBlock

it's impotent you use a unique letter  not used in either the block, enemy, trap or treasure array.

Then we need to change the dropmax for blockArray (else it will simply jump over the MetalBlock) (the first array is a special case; since we start under array in the editor, therefor we have change the dropmax just above blockArray under create). Since the block array is under 1 - go to oLevelEditor and open press 1-key and change dropmax. for the metal block we change it to 24.

if (global.tunnel1 == 0 and global.tunnel2 > 0) dropMax = 18;
    else if (global.tunnel1 > 0 and global.tunnel2 == 0) dropMax = 21;
    else if (global.tunnel1 == 0 and global.tunnel2 == 0) dropMax = 24;

we then need to set the sprite in the array (when you scroll in the editor), this we do in scrSetCurserTile, like this:

if (blockArray[dropVal] == "j") oCursObj.sprite_index = sPotionRedTile;
    if (blockArray[dropVal] == "k") oCursObj.sprite_index = sPotionBlackTile;
    if (blockArray[dropVal] == "Z") oCursObj.sprite_index = sMetalBlock;

Then we need to set the object you see in the editor in  when you have inserted it into the level, this is simply just the sprite as an object (set the parent to oDrawnSprite) if you look under objects Level Editor you will see plenty of examples. we edit in the script scrCreateTile:

else if (argument0 == "\")
{
    obj = instance_create(argument1, argument2, oCapeTile);
}
else if (argument0 == "J")
{
    obj = instance_create(argument1, argument2, oJetpackTile);
}
else if (argument0 == "Z")
{
    obj = instance_create(argument1, argument2, oMetalBlock);
}


then we need to set the object thats used when the Level is played (in the script scrCreateTileObj), like this:

else if (argument0 == "\")
{
    obj = instance_create(argument1+8, argument2+10, oCapePickup);
    obj.cost = 0;
    obj.forSale = false;
}
else if (argument0 == "J")
{
    obj = instance_create(argument1+8, argument2+8, oJetpack);
    obj.cost = 0;
    obj.forSale = false;
}
else if (argument0 == "Z")
{
    obj = instance_create(argument1, argument2, oPushMetalBlock);
}


and that's it  Grin

hope to see some great editors

Download, this is a edited version of potion mod:
.exe file
http://www.mediafire.com/?zzylmfyomfd
.gmk
http://www.mediafire.com/?yyg4atjzjgi



      




« Last Edit: January 08, 2010, 03:47:25 PM by Delver » Logged
marsgreekgod
Big Bossy
Mossy
*
Posts: 9779


The will of the Galaxy.


View Profile WWW Email
« Reply #1 on: January 06, 2010, 09:46:08 PM »

wow thanks! I was just doing this and this should help
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
Kegluneq
Big Bossy
Mossy
*
Posts: 2219



View Profile Email
« Reply #2 on: January 06, 2010, 09:53:36 PM »

Very nice, it will be very helpful.
Derek should pin this.
Logged

A wild SHINY MOSSY appeared!
marsgreekgod
Big Bossy
Mossy
*
Posts: 9779


The will of the Galaxy.


View Profile WWW Email
« Reply #3 on: January 06, 2010, 09:56:43 PM »

Hey we could make the editor upgrade some one talked about!?

(added medal blocks and doomsday(?) to my mod, adding keys and medal doors. thanks!
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
Darkness3313
Mosskid
*
Posts: 710


That reminds me of a puzzle...


View Profile
« Reply #4 on: January 06, 2010, 09:59:09 PM »

Suddenly I'm helpful somehow.
Logged
gummybears123
Mossy
*
Posts: 5776


Yummy Gummy!


View Profile
« Reply #5 on: January 06, 2010, 10:21:51 PM »

There are SO many things I want in the editor Grin Grin
Logged

I made a rap.
It sounds dumb, like reading a map
I really should stop this thing before it goes too far
But I don't really car as long as I stay below the radar
Those big companies won't get me no
I'll get away before the fuzz show

-Most famous rapper of Mossmouth
Kirbylord
marsgreekgod
Big Bossy
Mossy
*
Posts: 9779


The will of the Galaxy.


View Profile WWW Email
« Reply #6 on: January 06, 2010, 11:11:27 PM »

hmm.. having problems putting an key in the editor any help? it seems it's trying to run the key code and it's not working in editor mode, how would I make a tile of it that changes into the key as derak does?
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
AirSalad
Bean
*
Posts: 102


View Profile
« Reply #7 on: January 07, 2010, 02:02:53 AM »

Fyi you can remove the global tunnel checks, as its there to see if the player has unlocked the tile set which isn't really needed.
Logged
Delver
Bean
*
Posts: 161



View Profile Email
« Reply #8 on: January 07, 2010, 09:20:36 AM »

hmm.. having problems putting an key in the editor any help? it seems it's trying to run the key code and it's not working in editor mode, how would I make a tile of it that changes into the key as derak does?

You need to make a second object, that is used as the tile object (that's the object in scrCreateTile) it's simply just the sprite as an object, if you see in the folder under objects called level editor you see quit a few of them, just make one like them.

Under scrCreateTile:

else if (argument0 == "Ø")
{
    obj = instance_create(argument1+8, argument2+8, oKeyTile);
}


under scrCreateTileObj:

else if (argument0 == "Ø")
{
    obj = instance_create(argument1+8, argument2+8, oKey);
}


the +8 is inserted to make the object centered on the cursor... might take a few tries to get right.

Help File (this is normal Spelunky with a key in the editor, and added helpful notations ^^):
http://www.mediafire.com/?nitqjtz2un1
the key is lowest in array 4.




« Last Edit: January 07, 2010, 09:51:34 AM by Delver » Logged
marsgreekgod
Big Bossy
Mossy
*
Posts: 9779


The will of the Galaxy.


View Profile WWW Email
« Reply #9 on: January 07, 2010, 10:50:22 AM »

Thanks a lot, so thats where I put it. My mod well be able to have... LOCKS AND KEYS?
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
banna8
Mossbaby
*
Posts: 281


View Profile Email
« Reply #10 on: January 28, 2010, 03:26:44 PM »

Could anyone post a list of characters/symbols/letters/numbers that AREN'T already used in vanilla spelunky?
Logged
marsgreekgod
Big Bossy
Mossy
*
Posts: 9779


The will of the Galaxy.


View Profile WWW Email
« Reply #11 on: January 28, 2010, 06:14:08 PM »

{
"
Ä
§

Ü


Ä






does that help?
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
MagiMaster
Bulb
*
Posts: 97


View Profile
« Reply #12 on: January 28, 2010, 06:16:42 PM »

There's a wiki page I started for the characters used by the level generator. That could be extended to include the characters used by the level editor.
Logged
banna8
Mossbaby
*
Posts: 281


View Profile Email
« Reply #13 on: January 28, 2010, 08:53:36 PM »

{
"
Ä
§

Ü


Ä






does that help?
Ahhhh!!!!
I dont know how to do most of those....
Logged
marsgreekgod
Big Bossy
Mossy
*
Posts: 9779


The will of the Galaxy.


View Profile WWW Email
« Reply #14 on: January 28, 2010, 09:07:43 PM »

copy and paste
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
Pages: [1] 2
  Print  
 
Jump to: