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.
 
hey guys could you take a look at DC's do grab script and tell if you see anything wrong because when I try it the mod crashes

Code:
void test_dograb()
{
void self;
void target;
int d;
int x;
int y;
int z;
int xadj;

/* Get self and target. */
self = getlocalvar("self");
target = getentityproperty(self, "opponent");

/* Get position and directional values. */
d = getentityproperty(self, "direction");
x = getentityproperty(self, "x");
y = getentityproperty(self, "y");
z = getentityproperty(self, "z");
xadj = 56;

/*Reverse X adjustment if facing left. */
if(!d) xadj = -xadj;

/* Set position adjustments */
x += xadj;
z -= 1;

/* Apply position adjustment to target. */
changeentityproperty(target, "position", x, z, y);

/* Apply grab*/
dograb(self, target, 0);
}

this what the log says

Code:
Property name 'y' is not supported by function getentityproperty.
 
thanks maggas I somewhat thought of that but I changed both y's to a. It loads now but when I try to execute the attack the game crashes. It doesn't list any reason in the log so I don't know what's not working this is how I call the function in my character text

Code:
anim	follow4
	offset	36 199
	delay	20
	frame	data/chars/Spiderman/ws5.gif
	delay	5
	frame	data/chars/Spiderman/ws3.gif
	delay	5
	frame	data/chars/Spiderman/ws2.gif
	delay	5
	frame	data/chars/Spiderman/ws1.gif
	delay	5
	frame	data/chars/Spiderman/h1.gif
	offset	38 94
	bbox	20 40 45 60
	delay	1
	drawmethod	265 265 0 0 0 0 -1 0 0 0
	frame	data/chars/Spiderman/ga2.gif
	@cmd	dograb
	frame	data/chars/Spiderman/ga2.gif
 
Damon Caskey said:
There's no bug in grabin, the manual is just wrong about what it's supposed to do. It does not and was never intended to work as the manual describes.

All grabin does is move the target within a given range on contact. That's it. The movement itself can sometimes trigger a grab, but that's just a side effect.

DC

Someday, those lazy people which updates the manual will add this info :)

But seriously, why someone puts wrong info at manual? And how come nobody ever fixed it?
In fact, I think I know it. Some authors like to document their stuff, and some not.
 
magggas said:
You have to change this line like this:
y = getentityproperty(self, "a");

That's not correct. Not only is 'y' valid, 'a' has been depreciated. Always use 'y', never 'a'.

O Ilusionista said:

I had nothing to do with grabin, I just happen to know how it works. Grabin was a Utunnels addition. I always make sure to document any of my code changes.

DC
 
I use script to switch between combo starting attacks based on range distance and I was wondering if it could be modified to base attack on nearest enemy because if a enemy is say within a range of 20 but another is further back to say about 100 then the long range attack will execute because of the enemy further away

this is the range script made by DC

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;
 
you guys can disregard that last question I went ahead and just made the long range attacks freespecials and follows using keyint script which really gives more freedom and control over the attacks
 
Does anyone know what base character was used to make namor from marvel first alliance? I want to make him into a full character and didn't want to necro Zvitor's thread since he's still on break

[attachment deleted by admin]
 
Back
Top Bottom