I'm trying the object reaction and I always getting the "else" result.
Who/what changes the "check" parameter?
When a unit walk over the tile the Log returns: else: 0.
And the <ret> value who receives this?
FUNCTION EnterMine( tilex, tiley, unit, objectid, objectx, objecty, check, user)
{
int ret ;
// is the object on our tile?
if( tilex == objectx && tiley == objecty )
{
if( check == 1 )
{
// return a high score - we always react
ret = 1000 ;
Log ("if", ret);
}
else
{
Log ("else", ret);
}
}
return ret ;
}
OBJECTS.BSF file
Moderators: Slitherine Core, BA Moderators
-
pipfromslitherine
- Site Admin

- Posts: 9928
- Joined: Wed Mar 23, 2005 10:35 pm
Re: OBJECTS.BSF file
It's all in the documentation at http://www.slitherinebravo.net/GameWiki ... user_value or are you saying that that isn't clear?
Cheers
Pip
Cheers
Pip
Re: OBJECTS.BSF file
Sure.are you saying that that isn't clear?
-
pipfromslitherine
- Site Admin

- Posts: 9928
- Joined: Wed Mar 23, 2005 10:35 pm
Re: OBJECTS.BSF file
I'm not sure which part isn't clear, but I have added some more text to make it clear that the check parameter is set by the game (although ALL the parameters are set by the game).
If check is 1 then the function is being called to discover whether the object should react to the moving unit (returning > -1 if it wants to). If the function returns > -1 then it is placed in the reaction queue based on its returned score, and if the object is required to react, then the function is called a second time, this time with a check value of 0.
Hmmm - in terms of this situation, it looks like it should work, and so in checking through the code I spotted a typo bug, which means when the function is actually called, check will be some non-zero value (it will actually be the y tile of the object, but that will change).
So switch the check to check > 0 and it should work fine. I will update the docs to reflect the change in values.
Cheers
Pip
If check is 1 then the function is being called to discover whether the object should react to the moving unit (returning > -1 if it wants to). If the function returns > -1 then it is placed in the reaction queue based on its returned score, and if the object is required to react, then the function is called a second time, this time with a check value of 0.
Hmmm - in terms of this situation, it looks like it should work, and so in checking through the code I spotted a typo bug, which means when the function is actually called, check will be some non-zero value (it will actually be the y tile of the object, but that will change).
So switch the check to check > 0 and it should work fine. I will update the docs to reflect the change in values.
Cheers
Pip
Re: OBJECTS.BSF file
Now, using != 0 it's seem to work.
One of the things it also confuse me is that BA don't seem to reload the script OBJECTS easily, even after closing the scenario, and the campaign.
One of the things it also confuse me is that BA don't seem to reload the script OBJECTS easily, even after closing the scenario, and the campaign.
Re: OBJECTS.BSF file
Now I'm sure, you must quit BA to force the reload of any change made in the OBJECT.BSF file.
So for any change you need to make you must quit BA and reload BA, Campaign, Scenario.....
So for any change you need to make you must quit BA and reload BA, Campaign, Scenario.....
-
pipfromslitherine
- Site Admin

- Posts: 9928
- Joined: Wed Mar 23, 2005 10:35 pm
Re: OBJECTS.BSF file
Hmmm. I will take a look. It is definitely simpler to iterate (esp with the new continue on error) if you can just restart the mission, though I will have to check as the objects are loaded at the campaign level.
Just to note - this check issue won't be fixed in 2.0.7 (as this is already in with Apple and I don't want different behaviours for the iPad and desktop versions) but will be in the update after that.
Cheers
Pip
Just to note - this check issue won't be fixed in 2.0.7 (as this is already in with Apple and I don't want different behaviours for the iPad and desktop versions) but will be in the update after that.
Cheers
Pip
