Information about onInsert and related scripts

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Information about onInsert and related scripts

Post by xeon »

Hi @all, I got a question about onInsert script and that like.

Basically, in the documentation it is written that:
When Is It Called?
After the item is moved into (or created in) a container, by user dragging, script function, or the core.
Where Does It Live?
The 'program' in a .src file, in a package or /scripts/control
What I would like to know is: which canInsert/onInsert script is called?
All?
The one in which is defined the item which is being moved?
The one in which is defined the container to which the item is being moved?

This to make definitively clarity about this type of scripts. Searching the documentation or the forum didn't answer me.

Many thanks!
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Re: Information about onInsert and related scripts

Post by Yukiko »

The container into which the item is being created/dragged. There might be a reference where the container is defined in the itemdesc.cfg file if that container requires a custom imsert script.. If there is no special OnInsert script defined under the container then it defaults to the one in /scripts/control I believe. The location of the default OnInsert script might have changed in the cores later than 0.96. I mention this because I saw your post in the 0.96 core section so I assume you're using that core.
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: Information about onInsert and related scripts

Post by xeon »

Yes, I'm on 096. I've seen, re-reading the doc, which a container can have the canInsert/onInsert script manually specified. I didn't recall that.

Question answered, thanks Yukiko!
Post Reply