Item Knockback

Have any questions or problems in making your game, subscribing and/or using our software? Post here.
Forum rules
Make sure you are using the newest version. This can be downloaded at the top of the site via the "downloads" link.

Use a very good subject. "Problem" or "Help" are unacceptable titles.

Use the search feature before posting a question, as the answer is probably already here.

Subscript out of range error 9: This is a generic error, and we'll need way more information than that to figure out the problem. If you get this, strongly consider following the instructions of submitting your project through the Submit Bug feature within the editor.
User avatar
Danny
001 Forum Master
 
Joined: Tue Jul 12, 2011 7:14 am

Item Knockback

Postby Danny » Sun Jan 17, 2016 12:05 am

I wish to make a request to add "Knockback" to items. I'm trying to create a system where when the player hits a enemy actor they will get knocked back. I can successfully "Knockback" a actor if that actor is attacked by a player but in order to be specific such as which item is used (Weapon Item) i will need to make loads of checks to check which item (weapon) was used to attack the enemy actor.

So i would like a feature that adds a option to the items properties that can add a numbered value. By default knockback would be 0 (Disabled) and you can add your own value to determine the strength. I was thinking the values could be something like this;

If you set the value to say 32 then that weapon when used on a enemy actor will knock that enemy back by 32 pixels. The direction of the knockback could be determined on the facing direction of the enemy, so if the enemy is facing lets say north it will get knocked back south but still face north.

I know this is something that can be scripted in GGMaker however it requires the use of alot of comparison branch's or attacked triggers. Something like this would be much more simple because you can define the knockback value in the item directly without the need of triggers and comparison branch's.

Something worth looking into maybe? Thanks :)

User avatar
Mr.Numbers
001 Support
 
Joined: Wed Feb 28, 2007 1:50 am
Location: Alberta, Canada

Re: Item Knockback

Postby Mr.Numbers » Sun Jan 17, 2016 6:19 pm

Could you not use the "Projectile/Weapon hit" trigger or whatever its called inside the item it self? Not sure if it'd work, but I imagine you could say push whatever it hit away from the person who used it using the push/slide events.
Image
I AM THE ALL MIGHTY SCRIPTING MASTER
Please do not PM me with Engine 001 related questions, rather post on the forums. ;)

User avatar
Danny
001 Forum Master
 
Joined: Tue Jul 12, 2011 7:14 am

Re: Item Knockback

Postby Danny » Sun Jan 17, 2016 6:40 pm

Yeah sure

fma_lvr
001 Subscriber
 
Joined: Wed Sep 15, 2010 5:02 am

Re: Item Knockback

Postby fma_lvr » Mon Jan 18, 2016 7:55 am

I actually did something like this fairly easily. Make a 'Damaged by actor' script in 'Actor' template so it affects any actor, then use a single Comparison Branch to check the Scripting ID of the item against the Scripting ID of the 'relate' actor's equipped weapon. Finally, add one of these:

The variability for velocity is unnecessary of course, but the Geometry mess forces the damaged actor to be pushed in the corresponding direction. I use this myself, it's quite smooth. You can tweak it as you may.



All this said, I like the idea of have knockback saved in weapon settings, but unless it can be changed during play (which, as it stands, is untrue for any item settings) it would probably be equivalent to the solution I have laid forth. Regardless, I hope this helps.

User avatar
Koutacles
001 Subscriber
 
Joined: Fri Sep 08, 2006 9:54 pm
Location: NSW, Australia

Re: Item Knockback

Postby Koutacles » Thu Jan 21, 2016 9:16 am

Perhaps have a hidden weapon-only Statistic for Knockback, that if > 0 on a weapon applies that much knockback on hit instead of checking IDs?
aka Chaoman77
Play Fungi Frolic!
Solve platforming puzzles and then make your own!
Play Endless Sands!
Gather gold in a deadly pyramid then (hopefully) return alive to spend it on sweet, sweet loot!


Return to Technical Support Questions

Who is online

Users browsing this forum: No registered users

cron