Page 1 of 1

brmbrmcar's script for enemy/kill bonusblock

PostPosted: 21 Apr 2018, 10:56
by DatTuxBoi
This is to brmbrmcar since i am a noob at PM's and such.
brmbrmcar, what is the script for spawning an enemy/kill Tux on a Bonus Block? :) ;)

Re: brmbrmcar's script for enemy/kill bonusblock

PostPosted: 21 Apr 2018, 11:54
by brmbrmcar
Killing Tux is not very difficult to do. You just have to set the script of the block to sector.Tux.kill(true). If you only want to hurt him sector.Tux.kill(false) works.

Setting the block to a badguy is a little more difficult, because you can't do it in the editor. You have to edit the level file in a text editor. You want to find the bonus block you want to change, and set contents to "custom" then add a new line with the badguy in. For example, for an Iceblock it should look something like this:
{l Code}: {l Select All Code}
    (bonusblock
      (sprite "images/objects/bonus_block/bonusblock.sprite")
      (x 189.3336639)
      (y 384.616272)
      (contents "custom")
(mriceblock)
    )


If you have any more questions or need more help please ask me.

Re: brmbrmcar's script for enemy/kill bonusblock

PostPosted: 21 Apr 2018, 12:36
by DatTuxBoi
brmbrmcar {l Wrote}:
Setting the block to a badguy is a little more difficult, because you can't do it in the editor. You have to edit the level file in a text editor. You want to find the bonus block you want to change, and set contents to "custom" then add a new line with the badguy in. For example, for an Iceblock it should look something like this:
{l Code}: {l Select All Code}
    (bonusblock
      (sprite "images/objects/bonus_block/bonusblock.sprite")
      (x 189.3336639)
      (y 384.616272)
      (contents "custom")
(mriceblock)
    )


If you have any more questions or need more help please ask me.


It disappears, and i wrote every single letter in the script box, and set the type of bonusblock to script.


Besides that,

THANK YOU SENPAI FOR SHARING THE SECRETS OF SUPERTUX LEVEL EDITING!

Re: brmbrmcar's script for enemy/kill bonusblock

PostPosted: 21 Apr 2018, 12:44
by brmbrmcar
For a script you don;t have to actually set the bonus block type I;m pretty sure.

Re: brmbrmcar's script for enemy/kill bonusblock

PostPosted: 21 Apr 2018, 12:54
by DatTuxBoi
~it would give me a coin

Re: brmbrmcar's script for enemy/kill bonusblock

PostPosted: 21 Apr 2018, 12:56
by brmbrmcar
Did you try and copy and paste it in directly? If so that won't work very well because x and y positions will be different. I don't see why that would give a coin.