You could write a script about it - and nobody would even rip you off! That's how grim it is.
Now you know a contract signed in advance of any 'collaborative' effort can be worth its weight in gold.
So at least you get to share in the option money.
After that you will both be robbed blind by the producer.
Who will then be screwed by the studio and the distributor.