[4.1] Use the real Melee object weapon in the Platformer module

Steigede
Posts: 5
Joined: Wed Feb 06, 2019 1:11 pm

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by Steigede » Fri Feb 08, 2019 7:17 pm

I don't have In your "Use Sprite Based Weapon" in my "Project Settings > Script Settings". Any idea?
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by dale_coop » Sat Feb 09, 2019 1:05 am

It might another name depending of the module used... Might be named “sprite based weapon” or “handle sprite weapon” or something like that.

Update: confirmed, in the adventure module, it is labeled "Handle Sprite Weapon" in the "Project Settings > Script Settings".
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
Craigery
Posts: 29
Joined: Mon Apr 30, 2018 8:53 pm

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by Craigery » Mon Feb 11, 2019 3:06 am

Dale, how does the Monster Object get destroyed? There is a line in HandleSpriteWeapon.asm which included a DeactivateCurrentObject on the monster object, but we remove that. So how does it get destroyed here?
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by dale_coop » Mon Feb 11, 2019 4:52 am

Craigery... when the melee weapon was a sprite.. all the code for collision with a monster was in the HandleSpriteWeapon.asm script.
Now that the weapon is a real object, it follows the rules of object collisions (HandleObjectCollisions.asm script) and in that script, when a "player weapon" type object collides with a "monster" type object, the Handle Monster Hurt script is executed.
So, in that script, your monster will be destroyed (cf. your HandleHurtMonster.asm script you will find the DeactivateCurrentObject that is used now).
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
drexegar
Posts: 89
Joined: Wed Mar 21, 2018 12:33 pm

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by drexegar » Tue Feb 12, 2019 4:26 am

Thank you. I spent far too long messing with the create object code, (the stop player action doesn't work and the offset doesn't work) so I just follow your tutorial and it works great in the scrolling platform!
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by dale_coop » Tue Feb 12, 2019 8:46 am

Glad you made it :)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
angelcrusher
Posts: 5
Joined: Thu Feb 14, 2019 4:50 am

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by angelcrusher » Thu Feb 14, 2019 4:55 am

Hi everyone! Thanks for all of the tips. I'm using these scripts in a side scrolling platformer and everything works great with the PreDraw tweaks, but once I insert objects into my screen they are pulled towards my player when running the activate melee script. Seems to only happen when running the PreDraw tweaks for having the object follow the player in mid movement/air.

Has you seen this?

I've tried with monsters and with power-up objects and messed around with the code for a little bit. I'm just not so great with assembly since I just started learning.
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by dale_coop » Thu Feb 14, 2019 2:58 pm

angelcrusher wrote:
Thu Feb 14, 2019 4:55 am
Hi everyone! Thanks for all of the tips. I'm using these scripts in a side scrolling platformer and everything works great with the PreDraw tweaks, but once I insert objects into my screen they are pulled towards my player when running the activate melee script. Seems to only happen when running the PreDraw tweaks for having the object follow the player in mid movement/air.

Has you seen this?

I've tried with monsters and with power-up objects and messed around with the code for a little bit. I'm just not so great with assembly since I just started learning.
Hey angelcrusher, I think the PreDraw code proposed by Nate might be working for the particular case of Nate's project, but it's really useable as it.
I would suggest you to remove that part if your added it. And just set a timer to "DestroyMe" for your Player's Weapon for the Action Step 0 like specified in the original post.... until a more appropriate parenting code (weapon following the player) with a tutorial is made.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
angelcrusher
Posts: 5
Joined: Thu Feb 14, 2019 4:50 am

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by angelcrusher » Fri Feb 15, 2019 2:05 am

Got it thanks!
Post Reply