News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

projectile return

Started by storm0062, May 08, 2011, 01:33:44 PM

Previous topic - Next topic

storm0062

Is it possible to create a return of a projectile following a protection?

I explain with an exemple:

P2 shoot me with a blaster gun, I protect myself with my laser saber, the P2's projectile hit my saber protection and return to the ennemy to domage him..

It is possible?

thanks in advance!

Cyanide

If you wish to return a somewhat generic looking projectile (say a glowing ball) then yes very possible.

I wouldn't personally bother with returning the animation, waste of time and impossible with pure projectiles.

The basis of this is, you have a helper. It has a hitoverride for projectiles. It enters a movetype = H state and uses gethitvar to save a load of pertinent values to variables. For example

varset
trigger1 = time = 0
var(0) = gethitvar(damage)

Then it fires a projectile (or helper) with those variables in use

Then in the hitdef of the returning projectile

damage = var(0)


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

storm0062

Quote from: Cyanide on May 08, 2011, 10:26:59 PM
If you wish to return a somewhat generic looking projectile (say a glowing ball) then yes very possible.

I wouldn't personally bother with returning the animation, waste of time and impossible with pure projectiles.

The basis of this is, you have a helper. It has a hitoverride for projectiles. It enters a movetype = H state and uses gethitvar to save a load of pertinent values to variables. For example

varset
trigger1 = time = 0
var(0) = gethitvar(damage)

Then it fires a projectile (or helper) with those variables in use

Then in the hitdef of the returning projectile

damage = var(0)

ok thanks!

it's impossible to return the same projectile...
It's for a full game, can I put in my sff all projectiles images, and a code to know who is p2 and what sort of projectile he use into this char?

Cyanide

If it's for a full game, much easier. Code the "reversed" state into the character throwing the projectile. Let the projectile hit a reversaldef and go through an intemediary custom state followed by a selfstate to the returning anim.

Simple enough.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

storm0062