Object reaction

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Object reaction

Post 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.
pipfromslitherine
Site Admin
Site Admin
Posts: 9928
Joined: Wed Mar 23, 2005 10:35 pm

Re: Object reaction

Post 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
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: Object reaction

Post 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 ;
}
pipfromslitherine
Site Admin
Site Admin
Posts: 9928
Joined: Wed Mar 23, 2005 10:35 pm

Re: Object reaction

Post by pipfromslitherine »

The code shouldn't execute if -1 is being returned. I will check and see if I can replicate.

Cheers

Pip
Post Reply

Return to “Battle Academy : Modders Corner ”