Mirage Engine
Destroyable tile(layer) and destroyable block? - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: Destroyable tile(layer) and destroyable block? (/showthread.php?tid=1461)



Destroyable tile(layer) and destroyable block? - roopezero - 14-12-2007

Hay, I've been looking for destroyable tile/block tutorial, so I now ask it here. Smile (It'd be cool for some kind of wall, that player could destroy, and would be also cool, if it respawned.) I think my request isn't quite easy, am I right? Thanks!
-
Ohh, and also wanted to know, how to make item cost mana, so If I use it, I lose mana so much, I've set in the item..?

-roopezero



Re: Destroyable tile(layer) and destroyable block? - Robin - 14-12-2007

Destroyable tiles are a nice idea.

Sorta similar to my Woodcutting system, except you'd blt a different tile there and you'd be able to walk over it when it's been destroyed.

There isn't a tutorial about it I'm afraid.

As for items costing mana, just add an integer of data to the ItemRec called 'ManaCost' or something, and then set it in all the packets and the ItemEditor as a scrollbar, then find the packet which calls 'AttackPlayer' and 'AttackNPC' and do a quick check.

If Player.Mana < ManaCost then
msg "lol not enough mana kkthxbai"
else
player.mana = player.mana - manacost
end if


Re: Destroyable tile(layer) and destroyable block? - roopezero - 14-12-2007

Thanks a lot for advice. Big Grin


Re: Destroyable tile(layer) and destroyable block? - funkynut - 14-12-2007

I remember doing that for a Game ages ago, but it was for grass clumps (Zelda like)

I lost the source agggges ago so cant rip it sorry. But I do think that I did it by copying the door/key tile but setting it to open when it was attacked rather then when stepping on a key open tile if that helps at all


Re: Destroyable tile(layer) and destroyable block? - Matt - 14-12-2007

Could just create a new tile type, in the datas, store the hp for the tile, as well as if it's blocked or not. In the canmove subs check the data that holds if it is blocked or not. If it's set to not be blocked, then allow the player to walk through it.

As for it disappearing and crap, use the temp tile stuff like the doors use. Then allow it to respawn after a set period of time.

When you're attacking, check to see if you're attacking the tile type and if so, subtract the damage from the hp of the tile. Once it hits 0, set the blocked to false and remove the tile.

Pretty simple.


Re: Destroyable tile(layer) and destroyable block? - Abyss - 13-01-2008

or you make an NPC that looks like a wall Smile

(cheap solution for people who lack coding knowledge)


Re: Destroyable tile(layer) and destroyable block? - Matt2 - 14-01-2008

Lol, PDoA doesn't call for this but I'm going to start on a new Fantasy-type MMO as well[seeing as MS has a bunch of good stuff, but nothing for a Pokemon-styled game]

SO! When I get around to it, I'll totally release it.