Custom Hero?

Started by polyglot762, November 09, 2015, 01:30:55 PM

Previous topic - Next topic
Hi All,
I am looking to change the collision with the hero but haven't yet found anything in the documentation to do this.
Should I just start to investigate how it could be done as a custom entity?
Thanks,
PG

What do you mean with "change the collision with the hero"? Can you be more specific?

November 09, 2015, 03:45:40 PM #2 Last Edit: November 09, 2015, 03:48:38 PM by Username
He might be saying a collision with an enemy since he says "with the hero"

If this is the case then it exist a event on_taking_damage, for the hero and enemy
http://www.solarus-games.org/doc/latest/lua_api_hero.html#lua_api_hero_on_taking_damage

Or he's talking about custom hero bounding box. (which is not possible yet afaik)

Or he's talking about changing the sprite of the hero. (set_tunic_sprite_id)

I was talking about the bounding box which looks like it can't be changed yet.
Will these things be changeable in the future or will I be creating a custom entity called "hero"?
I have already been fiddling with changing the sprite and the bounding box doesn't seem to change even if the sprite is much larger.

The Hero still doesn't take damage unless the enemy touches the dimensions of the old link sprite.
Thanks for your help sorry for the confusion.
PG

Yes, this might be in future Solarus version, this must be an option for custom hero sprites that is bigger than Link.

https://github.com/christopho/solarus/issues/791

November 10, 2015, 01:09:16 PM #5 Last Edit: November 10, 2015, 09:54:43 PM by polyglot762
I guess... I'll have to try to create a custom hero metatable... this could get game breaking exciting.
I'll post if I succeed. (Leaves off on a quest... and hopes some will someday follow along...) :o

Or... I think it just might be more useful to recompile the code to what ever size character I have...
Is the source on github easy to compile or do I have to manually go through all that trouble with the Windows compile?
(I am using a windows machine...)

Well... I figured out what was causing some of the trouble...
I had not set the origins correctly after changing sprites.

Now that the origin is fixed... no weird collisions.
Still bound to a 16x16 box but at least it is better.