Solved Minor Help

Question that is answered or resolved.
For some reason my player can't connect any attack after the first attack connects. The animations play but there is no move contact or damage. I have the attack boxes set as well as damage and pause times and I added atchain 1 2 4 3 in the header so I can't think of what could be causing this also the first attack seems to rarely to connect as well so any info on the issue would be appreciated.
 
From the looks of it, I think it's just atchain. Use the atchain for the combos, following DC's advice and then use combosyle 1. This will enable the dynamic system of combo-ing where you can so what DC intended to do.
 
Compliments of damon caskey it works perfect I just don't understand why I can't use range alone to make it work

Code:
#define FALSE	0	// False value.
#define TRUE	1	// True value.
#define DEFAULT	NULL()	// No parameter value - fall back to a default.

/******Animation, adjustment flags*****/
#define ANI_BY_CHANGE_PROP	0	// Set animation using "changentityproperty".
#define ANI_BY_PERFORM_ATTACK	1	// Set animation using "performattack".
#define ANI_RESET_FALSE		0	// Performattack will do nothing if new animation = current.
#define ANI_RESET_TRUE		1	// Performattack will reset animation to first frame if new animation = current.

int ani_set_animation(void ent, int animation, int method, int reset)
{
	/*
	ani_set_animation
	Damon Vaughn Caskey
	2013-11-03

	Animation switch wrapper. Verify animation exists and then set using desired method. Replaces ani0009.

	vEnt:		Target entity.
	animation:	Animation to use.
	method:		Method to set animation. See Animation, adjustment flags in constants.h for flag list.
	*/

	int valid = FALSE;		// Requested animation valid.

	// Default for any omitted values.
	if(ent == DEFAULT) ent = getlocalvar("self");
	if(method == DEFAULT) method = ANI_BY_CHANGE_PROP;
	if(reset == DEFAULT) reset = ANI_RESET_FALSE;

	valid = getentityproperty(ent, "animvalid", animation);

	// Is requested animation valid?
	if (valid == TRUE)			
    	{
		switch (method)
		{
			// Set animation with entity property.
			default:			
			case ANI_BY_CHANGE_PROP:

				changeentityproperty(ent, "animation", animation);	
				break;

			// Set animation with perform attack command.
			case ANI_BY_PERFORM_ATTACK:

				performattack(ent, animation, reset);				
				break;
		}
    	}
    
	// Return valid as a result.
	return valid;
}

int ani_set_on_range(void ent, int alternate, int target_ani){
    
	/*
	ani_set_on_range
	Damon Vaughn Caskey
	2014-07-24

	Perform alternate animation if target is within range and in (optionaly) in specified animation.

	ent:		Entity that will switch animations. If NULL will default to caller.
	alternate:	Alternate attack.
	target_ani:	Target animation.	
	*/

	int  result		= NULL();	// Result of function. 
    	void target		= NULL();	// Target entity.
	void target_ani_current	= NULL();	// Target entity's current animation.

	// Default to caller if ent is not provided.
	if(ent == DEFAULT) ent = getlocalvar("self");
	 
	
	// Find target (if any) in range of specified animation.
	target = findtarget(ent, alternate);
	
	// Found a target?
	if (target)												
	{
		// Get target's current animation.
		target_ani_current = getentityproperty(target, "animationID");

		// Animation match or omitted?
		if(target_ani_current == target_ani || target_ani == DEFAULT)
		{
			// Perform alternate attack.
			result = ani_set_animation(ent, alternate, ANI_BY_CHANGE_PROP);					
		}
	}

	// Return result.
	return result;
}
 
Hey guys I'm trying to have a enemy be idle or still unless hit by player and then carry on like a normal enemy. I tried spawning the entity as an obstacle and then once the death animation is finished have them spawn an enemy version using custentity and subentity but neither seems to work is there a different method you guys can recommend? I got this idea from bwwd's old tmnt mod but I can't seem to recreate the effect even though I followed all of the parameters
 
It's best to use alternate 'spawn' animation for this purpose. You need to make a custom animation for this idle say FOLLOW2 like this:

anim follow2
  loop 1
  delay ...
  offset ...
  bbox ...
  frame ...

You can use any frames for this animation, not just idle frames ;)
then in level text, you spawn the enemy like this:

spawn Enemy
@script
void main()
{
    void self = getlocalvar("self");
    changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"));
}
@end_script
coords 200 200
at 100

It works like this: when Enemy is spawned, he/she is immediately be forced to play FOLLOW2. Since FOLLOW2 is looped, Enemy is stuck in this animation until player or something hit him/her

Actually you can use looped SPAWN animation to get similar result but I recommend using the above so you don't have to make clones of enemy with little difference i.e spawn difference

EXTRA: with a certain script, you can expand this idle to waiting state in which enemy waits until player gets close enough before he/she jumps in or ambush player
 
is there anyway to load and use two different bombs in player characters or would I need a script to accomplish this and if yes to the latter is there a script made already? I want the player to shoot a different attack from the air than the bomb used while on the ground but I'm using toss frame so it only calls one bomb entity
 
Is there a way to modify this script so that it doesn't only work with ani_Follow1? It comes from MFA2 specifically iron man

@script
if (frame==0){
          void self = getlocalvar("self");
          void mana = getentityproperty(self,"mp");
              if (mana==40){
          // changeentityproperty(self, "mp", mana-10);//add mp
                performattack(self, openborconstant("ANI_FOLLOW1"));
              }
              }
@end_script
 
I figured it out it wouldn't work because I had energycost set in animation and I guess the script doesn't work with that. Could someone help me change the script to function the same with the addition of allowing the attack to cost mp?
 
because I had energycost set in animation and I guess the script doesn't work with that.

I don't quite understand what you meant by incompatible but I have left that command long time ago and replace it with these functions:

Code:
void aniLimit(void Ani, int Frame, int Limit)
{// Change current animation if MP falls below limit
    void self = getlocalvar("self");
    void MP = getentityproperty(self,"mp");    

    if (MP < Limit){
      changeentityproperty(self, "animation", openborconstant(Ani),2);
      updateframe(self, Frame);
    }
}

void mpcost(int Cost)
{// Spend some MP
    void self = getlocalvar("self");
    int MP = getentityproperty(self,"mp");

    changeentityproperty(self, "mp", MP-Cost); //Spend!
}

The latter is for spending MP while the former is to change animation when MP is lower than limit.
Do you prefer to use these 2 functions or just to edit you script? I don't know at which frame you'd like to spend MP though
 
Back
Top Bottom