Page 1 of 1

Object reaction

Posted: Mon Oct 29, 2012 7:49 pm
by enric
When a Object reaction is defined:

[Minen]
SCRIPT_REACT EnterMine
//SCRIPT_USER_VALUE 3

Even if the function has nothing
FUNCTION EnterMine( tilex, tiley, unit, objectid, objectx, objecty, check, user)
{
}

All units in board (not near the reacting objects) move one tile at a tile, even if you give a move order of more than a tile.

Re: Object reaction

Posted: Mon Oct 29, 2012 7:52 pm
by pipfromslitherine
It might be that you are always returning that the object reacts. If something reacts to the movement, then the movement stops. You should only return >=0 at the point where you are going to do something to the unit, and thus you want to make the unit stop. An empty function returns 0 by default, and so would cause the behaviour you are seeing.

Cheers

Pip

Re: Object reaction

Posted: Mon Oct 29, 2012 8:13 pm
by enric
This also stops all units moves

FUNCTION EnterMine( tilex, tiley, unit, objectid, objectx, objecty, check, user)
{

int ret ;
ret = -1; // tried 0 and 1 also
return ret ;
}

Re: Object reaction

Posted: Mon Oct 29, 2012 10:49 pm
by pipfromslitherine
The code shouldn't execute if -1 is being returned. I will check and see if I can replicate.

Cheers

Pip