This doesn't seem to be working on 90% of the objects ive tried it on.
I've had a good look at itemdesc for items to see if there are any major differences in the items that DO report a usescript and those that DON"T.
Cant find anything though, its not particular to type (Container, item, weapon, etc) or how the Script is declared (ie, Script :pkgname:script).
Edit:
oh, read documentation... seems a bit weird only making it report the usescript for items that have had it set via script. Can i ask why this is?
item.usescript
-
mr bubbles
- Grandmaster Poster
- Posts: 120
- Joined: Thu Jan 18, 2007 2:34 am
You use the .usescript member to override an existing script or to set a script on an item which normally doesn't have one.
If you search an example you can take a look at the tinker traps or the secure containers which are normally in every script base.
If you place a trap on a container you set the usescript of the container to the script which handles what has to be done if someone double clicks that container. If the trap explodes or someone removes the trap you set the container.usescript := ""; and the container is handled normally again.
So that is not a bug, it's a feature
If you search an example you can take a look at the tinker traps or the secure containers which are normally in every script base.
If you place a trap on a container you set the usescript of the container to the script which handles what has to be done if someone double clicks that container. If the trap explodes or someone removes the trap you set the container.usescript := ""; and the container is handled normally again.
So that is not a bug, it's a feature
In the itemdesc.cfg file you define the script, not the use script, for what script will run when double clicked. .usescript <scriptname> is a text command that will override the script entry in the configuration file for the targetted item only.mr bubbles wrote:script is for the ai script on mobiles, usescript is the (doubleclick) script on items.