take v ontake

guzmere
30 Sept 2012, 17:53
Hello all hope you are ok, just a quick thought really. I wondered if there was a difference between ontake and take. The reason why I'm asking is because I made an object called (brick) and it worked quite well until I changed one or two different aspects of it and it would not work. So I looked all round and could not find the problem, until I looked at the code view and noticed that the (take) section had been duplicated with an (ontake) section. But the ontake section was the old version of the object (brick). I then deleted the (ontake) section and all worked ok again. Has anyone else had this problem. Thanks Terry :D :D :D :D

jaynabonne
30 Sept 2012, 20:52
Looking at the online help and the code, it looks like "take" specifies how the object is taken (whether it can be, does it have a script to do the taking or is it just a boolean, which means the default take action happens), whereas "ontake" is a script that is invoked (if it exists) *after* an object is taken.

I'm not really sure what you had done, but I suspect that somehow you ended up with your "take" code broken, either by putting in your own script somehow - which means the default "take" action would not... uh... take place - or something else twisted which I can't even imagine. :)

I would not think adding an "ontake" on its own would do much to hamper taking, as it fires off after the taking has already taken place.

Take that for what you will.

guzmere
01 Oct 2012, 05:17
Hi Jaynabonne hope you are OK thanks for replying. Yes it was a script of which I had split into a (first time and otherwise) because of using the same object in two places. Thinking of it now the way you have explained it makes more sense. It just seemed strange the way it had duplicated itself in the code view. I had meant for the object to be used just once, but then as the game progressed I decided to use it in another place, and that's when I changed the coding. Once again thanks a lot. Terry :D :D :D :D