Issue with Field Buy Icons and Gates

Your forum for all discussions around Modding.
User avatar
BigTex114
Posts: 87
Joined: Sat Feb 03, 2018 7:44 pm

Issue with Field Buy Icons and Gates

Post by BigTex114 »

So I'm making progress on my first map, a central Texas farm/ranch, and I'm really happy with how it's coming along. I've built two fields from scratch, and gone through a couple tutorials to get them set up. I've got the field dimensions, field map indicators, and field buy indicators. I can successfully toggle render field areas and set field sizes. It all looks good. When I go into game mode the buy icons are there. But they don't function. I get nothing.

On a related note, I can't get my gates to function either. I've tried four different gates, two I got from mod hub and two I exported from other maps. No luck with any of them. However, when I buy from the store in game, those gates open and close. So I must be missing something with the gates I'm importing. Any thoughts?

Btw, I'm relying as much as I can on the tutorials. There are so many good ones out there on YouTube and I'm grateful to everybody who's made videos.

Thanks
Playing Marwell Manor on Windows :gamer:
User avatar
mcatalyst
Posts: 336
Joined: Tue Sep 22, 2015 6:19 am

Re: Issue with Field Buy Icons and Gates

Post by mcatalyst »

When you import the gates you also have to manually add the animatedObjects.xml information which should be part of the import files.

In the i3d (or GE User Attributes) make sure this all matches up.

<UserAttribute nodeId="####">
<Attribute name="index" type="string" value="__Gate___"/>
<Attribute name="onCreate" type="scriptCallback" value="AnimatedObject.onCreate"/>
<Attribute name="xmlFilename" type="string" value="animatedObjects.xml"/>
</UserAttribute>

That is assuming the animatedObjects.xml is in the root of the mod where the modDesc.xml is located.
Myrithis - Catalyzer Industries
User avatar
BigTex114
Posts: 87
Joined: Sat Feb 03, 2018 7:44 pm

Re: Issue with Field Buy Icons and Gates

Post by BigTex114 »

Okay I'm working on it, thanks. Don't have it right yet.

Edit: Just so I understand, I've got to edit the modDesc.xml file to reference the animatedObjects.xml file in the directory?
Playing Marwell Manor on Windows :gamer:
User avatar
mcatalyst
Posts: 336
Joined: Tue Sep 22, 2015 6:19 am

Re: Issue with Field Buy Icons and Gates

Post by mcatalyst »

BigTex114 wrote: Wed Mar 14, 2018 12:54 am Okay I'm working on it, thanks. Don't have it right yet.

Edit: Just so I understand, I've got to edit the modDesc.xml file to reference the animatedObjects.xml file in the directory?
No, that is part of the i3d file. When you import the gate it should already have the animatedObjects.xml referenced in the User Attributes but it is missing the onCreate attribute to enable the trigger. At least that is my experience with the Wooden Gate prefab. The only thing you need to do outside of GE really is to add the animatedObjects.xml file into the root of the folder where the modDesc.xml file is located. You should be able to find the animatedObjects.xml file in the prefab gate folder.
Myrithis - Catalyzer Industries
User avatar
BigTex114
Posts: 87
Joined: Sat Feb 03, 2018 7:44 pm

Re: Issue with Field Buy Icons and Gates

Post by BigTex114 »

Okay. But with multiple mods won't you end up with multiple animatedObjects.xml files in the same root folder? Or would one file cover all gate types?
Playing Marwell Manor on Windows :gamer:
User avatar
mcatalyst
Posts: 336
Joined: Tue Sep 22, 2015 6:19 am

Re: Issue with Field Buy Icons and Gates

Post by mcatalyst »

If you already have an animatedObjects.xml file then you want to copy the containers inside the animatedObjects.xml file in the new mod and append it after the existing containers which are already there.
Myrithis - Catalyzer Industries
User avatar
BigTex114
Posts: 87
Joined: Sat Feb 03, 2018 7:44 pm

Re: Issue with Field Buy Icons and Gates

Post by BigTex114 »

Thanks for your help. I don't have this going yet. I'll keep working on it.
Playing Marwell Manor on Windows :gamer:
User avatar
BigTex114
Posts: 87
Joined: Sat Feb 03, 2018 7:44 pm

Re: Issue with Field Buy Icons and Gates

Post by BigTex114 »

Well after a week I finally have working gates but without the sound effect. lol

Edit: got the sound effect. Just had to copy the .wav file to the right directory.

Thanks for everybody's help.
Playing Marwell Manor on Windows :gamer:
Post Reply