Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Destroyable tile(layer) and destroyable block?
#1
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
Reply
#2
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
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply
#3
Thanks a lot for advice. Big Grin
Reply
#4
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
Reply
#5
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.
Reply
#6
or you make an NPC that looks like a wall Smile

(cheap solution for people who lack coding knowledge)
Reply
#7
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)