Hi.
I'm working on a custom story where In one level I have an empty bucket placed, which the player needs to pick up and go fill it using a pump.
So I put a script area around the pump, ticked the "Item Interaction" option and made this script:
(This is in the void OnStart() area)
AddUseItemCallback("", "bucket_empty_1", "AreaFillBucket", "FillBucketFunc", true);
Then outside of the onstart area:
void FillBucketFunc(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "04_water_puff.snt", AreaFillBucket", 0.0f, true);
RemoveItem(asItem);
GiveItemFromFile("filled_bucket", "wooden_bucket_filled.ent");
}
But when I try to enter the level the game crashes giving me an error saying:
"FATAL ERROR: Could not load script file ~~~~~~
ExecuteString(1, 1) : ERR : No matching signatures to 'OnEnter()'
ExecuteString (1, 1) : ERR : No matching signatures to 'OnLeave()'
main (21, 1) : ERR : Unexpected end of file"
Here is the entire script (it's a new level so it's tiny)
Spoiler below!
void OnStart()
{
// Debug
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
}
PlayMusic("02_amb_strange.ogg", true, 0.2f, 2, 0, true);
AddUseItemCallback("", "bucket_empty_1", "AreaFillBucket", "FillBucketFunc", true);
}
void FillBucketFunc(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "04_water_puff.snt", AreaFillBucket", 0.0f, true);
RemoveItem(asItem);
GiveItemFromFile("filled_bucket", "wooden_bucket_filled.ent");
}
Also if I remove the "void FillBucketFunc" part the map works..
What did I do wrong?
Thanks in advance.