How to use itmIsInstalled

Freeform discussion about anything related to modding Transcendence.
Post Reply
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

I am trying to use itmIsInstalled in some code, but the Xelerus page for it says that the item is the itemStruct. Is it the same as the UNID? An example is:
(itmIsInstalled (itmCreate &itSolarReactorFlywheel; 1))
It keeps evaluating as Nil, when I clearly have it installed on my ship
What am I missing?
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
Bobby
Militia Captain
Militia Captain
Posts: 675
Joined: Wed Jul 25, 2007 7:39 pm

If I understand itmCreate properly it creates a new item on the spot, but doesn't do anything with it or put it anywhere without some other code. This newly created item is certainly not installed.

What you need to do is pass it the itemStruct of your device. things that may work:

1. use it inside the event or invoke on your item, and call gItem instead of itmCreate.
2. use objEnumItems to compare unids of devices installed on a ship.
3. use attributes to check if the ship has a device with x attribute.
ImageImage
Thanks to digdug for the banners.
Post Reply